From d754e017eaf867e8d1d1cdf9a058dd323c898c9d Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 28 Feb 2018 11:50:39 +0000 Subject: [PATCH] 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 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;