[Libosinfo] [libosinfo PATCH 4/5] test-os: Remove test_resources_uniqueness

Fabiano Fidêncio fidencio at redhat.com
Wed Mar 20 15:12:49 UTC 2019


This test is now part of osinfo-db.

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 tests/test-os.c | 71 -------------------------------------------------
 1 file changed, 71 deletions(-)

diff --git a/tests/test-os.c b/tests/test-os.c
index eecf820..cb7d972 100644
--- a/tests/test-os.c
+++ b/tests/test-os.c
@@ -270,76 +270,6 @@ static void test_resources_basic(void)
 }
 
 
-static void
-test_uniqueness(OsinfoOs *os,
-                OsinfoResourcesList *(*get_resources)(OsinfoOs *))
-{
-    OsinfoResourcesList *resourceslist;
-    GList *arches = NULL;
-    GList *list, *it;
-
-    resourceslist = get_resources(os);
-    list = osinfo_list_get_elements(OSINFO_LIST(resourceslist));
-
-    for (it = list; it != NULL; it = it->next) {
-        OsinfoResources *resources = it->data;
-        const gchar *arch = osinfo_resources_get_architecture(resources);
-
-        if (g_list_find_custom(arches, arch, (GCompareFunc) g_strcmp0) == NULL) {
-            arches = g_list_prepend(arches, (gchar *)arch);
-            continue;
-        }
-
-        g_test_message("\"%s\" has more than one resources entry for architecture \"%s\"",
-                       osinfo_product_get_short_id(OSINFO_PRODUCT(os)),
-                       arch);
-        g_test_fail();
-    }
-
-    g_list_free(arches);
-    g_list_free(list);
-    g_object_unref(resourceslist);
-}
-
-
-static void
-test_resources_uniqueness(void)
-{
-    OsinfoLoader *loader = osinfo_loader_new();
-    OsinfoDb *db = osinfo_loader_get_db(loader);
-    OsinfoOsList *oslist;
-    GList *oses;
-    GList *oses_it;
-    GError *error = NULL;
-
-    g_assert_true(OSINFO_IS_LOADER(loader));
-    g_assert_true(OSINFO_IS_DB(db));
-
-    osinfo_loader_process_default_path(loader, &error);
-    g_assert_no_error(error);
-
-    oslist = osinfo_db_get_os_list(db);
-    oses = osinfo_list_get_elements(OSINFO_LIST(oslist));
-
-    for (oses_it = oses; oses_it != NULL; oses_it = oses_it->next) {
-        OsinfoOs *os = oses_it->data;
-
-        g_test_message("Testing minimum resources uniqueness for \"%s\"",
-                       osinfo_product_get_short_id(OSINFO_PRODUCT(os)));
-        test_uniqueness(os, osinfo_os_get_minimum_resources);
-
-        g_test_message("Testing recommended resources uniqueness for \"%s\"",
-                       osinfo_product_get_short_id(OSINFO_PRODUCT(os)));
-        test_uniqueness(os, osinfo_os_get_recommended_resources);
-    }
-
-    g_object_unref(oslist);
-    g_list_free(oses);
-
-    g_object_unref(loader);
-}
-
-
 static GList *get_all_distros(OsinfoOsList *oslist)
 {
     GList *oses;
@@ -852,7 +782,6 @@ main(int argc, char *argv[])
     g_test_add_func("/os/devices/inheritance/removal",
                     test_devices_inheritance_removal);
     g_test_add_func("/os/resources/basic", test_resources_basic);
-    g_test_add_func("/os/resources/uniqueness", test_resources_uniqueness);
     g_test_add_func("/os/resources/inheritance", test_resources_inheritance);
     g_test_add_func("/os/find_install_script", test_find_install_script);
 
-- 
2.20.1




More information about the Libosinfo mailing list