[glib/fix-gobject-signals-test-windows] gobject/tests/signals.c: Fix tests on Windows



commit f350ca43b40af71e0cd3163edf4e0b7b311147a7
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Mon Jun 24 11:42:14 2019 +0800

    gobject/tests/signals.c: Fix tests on Windows
    
    On Windows the '%p' printf modifier does not prefix printed values with
    '0x', so do not expect the warning message to contain the '0x' prefix
    for the handler pointer value.

 gobject/tests/signals.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gobject/tests/signals.c b/gobject/tests/signals.c
index 63ce86ea1..3b38bad54 100644
--- a/gobject/tests/signals.c
+++ b/gobject/tests/signals.c
@@ -1266,8 +1266,16 @@ test_clear_signal_handler (void)
   if (g_test_undefined ())
     {
       handler = g_random_int_range (0x01, 0xFF);
+
+#ifdef G_OS_WIN32
+      /* on Windows the '%x' printf modifier does not prefix values with '0x' */
+      g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
+                             "*instance '* has no handler with id *'");
+#else
       g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
                              "*instance '0x* has no handler with id *'");
+#endif
+
       g_clear_signal_handler (&handler, test_obj);
       g_assert_cmpuint (handler, ==, 0);
       g_test_assert_expected_messages ();


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