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

Function gic_parse_oom

tests/test_gitignore_checked.c:833–859  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

831}
832
833static bool gic_parse_oom(cbm_ignore_parse_fault_t fault, cbm_ignore_checked_usage_t *before,
834 cbm_ignore_checked_usage_t *usage) {
835 cbm_ignore_checked_t *owner = NULL;
836 cbm_ignore_checked_limits_t limits = gic_limits();
837 if (!gic_open(&owner, &limits))
838 return false;
839 const cbm_ignore_program_t *old_program = NULL;
840 if (!gic_parse(owner, "keep", 4, 1, &old_program) || !cbm_ignore_checked_usage(owner, before)) {
841 cbm_ignore_checked_free(owner);
842 return false;
843 }
844 cbm_ignore_checked_control_t control = gic_control();
845 cbm_ignore_checked_error_t error;
846 cbm_ignore_checked_parse_result_t out = {.program = old_program, .pattern_count = 77};
847 const char input[] = "one\ntwo\n";
848 cbm_ignore_checked_status_t status = cbm_ignore_checked_parse_fault_for_tests(
849 owner, input, sizeof(input) - 1, &control, fault, &out, &error);
850 bool ok = gic_status(status, CBM_IGNORE_CHECKED_OOM, &error) && !out.program &&
851 out.pattern_count == 0 && cbm_ignore_checked_usage(owner, usage) &&
852 usage->bytes_reserved == before->bytes_reserved + sizeof(input) - 1 &&
853 usage->patterns_reserved == before->patterns_reserved + 2 &&
854 usage->arena_requested_bytes > before->arena_requested_bytes &&
855 usage->terminal_status == CBM_IGNORE_CHECKED_OOM &&
856 gic_terminal(owner, old_program, CBM_IGNORE_CHECKED_OOM);
857 cbm_ignore_checked_free(owner);
858 return ok;
859}
860
861static bool gic_unreached_and_invalid_faults(cbm_ignore_checked_t *owner,
862 const cbm_ignore_program_t *program) {

Callers 1

Calls 9

gic_limitsFunction · 0.85
gic_openFunction · 0.85
gic_parseFunction · 0.85
cbm_ignore_checked_usageFunction · 0.85
cbm_ignore_checked_freeFunction · 0.85
gic_controlFunction · 0.85
gic_statusFunction · 0.85
gic_terminalFunction · 0.85

Tested by

no test coverage detected