[glib] mainloop: Improve test coverage



commit b87e7ca7291929d405deaec23368165638255504
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Apr 8 10:21:27 2012 -0400

    mainloop: Improve test coverage

 glib/tests/mainloop.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/glib/tests/mainloop.c b/glib/tests/mainloop.c
index 8391a76..09c02fe 100644
--- a/glib/tests/mainloop.c
+++ b/glib/tests/mainloop.c
@@ -97,6 +97,16 @@ test_maincontext_basic (void)
   g_assert_cmpstr (g_source_get_name (source), ==, "e");
   g_assert (g_source_get_context (source) == ctx);
   g_assert (g_source_remove_by_funcs_user_data (&funcs, data));
+
+  source = g_source_new (&funcs, sizeof (GSource));
+  g_source_set_funcs (source, &funcs);
+  g_source_set_callback (source, cb, data, NULL);
+  id = g_source_attach (source, ctx);
+  g_source_unref (source);
+  g_assert (g_source_remove_by_user_data (data));
+
+  g_idle_add (cb, data);
+  g_assert (g_idle_remove_by_data (data));
 }
 
 static void



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