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

Function build_diamond

tests/test_store_impact.c:125–148  ·  view source on GitHub ↗

seed <- {parent_a, parent_b} <- x. Which parent x is reached THROUGH must not * depend on the order nodes or edges were inserted in. */

Source from the content-addressed store, hash-verified

123/* seed <- {parent_a, parent_b} <- x. Which parent x is reached THROUGH must not
124 * depend on the order nodes or edges were inserted in. */
125static int64_t build_diamond(cbm_store_t *s, bool reversed, int64_t *seed, int64_t *parent_a,
126 int64_t *parent_b) {
127 int64_t x;
128 if (reversed) {
129 x = add_node(s, "Function", "x");
130 *parent_b = add_node(s, "Function", "parent_b");
131 *parent_a = add_node(s, "Function", "parent_a");
132 *seed = add_node(s, "Function", "seed");
133 add_edge(s, x, *parent_b, "CALLS");
134 add_edge(s, x, *parent_a, "CALLS");
135 add_edge(s, *parent_b, *seed, "CALLS");
136 add_edge(s, *parent_a, *seed, "CALLS");
137 } else {
138 *seed = add_node(s, "Function", "seed");
139 *parent_a = add_node(s, "Function", "parent_a");
140 *parent_b = add_node(s, "Function", "parent_b");
141 x = add_node(s, "Function", "x");
142 add_edge(s, *parent_a, *seed, "CALLS");
143 add_edge(s, *parent_b, *seed, "CALLS");
144 add_edge(s, x, *parent_a, "CALLS");
145 add_edge(s, x, *parent_b, "CALLS");
146 }
147 return x;
148}
149
150TEST(impact_walk_via_parent_is_the_smallest_qualified_name) {
151 for (int reversed = 0; reversed < 2; reversed++) {

Callers 1

Calls 2

add_nodeFunction · 0.85
add_edgeFunction · 0.85

Tested by

no test coverage detected