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

Function pf_resource_limit

tests/test_pipeline_frozen.c:987–1006  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

985 return ok;
986}
987static bool pf_resource_limit(pf_fixture_t *f) {
988 cbm_git_context_t git = pf_git(f);
989 cbm_pipeline_frozen_inputs_t in = pf_inputs(f, "{}", &git, NULL);
990 in.resource_policy.max_files.enabled = true;
991 in.resource_policy.max_files.value = 1;
992 cbm_pipeline_frozen_t *owner = NULL;
993 bool ready = cbm_pipeline_frozen_create(&in, &owner) == CBM_PIPELINE_FROZEN_OK && owner;
994 cbm_pipeline_frozen_status_t status =
995 ready ? cbm_pipeline_frozen_build(owner) : CBM_PIPELINE_FROZEN_INVALID;
996 const cbm_pipeline_t *diag = cbm_pipeline_frozen_diagnostics(owner);
997 cbm_index_resource_violation_t violation = {0};
998 if (diag)
999 cbm_pipeline_get_resource_violation(diag, &violation);
1000 bool ok = ready && status == CBM_PIPELINE_FROZEN_LIMIT && diag &&
1001 violation.resource == CBM_INDEX_RESOURCE_FILES && violation.limit == 1 &&
1002 violation.observed > 1 && !cbm_pipeline_frozen_candidate_path(owner) &&
1003 pf_absent(f->db);
1004 cbm_pipeline_frozen_free(owner);
1005 return ok && pf_directory_only(f->destination, NULL);
1006}
1007TEST(pipeline_frozen_actual_serial_dispatch_and_history_skip) {
1008 ASSERT_EQ(pf_init_status, 0);
1009 pf_fixture_t f = {0};

Callers 1

Calls 10

pf_gitFunction · 0.85
pf_inputsFunction · 0.85
pf_absentFunction · 0.85
cbm_pipeline_frozen_freeFunction · 0.85
pf_directory_onlyFunction · 0.85

Tested by

no test coverage detected