| 76 | } |
| 77 | |
| 78 | static void validate_query_plans_clone |
| 79 | ( |
| 80 | const char **queries |
| 81 | ) { |
| 82 | uint query_count = array_len(queries); |
| 83 | for(uint i = 0; i < query_count; i++) { |
| 84 | AST *ast = NULL; |
| 85 | ExecutionPlan *plan = NULL; |
| 86 | const char *query = queries[i]; |
| 87 | |
| 88 | build_ast_and_plan(query, &ast, &plan); |
| 89 | TEST_ASSERT(ast != NULL); |
| 90 | TEST_ASSERT(plan != NULL); |
| 91 | |
| 92 | ExecutionPlan *clone = ExecutionPlan_Clone(plan); |
| 93 | ExecutionPlan_OpsEqual(plan, clone, plan->root, clone->root); |
| 94 | |
| 95 | AST_Free(ast); |
| 96 | ExecutionPlan_Free(clone); |
| 97 | ExecutionPlan_Free(plan); |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | void setup() { |
| 102 | // skip if memory sanitizer is enabled |
no test coverage detected