| 516 | } tc_owner_fixture_t; |
| 517 | |
| 518 | static 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 | |
| 543 | static void tc_owner_close(tc_owner_fixture_t *f) { |
| 544 | cbm_free_result(f->owners); |
no test coverage detected