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

Function chain_check

tests/test_cypher.c:5279–5304  ·  view source on GitHub ↗

Runs the chain query and checks every row against the test's own reading of * the chain, then checks that the engine still answers afterwards. */

Source from the content-addressed store, hash-verified

5277/* Runs the chain query and checks every row against the test's own reading of
5278 * the chain, then checks that the engine still answers afterwards. */
5279static int chain_check(void *arg) {
5280 const chain_case_t *c = arg;
5281 char *query = chain_query(c->head, c->op, c->join, c->tail);
5282 ASSERT_NOT_NULL(query);
5283
5284 cbm_store_t *s = setup_cypher_store();
5285 cbm_cypher_result_t r = {0};
5286 int rc = cbm_cypher_execute(s, query, "test", 0, &r);
5287 free(query);
5288 if (rc != 0) {
5289 printf(" query error: %s\n", r.error ? r.error : "(none)");
5290 }
5291 ASSERT_EQ(rc, 0);
5292 ASSERT_EQ(r.row_count, c->expected_rows);
5293 for (int i = 0; i < r.row_count; i++) {
5294 ASSERT_EQ(chain_names(r.rows[i][0]), c->admits_named);
5295 }
5296 cbm_cypher_result_free(&r);
5297
5298 rc = cbm_cypher_execute(s, "MATCH (f:Function) RETURN f.name", "test", 0, &r);
5299 ASSERT_EQ(rc, 0);
5300 ASSERT_EQ(r.row_count, CYPHER_FIXTURE_FUNCTION_COUNT);
5301 cbm_cypher_result_free(&r);
5302 cbm_store_close(s);
5303 return 0;
5304}
5305
5306/* 50,000 operands joined by OR over a single node pattern: the rows are the
5307 * Functions the chain names. The expected count comes from the fixture list

Callers

nothing calls this directly

Calls 6

chain_queryFunction · 0.85
setup_cypher_storeFunction · 0.85
cbm_cypher_executeFunction · 0.85
chain_namesFunction · 0.85
cbm_cypher_result_freeFunction · 0.85
cbm_store_closeFunction · 0.85

Tested by

no test coverage detected