Branch Coverage

Piece.xs
Criterion Covered Total %
branch 273 476 57.3


line true false branch
39 0 19 const int era = (y >= 0 ? y : y-399) / 400;
41 14 5 const int doy = (153*(m + (m > 2 ? -3 : 9)) + 2)/5 + d-1;
51 0 19 if (month > 11) {
54 0 19 } else if (month < 0) {
213 284 0 if (ptm->tm_yday >= 0 && mday <= 0 && month <= 0) {
1 283 if (ptm->tm_yday >= 0 && mday <= 0 && month <= 0) {
1 0 if (ptm->tm_yday >= 0 && mday <= 0 && month <= 0) {
221 183 101 if (month >= 2)
234 284 0 if ((unsigned) ptm->tm_sec <= 60) {
243 5 279 if (secs < 0) {
244 5 0 if (secs-(secs/SECS_PER_DAY*SECS_PER_DAY) < 0) {
255 6 273 else if (secs >= SECS_PER_DAY) {
285 11 273 if (!yearday && (odd_cent==4 || odd_year==4)) { /* catch Feb 29 */
7 4 if (!yearday && (odd_cent==4 || odd_year==4)) { /* catch Feb 29 */
2 5 if (!yearday && (odd_cent==4 || odd_year==4)) { /* catch Feb 29 */
294 86 192 if (month > 13) {
303 282 2 if (yearday) {
324 0 198 if (!result) {
334 0 257 if (!result) {
396 2549 396 while (*ptr != 0) {
397 0 2549 if (*buf == 0)
402 1111 1438 if (c != '%') {
403 349 762 if (isSPACE((unsigned char)c))
404 710 0 while (*buf != 0 && isSPACE((unsigned char)*buf))
361 349 while (*buf != 0 && isSPACE((unsigned char)*buf))
406 0 762 else if (c != *buf++) {
420 0 0 if (*buf++ != '%')
426 0 0 if (buf == 0)
431 0 0 if (!isDIGIT((unsigned char)*buf))
436 0 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
0 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
0 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
441 0 0 if (i < 19)
449 0 8 if (buf == 0)
454 0 0 if (Ealternative || Oalternative)
0 0 if (Ealternative || Oalternative)
460 0 0 if (Ealternative || Oalternative)
0 0 if (Ealternative || Oalternative)
467 0 66 if (buf == 0)
473 0 0 if (buf == 0)
480 16 0 if (am_sv && SvPOK(*am_sv) && SvCUR(*am_sv) > 0) {
16 0 if (am_sv && SvPOK(*am_sv) && SvCUR(*am_sv) > 0) {
16 0 if (am_sv && SvPOK(*am_sv) && SvCUR(*am_sv) > 0) {
486 0 16 if (buf == 0)
492 0 0 if (!isSPACE((unsigned char)*buf))
494 0 0 while (isSPACE((unsigned char)*buf))
500 0 74 if (buf == 0)
505 0 1 if (!isDIGIT((unsigned char)*buf))
509 3 1 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
3 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
3 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
514 1 0 if (i < 1 || i > 366)
0 1 if (i < 1 || i > 366)
523 360 0 if (*buf == 0 || isSPACE((unsigned char)*buf))
360 0 if (*buf == 0 || isSPACE((unsigned char)*buf))
526 0 360 if (!isDIGIT((unsigned char)*buf))
530 720 360 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
720 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
720 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
536 186 174 if (c == 'M') {
537 0 186 if (i > 59)
541 0 174 if (i > 60)
546 247 113 if (*buf != 0 && isSPACE((unsigned char)*buf))
70 177 if (*buf != 0 && isSPACE((unsigned char)*buf))
547 70 0 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
0 70 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
563 0 193 if (!isDIGIT((unsigned char)*buf))
567 386 190 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
383 3 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
383 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
572 16 177 if (c == 'H' || c == 'k') {
0 16 if (c == 'H' || c == 'k') {
573 0 177 if (i > 23)
575 0 16 } else if (i > 12) {
582 186 7 if (*buf != 0 && isSPACE((unsigned char)*buf))
0 186 if (*buf != 0 && isSPACE((unsigned char)*buf))
583 0 0 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
0 0 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
596 16 0 if (am_sv && SvPOK(*am_sv) && AM_sv && SvPOK(*AM_sv)) {
16 0 if (am_sv && SvPOK(*am_sv) && AM_sv && SvPOK(*AM_sv)) {
16 0 if (am_sv && SvPOK(*am_sv) && AM_sv && SvPOK(*AM_sv)) {
16 0 if (am_sv && SvPOK(*am_sv) && AM_sv && SvPOK(*AM_sv)) {
599 0 16 len = MIN(strlen(am_str),strlen(AM_str));
600 4 12 if ((strncasecmp(buf, am_str, len) == 0) ||
601 0 4 strncasecmp(buf, AM_str, len) == 0) {
602 0 12 if (tm->tm_hour > 12) {
607 8 4 if (tm->tm_hour == 12)
616 4 0 if (pm_sv && SvPOK(*pm_sv) && PM_sv && SvPOK(*PM_sv)) {
4 0 if (pm_sv && SvPOK(*pm_sv) && PM_sv && SvPOK(*PM_sv)) {
4 0 if (pm_sv && SvPOK(*pm_sv) && PM_sv && SvPOK(*PM_sv)) {
4 0 if (pm_sv && SvPOK(*pm_sv) && PM_sv && SvPOK(*PM_sv)) {
619 0 4 len = MIN(strlen(pm_str),strlen(PM_str));
620 0 4 if ((strncasecmp(buf, pm_str, len) == 0) ||
621 0 0 strncasecmp(buf, PM_str, len) == 0) {
622 0 4 if (tm->tm_hour > 12) {
626 4 0 if (tm->tm_hour != 12)
642 21 0 if (!weekday_sv || !wday_sv || !SvROK(*weekday_sv) || !SvROK(*wday_sv))
21 0 if (!weekday_sv || !wday_sv || !SvROK(*weekday_sv) || !SvROK(*wday_sv))
21 0 if (!weekday_sv || !wday_sv || !SvROK(*weekday_sv) || !SvROK(*wday_sv))
0 21 if (!weekday_sv || !wday_sv || !SvROK(*weekday_sv) || !SvROK(*wday_sv))
653 147 21 for (i = 0; i <= av_len(weekday_av); i++) {
658 147 0 if (day_sv && SvPOK(*day_sv)) {
147 0 if (day_sv && SvPOK(*day_sv)) {
660 139 8 if (len > best_len && strncasecmp(buf, day_str, len) == 0) {
9 130 if (len > best_len && strncasecmp(buf, day_str, len) == 0) {
668 147 0 if (day_sv && SvPOK(*day_sv)) {
147 0 if (day_sv && SvPOK(*day_sv)) {
670 108 39 if (len > best_len && strncasecmp(buf, day_str, len) == 0) {
12 96 if (len > best_len && strncasecmp(buf, day_str, len) == 0) {
677 0 21 if (best_match < 0) {
696 0 0 if (!isDIGIT((unsigned char)*buf))
700 0 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
0 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
0 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
705 0 0 if (i > 53)
708 0 0 if (*buf != 0 && isSPACE((unsigned char)*buf))
0 0 if (*buf != 0 && isSPACE((unsigned char)*buf))
709 0 0 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
0 0 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
715 0 0 if (!isDIGIT((unsigned char)*buf))
719 0 0 if (i > 6 + (c == 'u'))
0 0 if (i > 6 + (c == 'u'))
721 0 0 if (i == 7)
727 0 0 if (*buf != 0 && isSPACE((unsigned char)*buf))
0 0 if (*buf != 0 && isSPACE((unsigned char)*buf))
728 0 0 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
0 0 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
742 0 210 if (!isDIGIT((unsigned char)*buf))
746 420 197 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
420 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
407 13 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
751 0 210 if (i > 31)
756 202 8 if (*buf != 0 && isSPACE((unsigned char)*buf))
191 11 if (*buf != 0 && isSPACE((unsigned char)*buf))
757 125 66 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
0 125 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
762 0 3 if (!isDIGIT((unsigned char)*buf))
766 12 1 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
11 1 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
10 1 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
780 37 0 if (!month_sv || !mon_sv || !SvROK(*month_sv) || !SvROK(*mon_sv))
37 0 if (!month_sv || !mon_sv || !SvROK(*month_sv) || !SvROK(*mon_sv))
37 0 if (!month_sv || !mon_sv || !SvROK(*month_sv) || !SvROK(*mon_sv))
0 37 if (!month_sv || !mon_sv || !SvROK(*month_sv) || !SvROK(*mon_sv))
791 444 37 for (i = 0; i <= av_len(month_av); i++) {
796 444 0 if (month_sv_item && SvPOK(*month_sv_item)) {
444 0 if (month_sv_item && SvPOK(*month_sv_item)) {
798 383 61 if (len > best_len && strncasecmp(buf, month_str, len) == 0) {
9 374 if (len > best_len && strncasecmp(buf, month_str, len) == 0) {
806 444 0 if (month_sv_item && SvPOK(*month_sv_item)) {
444 0 if (month_sv_item && SvPOK(*month_sv_item)) {
808 120 324 if (len > best_len && strncasecmp(buf, month_str, len) == 0) {
28 92 if (len > best_len && strncasecmp(buf, month_str, len) == 0) {
815 0 37 if (best_match < 0) {
826 0 173 if (!isDIGIT((unsigned char)*buf))
830 346 173 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
346 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
346 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
835 173 0 if (i < 1 || i > 12)
0 173 if (i < 1 || i > 12)
840 173 0 if (*buf != 0 && isSPACE((unsigned char)*buf))
2 171 if (*buf != 0 && isSPACE((unsigned char)*buf))
841 2 0 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
0 2 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
856 8 0 if (errno == ERANGE || (long)(t = n) != n) {
0 8 if (errno == ERANGE || (long)(t = n) != n) {
881 198 0 if (*buf == 0 || isSPACE((unsigned char)*buf))
198 0 if (*buf == 0 || isSPACE((unsigned char)*buf))
884 0 198 if (!isDIGIT((unsigned char)*buf))
887 189 9 len = (c == 'Y') ? 4 : 2;
888 774 198 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
774 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
774 0 for (i = 0; len && *buf != 0 && isDIGIT((unsigned char)*buf); buf++) {
893 189 9 if (c == 'Y')
895 9 189 if (c == 'y' && i < 69)
9 0 if (c == 'y' && i < 69)
900 192 6 if (*buf != 0 && isSPACE((unsigned char)*buf))
28 164 if (*buf != 0 && isSPACE((unsigned char)*buf))
901 20 8 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
0 20 while (*ptr != 0 && !isSPACE((unsigned char)*ptr))
910 48 16 for (cp = buf; *cp && isUPPER((unsigned char)*cp); ++cp)
48 0 for (cp = buf; *cp && isUPPER((unsigned char)*cp); ++cp)
912 16 0 if (cp - buf) {
914 0 16 if (!zonestr) {
921 6 10 if (strEQ(zonestr, "GMT") || strEQ(zonestr, "UTC")) {
1 5 if (strEQ(zonestr, "GMT") || strEQ(zonestr, "UTC")) {
934 13 25 if (*buf != '+') {
935 13 0 if (*buf == '-')
945 154 35 for (len = 4; len > 0; len--) {
946 146 8 if (isDIGIT((unsigned char)*buf)) {
950 8 0 } else if (len == 2) {
952 5 3 if (*buf == ':') {
966 38 0 if (i > 1400 || (sign == -1 && i > 1200) || (i % 100) >= 60)
13 25 if (i > 1400 || (sign == -1 && i > 1200) || (i % 100) >= 60)
13 0 if (i > 1400 || (sign == -1 && i > 1200) || (i % 100) >= 60)
0 38 if (i > 1400 || (sign == -1 && i > 1200) || (i % 100) >= 60)
1017 0 284 EXTEND(SP, 11);
1031 2840 284 } while(SP <= endsp);
1053 176 192 if(islocal == 1)
1073 368 0 if ((len > 0 && len < TP_BUF_SIZE) || (len == 0 && *fmt == '\0'))
0 368 if ((len > 0 && len < TP_BUF_SIZE) || (len == 0 && *fmt == '\0'))
0 0 if ((len > 0 && len < TP_BUF_SIZE) || (len == 0 && *fmt == '\0'))
0 0 if ((len > 0 && len < TP_BUF_SIZE) || (len == 0 && *fmt == '\0'))
1083 0 0 while (buf) {
1085 0 0 if (buflen > 0 && buflen < bufsize)
0 0 if (buflen > 0 && buflen < bufsize)
1088 0 0 if (bufsize > 100*fmtlen) {
1096 0 0 if (buf) {
1134 232 0 if( SvTYPE(SvRV( localization )) == SVt_PVHV ){
1142 232 0 if (SvOK(defaults_ref) && SvROK(defaults_ref) && SvTYPE(SvRV(defaults_ref)) == SVt_PVAV) {
232 0 if (SvOK(defaults_ref) && SvROK(defaults_ref) && SvTYPE(SvRV(defaults_ref)) == SVt_PVAV) {
232 0 if (SvOK(defaults_ref) && SvROK(defaults_ref) && SvTYPE(SvRV(defaults_ref)) == SVt_PVAV) {
1144 33 199 if (av_len(defaults_av)+1 >= 8) {
1148 33 0 if (elem && SvOK(*elem)) mytm.tm_sec = (int)SvIV(*elem);
21 12 if (elem && SvOK(*elem)) mytm.tm_sec = (int)SvIV(*elem);
1150 33 0 if (elem && SvOK(*elem)) mytm.tm_min = (int)SvIV(*elem);
21 12 if (elem && SvOK(*elem)) mytm.tm_min = (int)SvIV(*elem);
1152 33 0 if (elem && SvOK(*elem)) mytm.tm_hour = (int)SvIV(*elem);
23 10 if (elem && SvOK(*elem)) mytm.tm_hour = (int)SvIV(*elem);
1154 33 0 if (elem && SvOK(*elem)) mytm.tm_mday = (int)SvIV(*elem);
23 10 if (elem && SvOK(*elem)) mytm.tm_mday = (int)SvIV(*elem);
1156 33 0 if (elem && SvOK(*elem)) mytm.tm_mon = (int)SvIV(*elem);
23 10 if (elem && SvOK(*elem)) mytm.tm_mon = (int)SvIV(*elem);
1158 33 0 if (elem && SvOK(*elem)) mytm.tm_year = (int)SvIV(*elem);
33 0 if (elem && SvOK(*elem)) mytm.tm_year = (int)SvIV(*elem);
1160 33 0 if (elem && SvOK(*elem)) mytm.tm_wday = (int)SvIV(*elem);
20 13 if (elem && SvOK(*elem)) mytm.tm_wday = (int)SvIV(*elem);
1162 33 0 if (elem && SvOK(*elem)) mytm.tm_yday = (int)SvIV(*elem);
20 13 if (elem && SvOK(*elem)) mytm.tm_yday = (int)SvIV(*elem);
1167 0 232 if (remainder == NULL) {
1170 0 232 if (*remainder != '\0') {
1176 57 175 if (got_GMT == 1 && islocal == 1) {
19 38 if (got_GMT == 1 && islocal == 1) {
1211 3 3 if(ix) mytm = safe_gmtime(aTHX_ &sec);
1215 0 6 EXTEND(SP, 10);
1226 54 6 } while(SP <= endsp);
1245 14 2 for(i = 0; i < 7; ++i){
1256 24 2 for(i = 0; i < 12; ++i){