Every stored node of the given label must carry exactly `expect` copies of * the key. Returns the number of nodes checked, or -1 on a store error. */
| 84 | /* Every stored node of the given label must carry exactly `expect` copies of |
| 85 | * the key. Returns the number of nodes checked, or -1 on a store error. */ |
| 86 | static int imp_check_label(cbm_store_t *s, const char *project, const char *label, int expect) { |
| 87 | cbm_node_t *nodes = NULL; |
| 88 | int count = 0; |
| 89 | if (cbm_store_find_nodes_by_label(s, project, label, &nodes, &count) != CBM_STORE_OK) { |
| 90 | return -1; |
| 91 | } |
| 92 | int bad = 0; |
| 93 | for (int i = 0; i < count; i++) { |
| 94 | if (imp_key_count(nodes[i].properties_json) != expect) { |
| 95 | bad++; |
| 96 | printf(" %s node '%s' props=%s\n", label, nodes[i].name ? nodes[i].name : "?", |
| 97 | nodes[i].properties_json ? nodes[i].properties_json : "(null)"); |
| 98 | } |
| 99 | } |
| 100 | cbm_store_free_nodes(nodes, count); |
| 101 | return bad == 0 ? count : -1; |
| 102 | } |
| 103 | |
| 104 | /* ── Store-level score readout (for the closure-delta tests) ──────────── */ |
| 105 |
no test coverage detected