| 18858 | } |
| 18859 | |
| 18860 | static bool compare_write_identity_store(const char *path, const char *project, |
| 18861 | const char *generation, const char *index_mode, |
| 18862 | const char *source_qn, const char *source_label, |
| 18863 | const char *source_file, const char *target_qn, |
| 18864 | const char *target_label, const char *target_file, |
| 18865 | const char *edge_type) { |
| 18866 | cbm_store_t *store = cbm_store_open_path(path); |
| 18867 | if (!store || |
| 18868 | cbm_store_upsert_project(store, project, "/tmp/compare-identity-525") != CBM_STORE_OK) { |
| 18869 | cbm_store_close(store); |
| 18870 | return false; |
| 18871 | } |
| 18872 | |
| 18873 | bool ok = true; |
| 18874 | int64_t source_id = 0; |
| 18875 | int64_t target_id = 0; |
| 18876 | if (source_qn) { |
| 18877 | cbm_node_t source = { |
| 18878 | .project = project, |
| 18879 | .label = source_label, |
| 18880 | .name = source_qn, |
| 18881 | .qualified_name = source_qn, |
| 18882 | .file_path = source_file, |
| 18883 | .properties_json = "{}", |
| 18884 | }; |
| 18885 | source_id = cbm_store_upsert_node(store, &source); |
| 18886 | ok = source_id > 0; |
| 18887 | } |
| 18888 | if (ok && target_qn) { |
| 18889 | cbm_node_t target = { |
| 18890 | .project = project, |
| 18891 | .label = target_label, |
| 18892 | .name = target_qn, |
| 18893 | .qualified_name = target_qn, |
| 18894 | .file_path = target_file, |
| 18895 | .properties_json = "{}", |
| 18896 | }; |
| 18897 | target_id = cbm_store_upsert_node(store, &target); |
| 18898 | ok = target_id > 0; |
| 18899 | } |
| 18900 | if (ok && edge_type) { |
| 18901 | cbm_edge_t edge = { |
| 18902 | .project = project, |
| 18903 | .source_id = source_id, |
| 18904 | .target_id = target_id, |
| 18905 | .type = edge_type, |
| 18906 | .properties_json = "{}", |
| 18907 | }; |
| 18908 | ok = cbm_store_insert_edge(store, &edge) > 0; |
| 18909 | } |
| 18910 | ok = ok && compare_write_coverage_mode(store, project, generation, index_mode) && |
| 18911 | cbm_store_prepare_for_publish(store) == CBM_STORE_OK; |
| 18912 | cbm_store_close(store); |
| 18913 | return ok; |
| 18914 | } |
| 18915 | |
| 18916 | TEST(tool_compare_graphs_normalizes_legacy_path_separators_issue525) { |
| 18917 | compare_graphs_fixture_t fixture; |
no test coverage detected