Branch Coverage

src/panda/time/tzparse_format.icc
Criterion Covered Total %
branch 53 128 41.4


line true false branch
27 343106 25767 if (a->start < b->start) return -1;
28 0 25767 else if (a->start == b->start) return 0;
44 0 1240 if (ptr + sizeof(head) > end) return -1;
0 1240 if (ptr + sizeof(head) > end) return -1;
48 0 1240 if (strncmp(head.tzh_magic, FTZ_MAGIC, sizeof(head.tzh_magic)) != 0) {
0 1240 if (strncmp(head.tzh_magic, FTZ_MAGIC, sizeof(head.tzh_magic)) != 0) {
53 1240 0 *version = head.tzh_version[0] ? (head.tzh_version[0] - '0') : 1;
1240 0 *version = head.tzh_version[0] ? (head.tzh_version[0] - '0') : 1;
67 0 1240 if (head.tzh_typecnt > FTZ_MAX_TYPES) {
0 1240 if (head.tzh_typecnt > FTZ_MAX_TYPES) {
72 0 1240 if (head.tzh_charcnt > FTZ_MAX_CHARS) {
0 1240 if (head.tzh_charcnt > FTZ_MAX_CHARS) {
77 0 1240 if (head.tzh_leapcnt > FTZ_MAX_LEAPS) {
0 1240 if (head.tzh_leapcnt > FTZ_MAX_LEAPS) {
86 0 1240 if (ptr + PTIME_TZPARSE_BODY_BASE_SIZE(head) > end) return false;
0 0 if (ptr + PTIME_TZPARSE_BODY_BASE_SIZE(head) > end) return false;
95 6797 1240 for (uint32_t i = 0; i < head.tzh_typecnt; i++) {
0 0 for (uint32_t i = 0; i < head.tzh_typecnt; i++) {
105 609 631 zone->leaps = zone->leaps_cnt > 0 ? new Timezone::Leap[zone->leaps_cnt] : NULL;
609 0 zone->leaps = zone->leaps_cnt > 0 ? new Timezone::Leap[zone->leaps_cnt] : NULL;
609 0 zone->leaps = zone->leaps_cnt > 0 ? new Timezone::Leap[zone->leaps_cnt] : NULL;
0 0 zone->leaps = zone->leaps_cnt > 0 ? new Timezone::Leap[zone->leaps_cnt] : NULL;
0 0 zone->leaps = zone->leaps_cnt > 0 ? new Timezone::Leap[zone->leaps_cnt] : NULL;
0 0 zone->leaps = zone->leaps_cnt > 0 ? new Timezone::Leap[zone->leaps_cnt] : NULL;
106 16443 1240 for (uint32_t i = 0; i < head.tzh_leapcnt; i++) {
0 0 for (uint32_t i = 0; i < head.tzh_leapcnt; i++) {
121 1552 2 for (uint32_t i = 0; i < head.tzh_timecnt; ++i) {
0 0 for (uint32_t i = 0; i < head.tzh_timecnt; ++i) {
122 314 1238 if (ilocaltypes[i] != 0) continue;
0 0 if (ilocaltypes[i] != 0) continue;
126 1238 2 if (past_lt_index < 0) for (uint32_t i = 0; i < head.tzh_typecnt; ++i) {
1254 0 if (past_lt_index < 0) for (uint32_t i = 0; i < head.tzh_typecnt; ++i) {
0 0 if (past_lt_index < 0) for (uint32_t i = 0; i < head.tzh_typecnt; ++i) {
0 0 if (past_lt_index < 0) for (uint32_t i = 0; i < head.tzh_typecnt; ++i) {
127 16 1238 if (localtypes[i].isdst) continue;
0 0 if (localtypes[i].isdst) continue;
131 0 1240 if (past_lt_index < 0) past_lt_index = 0;
0 0 if (past_lt_index < 0) past_lt_index = 0;
134 1240 0 zone->trans = new Timezone::Transition[zone->trans_cnt];
1240 0 zone->trans = new Timezone::Transition[zone->trans_cnt];
0 0 zone->trans = new Timezone::Transition[zone->trans_cnt];
0 0 zone->trans = new Timezone::Transition[zone->trans_cnt];
150 0 1240 if (strlen(past_abbrev) > ZONE_ABBR_MAX) {
0 0 if (strlen(past_abbrev) > ZONE_ABBR_MAX) {
157 86578 1240 for (uint32_t i = 0; i < head.tzh_timecnt; ++i) {
0 0 for (uint32_t i = 0; i < head.tzh_timecnt; ++i) {
172 16443 1240 for (uint32_t i = 0; i < zone->leaps_cnt; i++) {
0 0 for (uint32_t i = 0; i < zone->leaps_cnt; i++) {
178 1240 0 qsort(zone->trans, zone->trans_cnt, sizeof(*zone->trans), trans_cmp);
0 0 qsort(zone->trans, zone->trans_cnt, sizeof(*zone->trans), trans_cmp);
180 103021 1240 for (uint32_t i = 1; i < zone->trans_cnt; ++i) {
0 0 for (uint32_t i = 1; i < zone->trans_cnt; ++i) {
184 16443 86578 if (this_trans->leap_corr != 0) {
0 0 if (this_trans->leap_corr != 0) {
210 0 1240 if (posixstr >= end) { zone->clear(); return false; }
212 0 1240 if (posixend == NULL) { zone->clear(); return false; }
217 0 1240 if (posixend == posixstr) { // no posix string, using last transition
0 0 if (posixend == posixstr) { // no posix string, using last transition
223 1240 0 else if (!tzparse_rule(string_view(posixstr, posixend-posixstr), &zone->future)) {
0 1240 else if (!tzparse_rule(string_view(posixstr, posixend-posixstr), &zone->future)) {
0 0 else if (!tzparse_rule(string_view(posixstr, posixend-posixstr), &zone->future)) {
0 0 else if (!tzparse_rule(string_view(posixstr, posixend-posixstr), &zone->future)) {
230 452 788 if (zone->future.hasdst) {
0 0 if (zone->future.hasdst) {