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

Function idx773_double_index_check

tests/test_mcp.c:9340–9361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9338}
9339
9340static int idx773_double_index_check(const char *dir_a, const char *dir_b) {
9341 cbm_setenv("CBM_INDEX_SUPERVISOR", "0", 1);
9342 cbm_mcp_server_t *srv = cbm_mcp_server_new(NULL);
9343 if (!srv) {
9344 return IDX773_FIRST_FAILED;
9345 }
9346 char args[CBM_SZ_512];
9347 snprintf(args, sizeof(args), "{\"repo_path\":\"%s\",\"mode\":\"full\"}", dir_a);
9348 char *r1 = cbm_mcp_handle_tool(srv, "index_repository", args);
9349 bool ok1 = r1 && strstr(r1, "indexed") != NULL;
9350 free(r1);
9351 if (!ok1) {
9352 cbm_mcp_server_free(srv);
9353 return IDX773_FIRST_FAILED;
9354 }
9355 snprintf(args, sizeof(args), "{\"repo_path\":\"%s\",\"mode\":\"full\"}", dir_b);
9356 char *r2 = cbm_mcp_handle_tool(srv, "index_repository", args); /* SIGABRT here (RED) */
9357 bool ok2 = r2 && strstr(r2, "indexed") != NULL;
9358 free(r2);
9359 cbm_mcp_server_free(srv);
9360 return ok2 ? IDX773_OK : IDX773_SECOND_FAILED;
9361}
9362#endif /* !_WIN32 */
9363
9364/* #898: the SEQUENTIAL pipeline emitted malformed JSON for brokered

Callers 1

test_mcp.cFile · 0.85

Calls 4

cbm_setenvFunction · 0.85
cbm_mcp_server_newFunction · 0.85
cbm_mcp_handle_toolFunction · 0.85
cbm_mcp_server_freeFunction · 0.85

Tested by

no test coverage detected