── Robustness helper: assert call RETURNS on malformed input ─────────────── * * A truncated version of the fixture is passed through cbm_extract_file. * has_error may be set (1) but the call must return non-NULL. If it returns NULL * the extractor crashed or aborted on bad input -- that is a RED robustness bug. * Returns 0 on PASS, 1 on FAIL. */
| 388 | * Returns 0 on PASS, 1 on FAIL. |
| 389 | */ |
| 390 | static int config_robustness(const char *lang_tag, const char *bad_src, |
| 391 | CBMLanguage lang, const char *file) { |
| 392 | const char *RED = tf_red(); |
| 393 | const char *RST = tf_reset(); |
| 394 | |
| 395 | CBMFileResult *r = cbm_extract_file(bad_src, (int)strlen(bad_src), |
| 396 | lang, "t", file, 0, NULL, NULL); |
| 397 | if (!r) { |
| 398 | printf(" %sFAIL%s [%s] robustness: extractor returned NULL on malformed input\n", |
| 399 | RED, RST, lang_tag); |
| 400 | return 1; |
| 401 | } |
| 402 | cbm_free_result(r); |
| 403 | return 0; |
| 404 | } |
| 405 | |
| 406 | /* ── JSON ───────────────────────────────────────────────────────────────────── |
| 407 | * Idiomatic JSON object with nested structure. The spec has json_module_types = |
no test coverage detected