mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
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
This commit is contained in:
parent
62f320e6bb
commit
75589956a4
@ -399,6 +399,19 @@ test_context_specific_emit (void)
|
|||||||
g_assert (!group.requested_state);
|
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
|
int
|
||||||
main (int argc, char **argv)
|
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-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/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", 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();
|
ret = g_test_run();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user