[glib] desktop-app-info test: use g_assert_strcmp()



commit 84e9829feea8f455357fb875e77d579b2437de4a
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Apr 9 19:23:27 2014 -0400

    desktop-app-info test: use g_assert_strcmp()
    
    Replace some assert(strcmp()) with g_assert_strcmp() so that we get
    better output in case of failures.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728040

 gio/tests/desktop-app-info.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/gio/tests/desktop-app-info.c b/gio/tests/desktop-app-info.c
index 3ad820f..6314b88 100644
--- a/gio/tests/desktop-app-info.c
+++ b/gio/tests/desktop-app-info.c
@@ -114,10 +114,10 @@ test_default (void)
   
   /* check that both are in the list, info2 before info1 */
   info = (GAppInfo *)list->data;
-  g_assert (g_strcmp0 (g_app_info_get_id (info), g_app_info_get_id (info2)) == 0);
+  g_assert_cmpstr (g_app_info_get_id (info), ==, g_app_info_get_id (info2));
 
   info = (GAppInfo *)list->next->data;
-  g_assert (g_strcmp0 (g_app_info_get_id (info), g_app_info_get_id (info1)) == 0);
+  g_assert_cmpstr (g_app_info_get_id (info), ==, g_app_info_get_id (info1));
 
   g_list_free_full (list, g_object_unref);
 
@@ -130,13 +130,13 @@ test_default (void)
   
   /* check that all are in the list, info2, info1, info3 */
   info = (GAppInfo *)list->data;
-  g_assert (g_strcmp0 (g_app_info_get_id (info), g_app_info_get_id (info2)) == 0);
+  g_assert_cmpstr (g_app_info_get_id (info), ==, g_app_info_get_id (info2));
 
   info = (GAppInfo *)list->next->data;
-  g_assert (g_strcmp0 (g_app_info_get_id (info), g_app_info_get_id (info1)) == 0);
+  g_assert_cmpstr (g_app_info_get_id (info), ==, g_app_info_get_id (info1));
 
   info = (GAppInfo *)list->next->next->data;
-  g_assert (g_strcmp0 (g_app_info_get_id (info), g_app_info_get_id (info3)) == 0);
+  g_assert_cmpstr (g_app_info_get_id (info), ==, g_app_info_get_id (info3));
 
   g_list_free_full (list, g_object_unref);
 
@@ -149,10 +149,10 @@ test_default (void)
   
   /* check that both are in the list, info2 before info3 */
   info = (GAppInfo *)list->data;
-  g_assert (g_strcmp0 (g_app_info_get_id (info), g_app_info_get_id (info2)) == 0);
+  g_assert_cmpstr (g_app_info_get_id (info), ==, g_app_info_get_id (info2));
 
   info = (GAppInfo *)list->next->data;
-  g_assert (g_strcmp0 (g_app_info_get_id (info), g_app_info_get_id (info3)) == 0);
+  g_assert_cmpstr (g_app_info_get_id (info), ==, g_app_info_get_id (info3));
 
   g_list_free_full (list, g_object_unref);
 


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