── 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. */
| 393 | * robustness bug. Returns 0 on PASS, 1 on FAIL. |
| 394 | */ |
| 395 | static int build_robustness(const char *lang_tag, const char *bad_src, |
| 396 | CBMLanguage lang, const char *file) { |
| 397 | const char *RED = tf_red(); |
| 398 | const char *RST = tf_reset(); |
| 399 | |
| 400 | CBMFileResult *r = cbm_extract_file(bad_src, (int)strlen(bad_src), |
| 401 | lang, "t", file, 0, NULL, NULL); |
| 402 | if (!r) { |
| 403 | printf(" %sFAIL%s [%s] robustness: extractor returned NULL on malformed input\n", |
| 404 | RED, RST, lang_tag); |
| 405 | return 1; |
| 406 | } |
| 407 | cbm_free_result(r); |
| 408 | return 0; |
| 409 | } |
| 410 | |
| 411 | /* ── Dockerfile ─────────────────────────────────────────────────────────────── |
| 412 | * Idiomatic two-stage Dockerfile: a builder stage (FROM ... AS ...) followed by |
no test coverage detected