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

Function scan_fixture_run

tests/test_mcp.c:24636–24651  ·  view source on GitHub ↗

Run the scan; returns the records it wrote (caller frees), CRs kept. */

Source from the content-addressed store, hash-verified

24634
24635/* Run the scan; returns the records it wrote (caller frees), CRs kept. */
24636static char *scan_fixture_run(const scan_fixture_t *fx, const char *pattern, bool use_regex,
24637 size_t output_limit, int *cause) {
24638 *cause = cbm_mcp_search_scan_for_test(NULL, fx->list, pattern, use_regex, fx->out,
24639 output_limit, UINT64_MAX);
24640 FILE *fp = cbm_fopen(fx->out, "rb");
24641 if (!fp) {
24642 return NULL;
24643 }
24644 char *text = calloc(CBM_SZ_64K, 1);
24645 size_t length = text ? fread(text, 1, CBM_SZ_64K - 1, fp) : 0;
24646 (void)fclose(fp);
24647 if (text) {
24648 text[length] = '\0';
24649 }
24650 return text;
24651}
24652
24653/* Append one expected record to `buf`. */
24654static void scan_expect(char *buf, size_t cap, const char *path, int line, const char *content) {

Callers 1

test_mcp.cFile · 0.85

Calls 3

cbm_fopenFunction · 0.85
freadFunction · 0.85

Tested by

no test coverage detected