[glib] Fix a failing testcase



commit b458d3da325c94308f442cebe897c6648938c119
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jul 14 08:27:30 2014 -0400

    Fix a failing testcase
    
    This fix is a bit of a blind guess, I couldn't really discern
    from recent commits whether this is an expected behavior change
    or not.

 gio/tests/desktop-app-info.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gio/tests/desktop-app-info.c b/gio/tests/desktop-app-info.c
index 22dd4b7..ccd6357 100644
--- a/gio/tests/desktop-app-info.c
+++ b/gio/tests/desktop-app-info.c
@@ -182,11 +182,16 @@ test_fallback (void)
   app = g_list_nth_data (recomm, 0);
   g_assert (g_app_info_equal (info1, app));
 
-  /* and that Test2 is the first fallback */
+  /* and that Test2 is among the fallback apps */
   fallback = g_app_info_get_fallback_for_type ("text/x-python");
   g_assert (fallback != NULL);
-  app = g_list_nth_data (fallback, 0);
-  g_assert (g_app_info_equal (info2, app));
+  for (l = fallback; l; l = l->next)
+    {
+      app = l->data;
+      if (g_app_info_equal (info2, app))
+        break;
+    }
+  g_assert_cmpstr (g_app_info_get_name (app), ==, "Test2");
 
   /* check that recomm + fallback = all applications */
   list = g_list_concat (g_list_copy (recomm), g_list_copy (fallback));


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