[Libosinfo] [libosinfo PATCH] test-os: Add test_resources_uniqueness()

Fabiano Fidêncio fidencio at redhat.com
Mon Nov 19 10:33:29 UTC 2018


On Fri, 2018-11-16 at 14:13 -0500, Cole Robinson wrote:
> On 11/13/2018 06:45 AM, Fabiano Fidêncio wrote:
> > This test enforces that we'll never have more than one resources
> > entry
> > for the very same architecture in an OS entry.
> > 
> > Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
> > ---
> > This patch's been written atop of 
> > https://www.redhat.com/archives/libosinfo/2018-November/msg00108.html
> 
> Reviewed-by: Cole Robinson <crobinso at redhat.com>

Patch has been merged with a few changes in the following part:

+    for (GList *l = list; l != NULL; l = l->next) {

Moved this declaration out of the loop as Andrea pointed out to some
old distros complaining about this C99 kind of declaration.

+        OsinfoResources *resources = l->data;
+        const gchar *arch =
osinfo_resources_get_architecture(resources);
+
+        if (g_list_find_custom(list, arch, (GCompareFunc) g_strcmp0)
== NULL) {
+            list = g_list_prepend(list, (gchar *)arch);

list here should be arches.

+            continue;
+        }

> 
> - Cole

Thanks for the review, Cole.




More information about the Libosinfo mailing list