diff options
author | Allison Ryan Lortie <desrt@desrt.ca> | 2016-04-26 11:13:32 +0200 |
---|---|---|
committer | Allison Ryan Lortie <desrt@desrt.ca> | 2016-04-26 15:20:16 +0200 |
commit | 75589956a4ce3a78899ac9562dd43b431921108c (patch) | |
tree | 18532694d1ef2257de202a15ca89f28fbb6ca3d0 | |
parent | 62f320e6bb09b4e6454e6a49dc3a844b13b9cc34 (diff) | |
download | glib-75589956a4ce3a78899ac9562dd43b431921108c.tar.gz |
GContextSpecificGroup: add testcase
Add a test case for unreffing an object from a GContextSpecificGroup
immediately after firing a signal, before allowing the mainloop to run.
https://bugzilla.gnome.org/show_bug.cgi?id=762994
-rw-r--r-- | gio/tests/contexts.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gio/tests/contexts.c b/gio/tests/contexts.c index 4bed037f0..c6dc26111 100644 --- a/gio/tests/contexts.c +++ b/gio/tests/contexts.c @@ -399,6 +399,19 @@ test_context_specific_emit (void) g_assert (!group.requested_state); } +static void +test_context_specific_emit_and_unref (void) +{ + gpointer obj; + + obj = per_thread_thing_get (); + g_context_specific_group_emit (&group, g_signal_lookup ("changed", per_thread_thing_get_type ())); + g_object_unref (obj); + + while (g_main_context_iteration (NULL, 0)) + ; +} + int main (int argc, char **argv) { @@ -416,6 +429,7 @@ main (int argc, char **argv) g_test_add_func ("/gio/contexts/context-independence", test_context_independence); g_test_add_func ("/gio/contexts/context-specific/identity", test_context_specific_identity); g_test_add_func ("/gio/contexts/context-specific/emit", test_context_specific_emit); + g_test_add_func ("/gio/contexts/context-specific/emit-and-unref", test_context_specific_emit_and_unref); ret = g_test_run(); |