[glib] tests: expect critical on failure to remove source



commit f7beb90193236c1863fb62eaad607615f5695431
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Oct 23 11:10:00 2013 -0400

    tests: expect critical on failure to remove source
    
    We've added a g_critical() on failure to remove sources, so make sure we
    expect to see that (instead of failing the test due to the unexpected
    message).
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710724

 glib/tests/protocol.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/glib/tests/protocol.c b/glib/tests/protocol.c
index 9aa4879..e80b610 100644
--- a/glib/tests/protocol.c
+++ b/glib/tests/protocol.c
@@ -181,7 +181,9 @@ test_message (void)
 
   test_message_cb1 (channel, G_IO_IN, tlb);
 
+  g_test_expect_message ("GLib", G_LOG_LEVEL_CRITICAL, "Source ID*");
   g_assert (!g_source_remove (child_source));
+  g_test_assert_expected_messages ();
   g_assert (g_source_remove (io_source));
   g_io_channel_unref (channel);
 
@@ -292,7 +294,9 @@ test_error (void)
 
       test_message_cb1 (channel, G_IO_IN, tlb);
 
+      g_test_expect_message ("GLib", G_LOG_LEVEL_CRITICAL, "Source ID*");
       g_assert (!g_source_remove (child_source));
+      g_test_assert_expected_messages ();
       g_assert (g_source_remove (io_source));
       g_io_channel_unref (channel);
 


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