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

Function tsd_open

tests/test_test_impact_seed.c:38–61  ·  view source on GitHub ↗

Sources: pairs of (path, text). Model: the test sources among them. */

Source from the content-addressed store, hash-verified

36
37/* Sources: pairs of (path, text). Model: the test sources among them. */
38static bool tsd_open(tsd_fixture_t *f, const char *const *files, int count) {
39 memset(f, 0, sizeof(*f));
40 f->store = cbm_store_open_memory();
41 if (!f->store || cbm_store_upsert_project(f->store, "p", "/tmp/p") != CBM_STORE_OK) {
42 return false;
43 }
44 f->graph = cbm_ti_graph_new(f->store, "p");
45 f->source = cbm_ti_source_new();
46 f->model = cbm_test_model_new(cbm_test_conventions_cbm());
47 if (!f->graph || !f->source || !f->model) {
48 return false;
49 }
50 for (int i = 0; i < count; i += 2) {
51 size_t len = strlen(files[i + 1]);
52 if (!cbm_ti_source_add(f->source, files[i], files[i + 1], len)) {
53 return false;
54 }
55 if (strncmp(files[i], "tests/", 6) == 0 &&
56 !cbm_test_model_add_source(f->model, files[i], files[i + 1], len)) {
57 return false;
58 }
59 }
60 return cbm_ti_source_finish(f->source) && cbm_test_model_finish(f->model);
61}
62
63static void tsd_close(tsd_fixture_t *f) {
64 cbm_test_model_free(f->model);

Callers 1

Calls 10

cbm_store_open_memoryFunction · 0.85
cbm_store_upsert_projectFunction · 0.85
cbm_ti_graph_newFunction · 0.85
cbm_ti_source_newFunction · 0.85
cbm_test_model_newFunction · 0.85
cbm_test_conventions_cbmFunction · 0.85
cbm_ti_source_addFunction · 0.85
cbm_ti_source_finishFunction · 0.85
cbm_test_model_finishFunction · 0.85

Tested by

no test coverage detected