MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / ExecutionPlan_OpsEqual

Function ExecutionPlan_OpsEqual

tests/unit/test_execution_plan_clone.c:57–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55}
56
57static void ExecutionPlan_OpsEqual
58(
59 const ExecutionPlan *plan_a,
60 const ExecutionPlan *plan_b,
61 const OpBase *op_a,
62 const OpBase *op_b
63) {
64 // If both ops are NULL, there is nothing to compare.
65 if(op_a == NULL && op_b == NULL) return;
66 // In case one of the ops is NULL.
67 TEST_ASSERT(op_a && op_b);
68 // In case both ops are not in their respective segment, there is nothing to compare.
69 if(op_a->plan != plan_a && op_b->plan != plan_b) return;
70 TEST_ASSERT(op_a->plan == plan_a && op_b->plan == plan_b);
71 TEST_ASSERT(op_a->type == op_b->type);
72 TEST_ASSERT(op_a->childCount == op_b->childCount);
73 for(uint i = 0; i < op_a->childCount; i++) {
74 ExecutionPlan_OpsEqual(plan_a, plan_b, op_a->children[i], op_b->children[i]);
75 }
76}
77
78static void validate_query_plans_clone
79(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected