diff --git a/modulemd/v2/modulemd-module-stream-v1.c b/modulemd/v2/modulemd-module-stream-v1.c index 4c26f33be..34df203be 100644 --- a/modulemd/v2/modulemd-module-stream-v1.c +++ b/modulemd/v2/modulemd-module-stream-v1.c @@ -1075,7 +1075,7 @@ modulemd_module_stream_v1_equals (ModulemdModuleStream *self_1, if (v1_self_1->xmd == NULL || v1_self_2->xmd == NULL) return FALSE; - if (g_variant_equal (v1_self_1->xmd, v1_self_2->xmd) != 0) + if (!g_variant_equal (v1_self_1->xmd, v1_self_2->xmd)) return FALSE; return TRUE; diff --git a/modulemd/v2/modulemd-module-stream-v2.c b/modulemd/v2/modulemd-module-stream-v2.c index 24b72a860..ca0beae47 100644 --- a/modulemd/v2/modulemd-module-stream-v2.c +++ b/modulemd/v2/modulemd-module-stream-v2.c @@ -231,7 +231,7 @@ modulemd_module_stream_v2_equals (ModulemdModuleStream *self_1, if (v2_self_1->xmd == NULL || v2_self_2->xmd == NULL) return FALSE; - if (g_variant_equal (v2_self_1->xmd, v2_self_2->xmd) != 0) + if (!g_variant_equal (v2_self_1->xmd, v2_self_2->xmd)) return FALSE; return TRUE; diff --git a/modulemd/v2/modulemd-module.c b/modulemd/v2/modulemd-module.c index 699e8808a..e6ac372fc 100644 --- a/modulemd/v2/modulemd-module.c +++ b/modulemd/v2/modulemd-module.c @@ -329,10 +329,17 @@ modulemd_module_add_stream (ModulemdModule *self, * favor of the new one. */ - /* TODO: Do a full equality check on the two ModuleStreams once - * https://github.com/fedora-modularity/libmodulemd/issues/186 is - * fixed. - */ + if (!modulemd_module_stream_equals (old, stream)) + { + /* The two streams have matching NSVCA, but differ in content */ + g_set_error (error, + MODULEMD_ERROR, + MODULEMD_ERROR_VALIDATE, + "Encountered two streams with matching NSVCA %s but " + "differing content", + modulemd_module_stream_get_NSVCA_as_string (stream)); + return MD_MODULESTREAM_VERSION_ERROR; + } /* First, drop the existing stream */ g_ptr_array_remove (self->streams, old); diff --git a/modulemd/v2/tests/test-modulemd-merger.c b/modulemd/v2/tests/test-modulemd-merger.c index bac730670..e46b4d844 100644 --- a/modulemd/v2/tests/test-modulemd-merger.c +++ b/modulemd/v2/tests/test-modulemd-merger.c @@ -90,8 +90,8 @@ merger_test_deduplicate (CommonMmdTestFixture *fixture, /* Resolve the merge, which should deduplicate all entries */ merged_index = modulemd_module_index_merger_resolve (merger, &error); + g_assert_no_error (error); g_assert_nonnull (merged_index); - g_assert_null (error); deduplicated = modulemd_module_index_dump_to_string (merged_index, &error); g_assert_nonnull (deduplicated);