[dconf] tests: always use expected_type from mock dbus



commit 73c91166df69e880111b1d86058836a22e5b05eb
Author: Ryan Lortie <desrt desrt ca>
Date:   Mon Nov 25 16:42:53 2013 -0500

    tests: always use expected_type from mock dbus
    
    Always call dconf_engine_call_handle_get_expected_type() from the mock
    dbus backend, even if the handle is NULL.  This matches the behaviour of
    the real D-Bus backends and would have caught the bug fixed in the last
    commit.

 tests/dconf-mock-dbus.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/tests/dconf-mock-dbus.c b/tests/dconf-mock-dbus.c
index 9296ef3..762e760 100644
--- a/tests/dconf-mock-dbus.c
+++ b/tests/dconf-mock-dbus.c
@@ -51,10 +51,19 @@ dconf_mock_dbus_async_reply (GVariant *reply,
   g_assert (!g_queue_is_empty (&dconf_mock_dbus_outstanding_call_handles));
   handle = g_queue_pop_head (&dconf_mock_dbus_outstanding_call_handles);
 
-  if (reply && handle)
-    g_assert (g_variant_is_of_type (reply, dconf_engine_call_handle_get_expected_type (handle)));
+  if (reply)
+    {
+      const GVariantType *expected_type;
+
+      expected_type = dconf_engine_call_handle_get_expected_type (handle);
+      g_assert (expected_type == NULL || g_variant_is_of_type (reply, expected_type));
+      g_variant_ref_sink (reply);
+    }
 
   dconf_engine_call_handle_reply (handle, reply, error);
+
+  if (reply)
+    g_variant_unref (reply);
 }
 
 void


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