Join two Studio Export range strings and hand back the result. The caller * owns nothing: the string lives in the aggregate's arena, so copy it out * before the arena goes away. */
| 22937 | * owns nothing: the string lives in the aggregate's arena, so copy it out |
| 22938 | * before the arena goes away. */ |
| 22939 | static void join_export_ranges(const char *agg_ranges, int agg_regions, const char *part_ranges, |
| 22940 | int part_regions, char *out, size_t out_size, int *out_regions) { |
| 22941 | CBMFileResult aggregate; |
| 22942 | CBMFileResult part; |
| 22943 | memset(&aggregate, 0, sizeof(aggregate)); |
| 22944 | memset(&part, 0, sizeof(part)); |
| 22945 | cbm_arena_init(&aggregate.arena); |
| 22946 | cbm_arena_init(&part.arena); |
| 22947 | aggregate.error_ranges = agg_ranges; |
| 22948 | aggregate.error_region_count = agg_regions; |
| 22949 | aggregate.parse_incomplete = true; |
| 22950 | part.error_ranges = part_ranges; |
| 22951 | part.error_region_count = part_regions; |
| 22952 | part.parse_incomplete = true; |
| 22953 | |
| 22954 | out[0] = '\0'; |
| 22955 | *out_regions = 0; |
| 22956 | if (cbm_pipeline_coverage_marker_test_join(&aggregate, &part)) { |
| 22957 | snprintf(out, out_size, "%s", aggregate.error_ranges ? aggregate.error_ranges : ""); |
| 22958 | *out_regions = aggregate.error_region_count; |
| 22959 | } |
| 22960 | cbm_arena_destroy(&aggregate.arena); |
| 22961 | cbm_arena_destroy(&part.arena); |
| 22962 | } |
| 22963 | |
| 22964 | /* Count the "+" characters in a range string. A truncation marker must appear |
| 22965 | * once and only at the end: every reader stops at the first token that is not |
no test coverage detected