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

Function idx773_double_index_check

tests/test_mcp.c:9433–9454  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9431}
9432
9433static int idx773_double_index_check(const char *dir_a, const char *dir_b) {
9434 cbm_setenv("CBM_INDEX_SUPERVISOR", "0", 1);
9435 cbm_mcp_server_t *srv = cbm_mcp_server_new(NULL);
9436 if (!srv) {
9437 return IDX773_FIRST_FAILED;
9438 }
9439 char args[CBM_SZ_512];
9440 snprintf(args, sizeof(args), "{\"repo_path\":\"%s\",\"mode\":\"full\"}", dir_a);
9441 char *r1 = cbm_mcp_handle_tool(srv, "index_repository", args);
9442 bool ok1 = r1 && strstr(r1, "indexed") != NULL;
9443 free(r1);
9444 if (!ok1) {
9445 cbm_mcp_server_free(srv);
9446 return IDX773_FIRST_FAILED;
9447 }
9448 snprintf(args, sizeof(args), "{\"repo_path\":\"%s\",\"mode\":\"full\"}", dir_b);
9449 char *r2 = cbm_mcp_handle_tool(srv, "index_repository", args); /* SIGABRT here (RED) */
9450 bool ok2 = r2 && strstr(r2, "indexed") != NULL;
9451 free(r2);
9452 cbm_mcp_server_free(srv);
9453 return ok2 ? IDX773_OK : IDX773_SECOND_FAILED;
9454}
9455#endif /* !_WIN32 */
9456
9457/* #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