| 15595 | } |
| 15596 | |
| 15597 | static bool compare_write_identity_store(const char *path, const char *project, |
| 15598 | const char *generation, const char *index_mode, |
| 15599 | const char *source_qn, const char *source_label, |
| 15600 | const char *source_file, const char *target_qn, |
| 15601 | const char *target_label, const char *target_file, |
| 15602 | const char *edge_type) { |
| 15603 | cbm_store_t *store = cbm_store_open_path(path); |
| 15604 | if (!store || |
| 15605 | cbm_store_upsert_project(store, project, "/tmp/compare-identity-525") != CBM_STORE_OK) { |
| 15606 | cbm_store_close(store); |
| 15607 | return false; |
| 15608 | } |
| 15609 | |
| 15610 | bool ok = true; |
| 15611 | int64_t source_id = 0; |
| 15612 | int64_t target_id = 0; |
| 15613 | if (source_qn) { |
| 15614 | cbm_node_t source = { |
| 15615 | .project = project, |
| 15616 | .label = source_label, |
| 15617 | .name = source_qn, |
| 15618 | .qualified_name = source_qn, |
| 15619 | .file_path = source_file, |
| 15620 | .properties_json = "{}", |
| 15621 | }; |
| 15622 | source_id = cbm_store_upsert_node(store, &source); |
| 15623 | ok = source_id > 0; |
| 15624 | } |
| 15625 | if (ok && target_qn) { |
| 15626 | cbm_node_t target = { |
| 15627 | .project = project, |
| 15628 | .label = target_label, |
| 15629 | .name = target_qn, |
| 15630 | .qualified_name = target_qn, |
| 15631 | .file_path = target_file, |
| 15632 | .properties_json = "{}", |
| 15633 | }; |
| 15634 | target_id = cbm_store_upsert_node(store, &target); |
| 15635 | ok = target_id > 0; |
| 15636 | } |
| 15637 | if (ok && edge_type) { |
| 15638 | cbm_edge_t edge = { |
| 15639 | .project = project, |
| 15640 | .source_id = source_id, |
| 15641 | .target_id = target_id, |
| 15642 | .type = edge_type, |
| 15643 | .properties_json = "{}", |
| 15644 | }; |
| 15645 | ok = cbm_store_insert_edge(store, &edge) > 0; |
| 15646 | } |
| 15647 | ok = ok && compare_write_coverage_mode(store, project, generation, index_mode) && |
| 15648 | cbm_store_prepare_for_publish(store) == CBM_STORE_OK; |
| 15649 | cbm_store_close(store); |
| 15650 | return ok; |
| 15651 | } |
| 15652 | |
| 15653 | TEST(tool_compare_graphs_normalizes_legacy_path_separators_issue525) { |
| 15654 | compare_graphs_fixture_t fixture; |
no test coverage detected