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

Function tc_owner_open

tests/test_test_conventions.c:518–541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516} tc_owner_fixture_t;
517
518static bool tc_owner_open(tc_owner_fixture_t *f) {
519 *f = (tc_owner_fixture_t){0};
520 cbm_test_declarations_t *config = tc_config(TC_CASE0, NULL);
521 f->owners = config ? tc_extract(TC_OWNER_SOURCE, CBM_LANG_C,
522 "src/owner.c", config) : NULL;
523 cbm_test_declarations_free(config);
524 f->stale = tc_legacy(TC_STALE_SOURCE, CBM_LANG_C, "src/owner.c");
525 f->one = tc_def(f->owners, "CHECK_one");
526 if (!tc_ok(f->owners) || !tc_role(f->owners, "CHECK_one", CBM_TEST_ROLE_CASE) ||
527 !f->owners->has_test_definition_owners || !f->owners->cached_tree ||
528 !f->stale || !f->stale->cached_tree || !f->one ||
529 strlen(TC_OWNER_SOURCE) != strlen(TC_STALE_SOURCE)) return false;
530 int a = snprintf(f->caller, sizeof(f->caller), "%s", f->one->qualified_name);
531 int b = snprintf(f->callee, sizeof(f->callee), "%s.foo", f->owners->module_qn);
532 if (a <= 0 || (size_t)a >= sizeof(f->caller) ||
533 b <= 0 || (size_t)b >= sizeof(f->callee)) return false;
534 static const char *parameters[] = {"int"};
535 f->foo = (CBMLSPDef){
536 .qualified_name = f->callee, .short_name = "foo", .label = "Function",
537 .def_module_qn = f->owners->module_qn, .return_types = "void",
538 .signature_param_types = parameters, .signature_param_count = 1,
539 .lang = CBM_LANG_C};
540 return true;
541}
542
543static void tc_owner_close(tc_owner_fixture_t *f) {
544 cbm_free_result(f->owners);

Callers 1

Calls 7

tc_configFunction · 0.85
tc_extractFunction · 0.85
tc_legacyFunction · 0.85
tc_defFunction · 0.85
tc_okFunction · 0.85
tc_roleFunction · 0.85

Tested by

no test coverage detected