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

Function idx773_double_index_check

tests/test_mcp.c:9581–9602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9579}
9580
9581static int idx773_double_index_check(const char *dir_a, const char *dir_b) {
9582 cbm_setenv("CBM_INDEX_SUPERVISOR", "0", 1);
9583 cbm_mcp_server_t *srv = cbm_mcp_server_new(NULL);
9584 if (!srv) {
9585 return IDX773_FIRST_FAILED;
9586 }
9587 char args[CBM_SZ_512];
9588 snprintf(args, sizeof(args), "{\"repo_path\":\"%s\",\"mode\":\"full\"}", dir_a);
9589 char *r1 = cbm_mcp_handle_tool(srv, "index_repository", args);
9590 bool ok1 = r1 && strstr(r1, "indexed") != NULL;
9591 free(r1);
9592 if (!ok1) {
9593 cbm_mcp_server_free(srv);
9594 return IDX773_FIRST_FAILED;
9595 }
9596 snprintf(args, sizeof(args), "{\"repo_path\":\"%s\",\"mode\":\"full\"}", dir_b);
9597 char *r2 = cbm_mcp_handle_tool(srv, "index_repository", args); /* SIGABRT here (RED) */
9598 bool ok2 = r2 && strstr(r2, "indexed") != NULL;
9599 free(r2);
9600 cbm_mcp_server_free(srv);
9601 return ok2 ? IDX773_OK : IDX773_SECOND_FAILED;
9602}
9603#endif /* !_WIN32 */
9604
9605/* #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