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

Function gmt_search_same

tests/test_graph_mem.c:318–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316}
317
318static bool gmt_search_same(cbm_store_t *sql, cbm_store_t *mem, cbm_search_params_t p) {
319 cbm_search_output_t a = {0};
320 cbm_search_output_t b = {0};
321 int rca = cbm_store_search(sql, &p, &a);
322 int rcb = cbm_store_search(mem, &p, &b);
323 bool same = rca == rcb && a.total == b.total && a.count == b.count;
324 for (int i = 0; same && i < a.count; i++) {
325 same = gmt_node_eq(&a.results[i].node, &b.results[i].node) &&
326 a.results[i].in_degree == b.results[i].in_degree &&
327 a.results[i].out_degree == b.results[i].out_degree;
328 }
329 if (!same) {
330 (void)fprintf(stderr,
331 " graph_mem search divergence: min=%d max=%d limit=%d offset=%d "
332 "total=%d/%d count=%d/%d\n",
333 p.min_degree, p.max_degree, p.limit, p.offset, a.total, b.total, a.count,
334 b.count);
335 }
336 cbm_store_search_free(&a);
337 cbm_store_search_free(&b);
338 return same;
339}
340
341static int gmt_search_all_shapes(cbm_store_t *sql, cbm_store_t *mem) {
342 static const int ranges[][2] = {{1, -1}, {3, -1}, {10, -1}, {0, 0}, {-1, 0},

Callers 2

gmt_search_all_shapesFunction · 0.85
test_graph_mem.cFile · 0.85

Calls 3

cbm_store_searchFunction · 0.85
gmt_node_eqFunction · 0.85
cbm_store_search_freeFunction · 0.85

Tested by

no test coverage detected