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

Function agent_fixture

tests/test_agent_clients.c:60–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60static char *agent_fixture(const char *initial, char **dir_out) {
61 char *dir = th_mktempdir("cbm_agent_clients");
62 if (!dir) {
63 return NULL;
64 }
65 size_t length = strlen(dir) + strlen("/config.json") + 1U;
66 char *path = (char *)malloc(length);
67 if (!path) {
68 th_cleanup(dir);
69 return NULL;
70 }
71 snprintf(path, length, "%s/config.json", dir);
72 if (initial && th_write_file(path, initial) != 0) {
73 free(path);
74 th_cleanup(dir);
75 return NULL;
76 }
77 *dir_out = dir;
78 return path;
79}
80
81static char *agent_read(const char *path) {
82 FILE *fp = fopen(path, "rb");

Callers 1

Calls 3

th_mktempdirFunction · 0.85
th_cleanupFunction · 0.85
th_write_fileFunction · 0.85

Tested by

no test coverage detected