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

Function fixture_open

tests/test_runtime_settings.c:23–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21 char *cross;
22} settings_fixture_t;
23static bool fixture_open(settings_fixture_t *fixture) {
24 memset(fixture, 0, sizeof(*fixture));
25 snprintf(fixture->path, sizeof(fixture->path), "%s/cbm-settings-XXXXXX", cbm_tmpdir());
26 if (!cbm_mkdtemp(fixture->path))
27 return false;
28 fixture->cache = getenv("CBM_CACHE_DIR") ? strdup(getenv("CBM_CACHE_DIR")) : NULL;
29 fixture->workers = getenv("CBM_WORKERS") ? strdup(getenv("CBM_WORKERS")) : NULL;
30 fixture->cross =
31 getenv("CBM_DISABLE_LSP_CROSS") ? strdup(getenv("CBM_DISABLE_LSP_CROSS")) : NULL;
32 return cbm_setenv("CBM_CACHE_DIR", fixture->path, 1) == 0;
33}
34static void restore_env(const char *key, char *value) {
35 if (value)
36 cbm_setenv(key, value, 1);

Callers 2

fresh_fixture_openFunction · 0.85

Calls 3

cbm_tmpdirFunction · 0.85
cbm_mkdtempFunction · 0.85
cbm_setenvFunction · 0.85

Tested by

no test coverage detected