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

Function sh_robustness

tests/repro/repro_grammar_shells.c:381–395  ·  view source on GitHub ↗

── 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. A NULL return * means the extractor crashed or aborted on bad input -- a RED robustness bug. * Returns 0 on PASS. */

Source from the content-addressed store, hash-verified

379 * Returns 0 on PASS.
380 */
381static int sh_robustness(const char *lang_tag, const char *bad_src, CBMLanguage lang,
382 const char *file) {
383 const char *RED = tf_red();
384 const char *RST = tf_reset();
385
386 CBMFileResult *r =
387 cbm_extract_file(bad_src, (int)strlen(bad_src), lang, "t", file, 0, NULL, NULL);
388 if (!r) {
389 printf(" %sFAIL%s [%s] robustness: extractor returned NULL on malformed input\n",
390 RED, RST, lang_tag);
391 return 1;
392 }
393 cbm_free_result(r);
394 return 0;
395}
396
397/* ── BASH ─────────────────────────────────────────────────────────────────────
398 * Idiomatic: two function definitions, the callee invoked strictly inside the

Callers 1

Calls 4

tf_redFunction · 0.85
tf_resetFunction · 0.85
cbm_extract_fileFunction · 0.85
cbm_free_resultFunction · 0.85

Tested by

no test coverage detected