summaryrefslogtreecommitdiff
path: root/tests/client.c
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2012-07-16 10:17:16 -0400
committerRyan Lortie <desrt@desrt.ca>2012-07-16 10:17:16 -0400
commit01c439208a2a37271f462cd5531db3b7c3496c32 (patch)
treeaa5a2bb71a6f999a8e047680fc0dbc5da072578a /tests/client.c
parent294003a9aec3a47c9fc2aff97f92d84a1f4f143d (diff)
downloaddconf-01c439208a2a37271f462cd5531db3b7c3496c32.tar.gz
tests/: improve DBus mock interface
Put the queue of the outstanding async calls in the header and add an interface for defining handlers for sync calls.
Diffstat (limited to 'tests/client.c')
-rw-r--r--tests/client.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/client.c b/tests/client.c
index ad0115d..ea6e4d9 100644
--- a/tests/client.c
+++ b/tests/client.c
@@ -1,10 +1,10 @@
#define _BSD_SOURCE
#include "../client/dconf-client.h"
#include "../engine/dconf-engine.h"
+#include "dconf-mock.h"
#include <string.h>
#include <stdlib.h>
-extern GQueue outstanding_call_handles;
static GThread *main_thread;
static void
@@ -70,7 +70,7 @@ queue_up_100_writes (DConfClient *client)
check_and_free (dconf_client_read (client, "/test/value"), g_variant_new_int32 (i));
}
- g_assert_cmpint (g_queue_get_length (&outstanding_call_handles), ==, 2);
+ g_assert_cmpint (g_queue_get_length (&dconf_mock_dbus_outstanding_call_handles), ==, 2);
}
static void
@@ -80,7 +80,7 @@ fail_one_call (void)
GError *error;
error = g_error_new_literal (G_FILE_ERROR, G_FILE_ERROR_NOENT, "--expected error from testcase--");
- handle = g_queue_pop_head (&outstanding_call_handles);
+ handle = g_queue_pop_head (&dconf_mock_dbus_outstanding_call_handles);
dconf_engine_call_handle_reply (handle, NULL, error);
g_error_free (error);
}
@@ -133,7 +133,7 @@ test_fast (void)
* Each time, we should see a change notify.
*/
- for (i = 0; g_queue_get_length (&outstanding_call_handles) > 1; i++)
+ for (i = 0; g_queue_get_length (&dconf_mock_dbus_outstanding_call_handles) > 1; i++)
{
changed_was_called = FALSE;
fail_one_call ();