| 316 | } |
| 317 | |
| 318 | static 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 | |
| 341 | static 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}, |
no test coverage detected