summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2012-07-11 11:32:37 -0400
committerRyan Lortie <desrt@desrt.ca>2012-07-11 11:34:10 -0400
commitb9e39fc6812d06769bbeec491e6dc2b71d697599 (patch)
tree5794b6df0046d99d160ec12ada842471660db101 /gdbus
parent8b238d78d86068b1c5d002865d59ffb906f0432f (diff)
downloaddconf-b9e39fc6812d06769bbeec491e6dc2b71d697599.tar.gz
dbus test: add function to initialise for testing
We were hardcoding g_type_init() in the D-Bus testcase because the GDBus backend depended on that happening. That is not true for the libdbus-1 backend, so split it out into a separate function implemeneted by the backend.
Diffstat (limited to 'gdbus')
-rw-r--r--gdbus/dconf-gdbus-filter.c8
-rw-r--r--gdbus/dconf-gdbus-thread.c8
2 files changed, 16 insertions, 0 deletions
diff --git a/gdbus/dconf-gdbus-filter.c b/gdbus/dconf-gdbus-filter.c
index e074bce..e1447b1 100644
--- a/gdbus/dconf-gdbus-filter.c
+++ b/gdbus/dconf-gdbus-filter.c
@@ -301,3 +301,11 @@ dconf_engine_dbus_call_sync_func (GBusType bus_type,
bus_name, object_path, interface_name, method_name, parameters, reply_type,
G_DBUS_CALL_FLAGS_NONE, -1, NULL, error);
}
+
+#ifndef PIC
+void
+dconf_engine_dbus_init_for_testing (void)
+{
+ g_type_init ();
+}
+#endif
diff --git a/gdbus/dconf-gdbus-thread.c b/gdbus/dconf-gdbus-thread.c
index 47bc6cb..e3d69d8 100644
--- a/gdbus/dconf-gdbus-thread.c
+++ b/gdbus/dconf-gdbus-thread.c
@@ -347,3 +347,11 @@ dconf_engine_dbus_call_sync_func (GBusType bus_type,
return g_dbus_connection_call_sync (connection, bus_name, object_path, interface_name, method_name,
parameters, reply_type, G_DBUS_CALL_FLAGS_NONE, -1, NULL, error);
}
+
+#ifndef PIC
+void
+dconf_engine_dbus_init_for_testing (void)
+{
+ g_type_init ();
+}
+#endif