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

Function robustness_probe

tests/repro/repro_grammar_scientific.c:213–231  ·  view source on GitHub ↗

── 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

Source from the content-addressed store, hash-verified

211 * Returns 0 on PASS (returned + ranges sane), 1 on FAIL.
212 */
213static 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

Callers 1

Calls 5

tf_redFunction · 0.85
tf_resetFunction · 0.85
inv_rxFunction · 0.85
inv_count_bad_rangesFunction · 0.85
cbm_free_resultFunction · 0.85

Tested by

no test coverage detected