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

Function gic_optional_errors

tests/test_gitignore_checked.c:356–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

354}
355
356static bool gic_optional_errors(cbm_ignore_checked_t *retained) {
357 cbm_ignore_checked_t *owner = NULL;
358 cbm_ignore_checked_limits_t limits = gic_limits();
359 if (cbm_ignore_checked_open(&limits, &owner, NULL) != CBM_IGNORE_CHECKED_OK || !owner) {
360 cbm_ignore_checked_free(owner);
361 return false;
362 }
363 cbm_ignore_checked_control_t control = gic_control();
364 cbm_ignore_checked_parse_result_t out = {0};
365 cbm_ignore_decision_t decision = CBM_IGNORE_UNAVAILABLE;
366 bool ok =
367 cbm_ignore_checked_parse(owner, "x", 1, &control, &out, NULL) == CBM_IGNORE_CHECKED_OK &&
368 out.program && out.pattern_count == 1;
369 if (ok)
370 ok = cbm_ignore_checked_match(owner, out.program, "x", 1, false, &control, &decision,
371 NULL) == CBM_IGNORE_CHECKED_OK &&
372 decision == CBM_IGNORE_IGNORED;
373 cbm_ignore_checked_free(owner);
374 owner = retained; /* Retained ownership remains in the caller's fixture. */
375 cbm_ignore_checked_error_t error;
376 return gic_status(cbm_ignore_checked_open(NULL, &owner, &error), CBM_IGNORE_CHECKED_INVALID,
377 &error) &&
378 !owner && ok;
379}
380
381TEST(gic_c_ownership_preflight_and_terminal) {
382 gic_fixture f;

Callers 1

Calls 7

gic_limitsFunction · 0.85
cbm_ignore_checked_openFunction · 0.85
cbm_ignore_checked_freeFunction · 0.85
gic_controlFunction · 0.85
cbm_ignore_checked_parseFunction · 0.85
cbm_ignore_checked_matchFunction · 0.85
gic_statusFunction · 0.85

Tested by

no test coverage detected