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

Function pf_hook_failure

tests/test_pipeline_frozen.c:691–718  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

689 return -1;
690}
691static bool pf_hook_failure(pf_fixture_t *f, pf_hook_kind_t kind) {
692 cbm_pipeline_frozen_t *owner = NULL;
693 if (!pf_source_write(f, "ordinary.c", pf_ordinary) ||
694 !pf_source_write(f, ".gitignore", "# baseline\n") ||
695 !pf_write(f->config, pf_physical_config))
696 return false;
697 char added[1024];
698 if (!pf_path(added, sizeof(added), f->source, ".cbmignore"))
699 return false;
700 if (!pf_absent(added) && cbm_unlink(added))
701 return false;
702 if (kind == PF_ADD_CONFIG && cbm_unlink(f->config))
703 return false;
704 pf_hook_t hook = {.fixture = f, .kind = kind};
705 bool ready = pf_create(f, pf_config0, NULL, &owner) == CBM_PIPELINE_FROZEN_OK && owner &&
706 cbm_pipeline_frozen_set_publish_hooks_for_tests(owner, pf_before_publish, NULL,
707 &hook) == CBM_PIPELINE_FROZEN_OK;
708 cbm_pipeline_frozen_status_t status =
709 ready ? cbm_pipeline_frozen_build(owner) : CBM_PIPELINE_FROZEN_INVALID;
710 bool ok = ready && hook.called && hook.changed && status == CBM_PIPELINE_FROZEN_INPUT_CHANGED &&
711 !cbm_pipeline_frozen_candidate_path(owner) && pf_absent(f->db) &&
712 pf_directory_only(f->destination, NULL) && pf_files_equal(f->control, f->saved);
713 cbm_pipeline_frozen_free(owner);
714 if (!ok)
715 printf(" final reconciliation variant %d status %d hook %d changed %d\n", (int)kind,
716 (int)status, hook.called, hook.changed);
717 return ok;
718}
719TEST(pipeline_frozen_final_reconciliation_and_explicit_override) {
720 ASSERT_EQ(pf_init_status, 0);
721 pf_fixture_t f = {0};

Callers 1

Calls 12

pf_source_writeFunction · 0.85
pf_writeFunction · 0.85
pf_pathFunction · 0.85
pf_absentFunction · 0.85
cbm_unlinkFunction · 0.85
pf_createFunction · 0.85
pf_directory_onlyFunction · 0.85
pf_files_equalFunction · 0.85
cbm_pipeline_frozen_freeFunction · 0.85

Tested by

no test coverage detected