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

Function pf_env_start

tests/test_pipeline_frozen.c:133–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131 return ok;
132}
133static bool pf_env_start(pf_fixture_t *f) {
134 static const char *const names[] = {"CBM_WORKERS", "CBM_INDEX_SINGLE_THREAD",
135 "CBM_DISABLE_LSP_CROSS", "CBM_MEM_SPILL"};
136 f->previous_global = cbm_get_user_lang_config();
137 for (size_t i = 0; i < 4; ++i) {
138 f->env[i].name = names[i];
139 const char *value = getenv(names[i]);
140 f->env[i].present = value != NULL;
141 if (value) {
142 if (strlen(value) >= sizeof(f->env[i].value))
143 return false;
144 memcpy(f->env[i].value, value, strlen(value) + 1);
145 }
146 }
147 f->env_saved = true;
148 return cbm_setenv(names[0], "2", 1) == 0 && cbm_setenv(names[1], "1", 1) == 0 &&
149 cbm_unsetenv(names[2]) == 0 && cbm_unsetenv(names[3]) == 0;
150}
151static bool pf_close(pf_fixture_t *f) {
152 cbm_set_user_lang_config(f->previous_global);
153 bool ok = true;

Callers 1

pf_openFunction · 0.85

Calls 3

cbm_get_user_lang_configFunction · 0.85
cbm_setenvFunction · 0.85
cbm_unsetenvFunction · 0.85

Tested by

no test coverage detected