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

Function tm_mapping_report

src/mcp/test_impact.c:149–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149static bool tm_mapping_report(cbm_test_model_t *m, cbm_test_model_mapping_status_t reason,
150 int declaration, const char *file, int line) {
151 m->incomplete = true;
152 const cbm_test_model_mapping_issue_t *old = &m->mapping;
153 int by_file = strcmp(file ? file : "", old->file ? old->file : "");
154 bool earlier =
155 old->reason == CBM_TEST_MODEL_MAPPING_OK || by_file < 0 ||
156 (by_file == 0 &&
157 (line < old->line || (line == old->line &&
158 (declaration < old->declaration_index ||
159 (declaration == old->declaration_index && reason < old->reason)))));
160 if (!earlier)
161 return true;
162 const char *owned_file = file ? cbm_arena_strdup(&m->arena, file) : NULL;
163 if (file && !owned_file)
164 return false;
165 m->mapping = (cbm_test_model_mapping_issue_t){
166 .reason = reason, .declaration_index = declaration, .file = owned_file, .line = line};
167 return true;
168}
169
170static bool tm_copy_declaration(cbm_test_model_t *m, const cbm_test_declaration_t *src,
171 cbm_test_declaration_t *dst) {

Callers 4

tm_scan_mappingFunction · 0.85

Calls 1

cbm_arena_strdupFunction · 0.50

Tested by

no test coverage detected