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

Function write_context_fixture

tests/test_mcp.c:23938–23952  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23936enum { CTX_FIXTURE_LINES = 1000, CTX_FIXTURE_NEEDLE_LINE = 500, CTX_BOUND = 200 };
23937
23938static bool write_context_fixture(const char *tmp, char *path, size_t path_sz) {
23939 snprintf(path, path_sz, "%s/project/long.md", tmp);
23940 FILE *fp = cbm_fopen(path, "wb");
23941 if (!fp) {
23942 return false;
23943 }
23944 for (int line = 1; line <= CTX_FIXTURE_LINES; line++) {
23945 if (line == CTX_FIXTURE_NEEDLE_LINE) {
23946 fprintf(fp, "needle-context-window\n");
23947 } else {
23948 fprintf(fp, "line %04d\n", line);
23949 }
23950 }
23951 return fclose(fp) == 0;
23952}
23953
23954static bool upsert_context_fixture_node(cbm_mcp_server_t *srv) {
23955 cbm_store_t *st = cbm_mcp_server_store(srv);

Callers 1

test_mcp.cFile · 0.85

Calls 1

cbm_fopenFunction · 0.85

Tested by

no test coverage detected