tests: expect critical on failure to remove source
authorRyan Lortie <desrt@desrt.ca>
Wed, 23 Oct 2013 15:10:00 +0000 (11:10 -0400)
committerRyan Lortie <desrt@desrt.ca>
Wed, 23 Oct 2013 16:00:44 +0000 (12:00 -0400)
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

index 9aa4879..e80b610 100644 (file)
@@ -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);