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

Function cv_ids

src/mcp/test_impact_coverage.c:158–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158static bool cv_ids(cbm_coverage_map_t *map, cbm_coverage_test_t *row, const char *text,
159 bool *seen) {
160 if (!*text) {
161 return true;
162 }
163 int count = 1;
164 for (const char *p = text; *p; p++) {
165 if (*p == ' ') {
166 if (count == INT_MAX) {
167 return false;
168 }
169 count++;
170 }
171 }
172 /* A row cannot contain more unique IDs than there are function records.
173 * Allocate from actual input tokens, never from a claimed numeric ID. */
174 if (count > map->function_count) {
175 return false;
176 }
177 int *ids = cv_array(map, count, sizeof(*ids));
178 if (!ids) {
179 return false;
180 }
181 for (int i = 0; i < count; i++) {
182 const char *end;
183 if (!cv_decimal(text, &ids[i], &end) || ids[i] >= map->function_count ||
184 (i > 0 && ids[i] <= ids[i - 1])) {
185 return false;
186 }
187 seen[ids[i]] = true;
188 if (i + 1 < count) {
189 if (*end != ' ') {
190 return false;
191 }
192 text = end + 1;
193 } else if (*end) {
194 return false;
195 }
196 }
197 row->function_ids = ids;
198 row->function_count = count;
199 return true;
200}
201
202static bool cv_tests(cbm_coverage_map_t *map, char *text, bool *seen) {
203 for (int i = 0; i < map->test_count; i++) {

Callers 1

cv_testsFunction · 0.85

Calls 2

cv_arrayFunction · 0.85
cv_decimalFunction · 0.85

Tested by

no test coverage detected