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

Function source_fixture

tests/test_userconfig.c:229–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227} source_fixture_t;
228
229static bool source_fixture(source_fixture_t *f) {
230 int n = snprintf(f->dir, sizeof(f->dir), "%s/uc_source_XXXXXX", cbm_tmpdir());
231 if (n < 0 || (size_t)n >= sizeof(f->dir) || !cbm_mkdtemp(f->dir))
232 return false;
233 n = snprintf(f->path, sizeof(f->path), "%s/.codebase-memory.json", f->dir);
234 return n > 0 && (size_t)n < sizeof(f->path);
235}
236
237static int source_write(const char *path, const char *bytes) {
238 FILE *file = cbm_fopen(path, "wb");

Callers 1

test_userconfig.cFile · 0.85

Calls 2

cbm_tmpdirFunction · 0.85
cbm_mkdtempFunction · 0.85

Tested by

no test coverage detected