| 147 | } |
| 148 | |
| 149 | static 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 | |
| 170 | static bool tm_copy_declaration(cbm_test_model_t *m, const cbm_test_declaration_t *src, |
| 171 | cbm_test_declaration_t *dst) { |
no test coverage detected