Total lines covered by every range in the string. */
| 681 | |
| 682 | /* Total lines covered by every range in the string. */ |
| 683 | static unsigned int ranges_total_span(const char *ranges) { |
| 684 | const char *p = ranges; |
| 685 | unsigned int total = 0; |
| 686 | while (p && *p) { |
| 687 | unsigned int s = 0, e = 0; |
| 688 | if (sscanf(p, "%u-%u", &s, &e) == 2 && e >= s) { |
| 689 | total += e - s + 1; |
| 690 | } |
| 691 | p = strchr(p, ','); |
| 692 | if (p) { |
| 693 | p++; |
| 694 | } |
| 695 | } |
| 696 | return total; |
| 697 | } |
| 698 | |
| 699 | TEST(c_ifdef_split_range_narrows_to_dropped_branch) { |
| 700 | /* RED before the refinement: the raw range covers the whole 5-11 |