MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cv2_test_ids

Function cv2_test_ids

src/mcp/test_impact_coverage.c:1043–1071  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1041}
1042
1043static 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
1073static bool cv2_tests(cv2_context_t *ctx, cv2_span_t tests) {
1074 size_t position = 0;

Callers 1

cv2_testsFunction · 0.85

Calls 5

cv2_id_countFunction · 0.85
cv2_arrayFunction · 0.85
cv2_stepFunction · 0.85
cv2_decimalFunction · 0.85
cv2_failFunction · 0.85

Tested by

no test coverage detected