Branch Coverage

TimeZoneFinder.xs
Criterion Covered Total %
branch 122 166 73.4


line true false branch
64 0 1 Newxz(index->entries, num_entries, struct index_entry);
65 0 1 Newxz(index->matches, num_entries, struct index_entry *);
78 1 1 if (index->entries != NULL) {
80 6 1 for (i = 0; i < n; ++i) {
87 1 1 if (index->matches != NULL) {
99 0 2 if (self->dbf_fp != NULL) {
103 1 1 if (self->shp_fp != NULL) {
107 2 0 if (self->dbf_filename != NULL) {
110 2 0 if (self->shp_filename != NULL) {
135 1 0 while (field != NULL) {
136 1 0 if (is_tzid(field)) {
143 0 1 if (!has_tzid) {
148 0 1 if (header->num_records == 0) {
173 0 6 if (dbf_record_is_deleted(record)) {
177 0 6 if (self->dbf_num >= index->num_entries) {
185 6 0 while (field != NULL) {
186 6 0 if (is_tzid(field)) {
221 0 6 if (self->shp_num >= index->num_entries) {
228 6 0 if (record->shape_type == SHPT_POLYGON) {
282 1 9 if (lat == 90.0) {
284 25 1 for (i = 0; i < 25; ++i) {
289 8 1 else if (lon == -180.0 || lon == 180.0) {
1 7 else if (lon == -180.0 || lon == 180.0) {
309 65 1 for (i = 0; i < 25; ++i) {
311 7 58 if (lon >= z->left && lon <= z->right) {
5 2 if (lon >= z->left && lon <= z->right) {
315 3 62 if (lon >= z->right) {
340 42 7 for (i = 0; i < n; ++i) {
342 6 36 if (shp_box_point_in_box(&entry->box, location) != 0) {
349 2 5 if (m == 1) {
358 4 5 for (i = 0; i < m; ++i) {
362 4 0 if (offset > (size_t) LONG_MAX
363 0 4 || fseek(fp, (long) offset, SEEK_SET) != 0) {
370 0 4 if (shp_read_record(fh, &record) < 0) {
375 4 0 if (record != NULL) {
376 4 0 if (record->shape_type == SHPT_POLYGON) {
378 2 2 if (shp_polygon_point_in_polygon(polygon, location) != 0) {
410 0 3 if ((items - 1) % 2 != 0) {
414 2 3 for (i = 1; i < items; i += 2) {
415 2 0 key = SvPV_nolen_const(ST(i));
417 2 0 if (strEQ(key, "file_base")) {
422 1 2 if (file_base == NULL) {
429 2 1 XCPT_TRY_START {
436 2 0 self->dbf_fp = fopen(SvPV_nolen_const(self->dbf_filename), "rb");
437 1 1 if (self->dbf_fp == NULL) {
442 1 0 self->shp_fp = fopen(SvPV_nolen_const(self->shp_filename), "rb");
443 0 1 if (self->shp_fp == NULL) {
449 0 1 if (dbf_read(dbf_fh, handle_dbf_header, handle_dbf_record) < 0) {
460 0 1 if (self->dbf_num != expected_size) {
467 0 1 if (shp_read(shp_fh, handle_shp_header, handle_shp_record) < 0) {
472 0 1 if (self->shp_num != expected_size) {
478 1 1 XCPT_CATCH {
480 1 0 XCPT_RETHROW;
0 0 XCPT_RETHROW;
505 20 0 U8 gimme = GIMME_V;
507 0 20 if ((items - 1) % 2 != 0) {
508 0 0 warn("Odd-length list passed to %s method",
512 38 20 for (i = 1; i < items; i += 2) {
513 38 0 key = SvPV_nolen_const(ST(i));
515 21 17 if (strEQ(key, "lat") || strEQ(key, "latitude")) {
2 19 if (strEQ(key, "lat") || strEQ(key, "latitude")) {
518 2 17 else if (strEQ(key, "lon") || strEQ(key, "longitude")) {
2 0 else if (strEQ(key, "lon") || strEQ(key, "longitude")) {
523 1 19 if (latitude == NULL) {
527 1 18 if (longitude == NULL) {
531 2 16 if (!SvNIOK(latitude)) {
536 2 14 if (!SvNIOK(longitude)) {
541 5 9 lat = SvNV(latitude);
542 8 6 lon = SvNV(longitude);
544 14 0 if (Perl_isnan(lat) || lat < -90.0 || lat > 90.0) {
13 1 if (Perl_isnan(lat) || lat < -90.0 || lat > 90.0) {
1 12 if (Perl_isnan(lat) || lat < -90.0 || lat > 90.0) {
549 12 0 if (Perl_isnan(lon) || lon < -180.0 || lon > 180.0) {
11 1 if (Perl_isnan(lon) || lon < -180.0 || lon > 180.0) {
1 10 if (Perl_isnan(lon) || lon < -180.0 || lon > 180.0) {
559 7 3 if (av_len(time_zones) < 0) {
561 4 3 if (av_len(time_zones) < 0) {
567 38 9 for (tz_num = 0; tz_num < tz_count; ++tz_num) {
569 38 0 if (svp != NULL) {
570 0 38 XPUSHs(SvREFCNT_inc(*svp));
571 37 1 if (gimme == G_SCALAR || ix == 1) {
37 0 if (gimme == G_SCALAR || ix == 1) {
592 6 1 for (i = 0; i < n; ++i) {