diff options
author | Ryan Lortie <desrt@desrt.ca> | 2013-11-25 16:42:53 -0500 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2013-11-25 16:42:53 -0500 |
commit | 73c91166df69e880111b1d86058836a22e5b05eb (patch) | |
tree | 91a8b7c168b42ca4a5fa86630cc1a5bdf3b8015e /tests | |
parent | f75da1af04b2e96bd46bc16d1feb5e4ce991b571 (diff) | |
download | dconf-73c91166df69e880111b1d86058836a22e5b05eb.tar.gz |
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.
Diffstat (limited to 'tests')
-rw-r--r-- | 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 |