| 1041 | } |
| 1042 | |
| 1043 | static bool cv2_test_ids(cv2_context_t *ctx, cv2_span_t span, cbm_coverage_test_t *row) { |
| 1044 | int count; |
| 1045 | if (!cv2_id_count(ctx, span, &count)) |
| 1046 | return false; |
| 1047 | if (!count) |
| 1048 | return true; |
| 1049 | int *ids = cv2_array(ctx, (size_t)count, sizeof(*ids)); |
| 1050 | if (!ids) |
| 1051 | return false; |
| 1052 | size_t start = 0; |
| 1053 | for (int i = 0; i < count; i++) { |
| 1054 | size_t end = start; |
| 1055 | while (end < span.length && span.data[end] != ' ') { |
| 1056 | if (!cv2_step(ctx)) |
| 1057 | return false; |
| 1058 | end++; |
| 1059 | } |
| 1060 | uint64_t id; |
| 1061 | if (!cv2_decimal(ctx, (cv2_span_t){span.data + start, end - start}, false, &id)) |
| 1062 | return false; |
| 1063 | if (id >= (uint64_t)ctx->profile_count || (i && id <= (uint64_t)ids[i - 1])) |
| 1064 | return cv2_fail(ctx, CBM_COVERAGE_PARSE_FORMAT); |
| 1065 | ids[i] = (int)id; |
| 1066 | start = end + 1; |
| 1067 | } |
| 1068 | row->function_ids = ids; |
| 1069 | row->function_count = count; |
| 1070 | return true; |
| 1071 | } |
| 1072 | |
| 1073 | static bool cv2_tests(cv2_context_t *ctx, cv2_span_t tests) { |
| 1074 | size_t position = 0; |
no test coverage detected