Re: [libosinfo PATCH] test-os: Add test_resources_inheritance()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Monday, 12 November 2018 15:07:24 CET Fabiano Fidêncio wrote:
> +static void
> +test_resources_inheritance_basic(void)
> +{
> +    OsinfoLoader *loader = osinfo_loader_new();
> +    OsinfoDb *db;
> +    OsinfoOs *os1, *os2;
> +    OsinfoResourcesList *os1_minimum_list, *os1_recommended_list;
> +    OsinfoResourcesList *os2_minimum_list, *os2_recommended_list;
> +    OsinfoResources *os1_minimum, *os1_recommended;
> +    OsinfoResources *os2_minimum, *os2_recommended;
> +    GError *error = NULL;
> +
> +    osinfo_loader_process_path(loader, SRCDIR "/tests/dbdata", &error);
> +    g_assert_no_error(error);
> +    db = g_object_ref(osinfo_loader_get_db(loader));
> +    g_object_unref(loader);
> +
> +    os1 = osinfo_db_get_os(db, "http://libosinfo.org/test/os/resources/inheritance/1";);
> +    g_assert(OSINFO_IS_OS(os1));

g_assert_true

> +    os1_minimum = OSINFO_RESOURCES(osinfo_list_get_nth(OSINFO_LIST(os1_minimum_list), 0));
> +    g_assert(OSINFO_IS_RESOURCES(os1_minimum));

g_assert_true

> +    os1_recommended = OSINFO_RESOURCES(osinfo_list_get_nth(OSINFO_LIST(os1_recommended_list), 0));
> +    g_assert(OSINFO_IS_RESOURCES(os1_recommended));

g_assert_true

> +    os2 = osinfo_db_get_os(db, "http://libosinfo.org/test/os/resources/inheritance/2";);
> +    g_assert(OSINFO_IS_OS(os2));

g_assert_true

> +    os2_minimum = OSINFO_RESOURCES(osinfo_list_get_nth(OSINFO_LIST(os2_minimum_list), 0));
> +    g_assert(OSINFO_IS_RESOURCES(os2_minimum));

g_assert_true

> +    os2_recommended = OSINFO_RESOURCES(osinfo_list_get_nth(OSINFO_LIST(os2_recommended_list), 0));
> +    g_assert(OSINFO_IS_RESOURCES(os2_recommended));

g_assert_true

-- 
Pino Toscano

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux