[glib] tests: Use modern test assertions in GApplication test



commit b046c5b772d122da5ccb9bce028a9c20994f17a5
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Feb 28 11:50:39 2018 +0000

    tests: Use modern test assertions in GApplication test
    
    This will make the assertion failure messages a little more useful, and
    prevent the assertions being compiled out with G_DISABLE_ASSERT.
    Introduces no functional changes.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=793400

 gio/tests/gapplication.c | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)
---
diff --git a/gio/tests/gapplication.c b/gio/tests/gapplication.c
index 55d0c0d2a..3e964c004 100644
--- a/gio/tests/gapplication.c
+++ b/gio/tests/gapplication.c
@@ -425,33 +425,33 @@ appid (void)
 {
   gchar *id;
 
-  g_assert (!g_application_id_is_valid (""));
-  g_assert (!g_application_id_is_valid ("."));
-  g_assert (!g_application_id_is_valid ("a"));
-  g_assert (!g_application_id_is_valid ("abc"));
-  g_assert (!g_application_id_is_valid (".abc"));
-  g_assert (!g_application_id_is_valid ("abc."));
-  g_assert (!g_application_id_is_valid ("a..b"));
-  g_assert (!g_application_id_is_valid ("a/b"));
-  g_assert (!g_application_id_is_valid ("a\nb"));
-  g_assert (!g_application_id_is_valid ("a\nb"));
-  g_assert (!g_application_id_is_valid ("_a.b"));
-  g_assert (!g_application_id_is_valid ("-a.b"));
-  g_assert (!g_application_id_is_valid ("emoji_picker"));
-  g_assert (!g_application_id_is_valid ("emoji-picker"));
-  g_assert (!g_application_id_is_valid ("emojipicker"));
+  g_assert_false (g_application_id_is_valid (""));
+  g_assert_false (g_application_id_is_valid ("."));
+  g_assert_false (g_application_id_is_valid ("a"));
+  g_assert_false (g_application_id_is_valid ("abc"));
+  g_assert_false (g_application_id_is_valid (".abc"));
+  g_assert_false (g_application_id_is_valid ("abc."));
+  g_assert_false (g_application_id_is_valid ("a..b"));
+  g_assert_false (g_application_id_is_valid ("a/b"));
+  g_assert_false (g_application_id_is_valid ("a\nb"));
+  g_assert_false (g_application_id_is_valid ("a\nb"));
+  g_assert_false (g_application_id_is_valid ("_a.b"));
+  g_assert_false (g_application_id_is_valid ("-a.b"));
+  g_assert_false (g_application_id_is_valid ("emoji_picker"));
+  g_assert_false (g_application_id_is_valid ("emoji-picker"));
+  g_assert_false (g_application_id_is_valid ("emojipicker"));
   id = g_new0 (gchar, 261);
   memset (id, 'a', 260);
   id[1] = '.';
   id[260] = 0;
-  g_assert (!g_application_id_is_valid (id));
+  g_assert_false (g_application_id_is_valid (id));
   g_free (id);
 
-  g_assert (g_application_id_is_valid ("a.b"));
-  g_assert (g_application_id_is_valid ("A.B"));
-  g_assert (g_application_id_is_valid ("A-.B"));
-  g_assert (g_application_id_is_valid ("a_b.c-d"));
-  g_assert (g_application_id_is_valid ("org.gnome.SessionManager"));
+  g_assert_true (g_application_id_is_valid ("a.b"));
+  g_assert_true (g_application_id_is_valid ("A.B"));
+  g_assert_true (g_application_id_is_valid ("A-.B"));
+  g_assert_true (g_application_id_is_valid ("a_b.c-d"));
+  g_assert_true (g_application_id_is_valid ("org.gnome.SessionManager"));
 }
 
 static gboolean nodbus_activated;


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