── Robustness probe ─────────────────────────────────────────────────────── * * Feed a deliberately malformed/truncated fixture through the single-file * extractor. The ONLY invariant here is liveness: the call must RETURN (a hard * crash would not). NULL or a result are both acceptable; if a result comes * back its ranges must still be well-formed (no negative/inverted lines). * Returns 0 o
| 211 | * Returns 0 on PASS (returned + ranges sane), 1 on FAIL. |
| 212 | */ |
| 213 | static int robustness_probe(const char *lang_tag, const char *bad_src, |
| 214 | CBMLanguage lang, const char *file) { |
| 215 | const char *RED = tf_red(); |
| 216 | const char *RST = tf_reset(); |
| 217 | CBMFileResult *r = inv_rx(bad_src, lang, file); |
| 218 | if (!r) { |
| 219 | /* Returned cleanly with NULL -- acceptable, no crash. */ |
| 220 | return 0; |
| 221 | } |
| 222 | int bad_ranges = inv_count_bad_ranges(r); |
| 223 | cbm_free_result(r); |
| 224 | if (bad_ranges != 0) { |
| 225 | printf(" %sFAIL%s [%s] robustness: malformed input produced %d def(s) " |
| 226 | "with invalid range\n", |
| 227 | RED, RST, lang_tag, bad_ranges); |
| 228 | return 1; |
| 229 | } |
| 230 | return 0; |
| 231 | } |
| 232 | |
| 233 | /* ── GLSL ──────────────────────────────────────────────────────────────────── |
| 234 | * Shader; reuses C node types (c_func_types / c_call_types). Idiomatic: a helper |
no test coverage detected