From b42e59d9391518b97758dc33936cf0008bbf8a76 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 3 May 2011 18:49:19 +0100 Subject: [PATCH 4/4] Add a regression test for removing an object from only one connection Bug: https://bugs.freedesktop.org/show_bug.cgi?id=32087 --- test/core/registrations.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/test/core/registrations.c b/test/core/registrations.c index 370c21d..c8b7e2d 100644 --- a/test/core/registrations.c +++ b/test/core/registrations.c @@ -249,14 +249,15 @@ test_twice (Fixture *f, dbus_message_unref (f->frobnicate2_message); f->frobnicate2_message = NULL; - /* try again, to catch any extra emissions */ + /* try again, to catch any extra emissions, but first unregister one of the + * object's locations */ + dbus_g_connection_unregister_g_object (f->bus, f->object); my_object_emit_frobnicate ((MyObject *) f->object, NULL); - while (f->frobnicate1_message == NULL || f->frobnicate2_message == NULL) + while (f->frobnicate2_message == NULL) g_main_context_iteration (NULL, TRUE); - dbus_message_unref (f->frobnicate1_message); - f->frobnicate1_message = NULL; + g_assert (f->frobnicate1_message == NULL); dbus_message_unref (f->frobnicate2_message); f->frobnicate2_message = NULL; } -- 1.7.4.4