summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-04-03 05:22:49 +0000
committerHavoc Pennington <hp@redhat.com>2003-04-03 05:22:49 +0000
commiteeb88949d8d2ca84d9cbe54c07e73b9907d3163e (patch)
tree9520b0d32fd0c105f41619f8d247a298f93caf9c /test
parent5364beac6cbfa8793fd34c7a634528a2112787f8 (diff)
2003-04-03 Havoc Pennington <hp@pobox.com>
* bus/config-parser.c (bus_config_parser_unref): free list of mechanisms, bug discovered by test suite enhancements (putting system.conf and session.conf into suite) * test/Makefile.am, test/test-service.c: add placeholder for a test service that we'll activate as part of test suite. Doesn't do anything yet. * dbus/dbus-sysdeps.c (_dbus_setenv): support unsetenv by setting NULL value, and use system malloc not dbus_malloc() when we have unavoidable memleakage. * dbus/dbus-bus.c (dbus_bus_get): fix bug where bus type of 0 didn't work, and support DBUS_BUS_ACTIVATION. * bus/activation.c (child_setup): pass our well-known bus type to the child * bus/config-parser.c: support <type> to specify well-known type * doc/dbus-specification.sgml: document the env variables to locate well-known buses and find service activator
Diffstat (limited to 'test')
-rw-r--r--test/Makefile.am8
-rw-r--r--test/test-service.c30
2 files changed, 37 insertions, 1 deletions
diff --git a/test/Makefile.am b/test/Makefile.am
index 3ca62d65..46a66dbc 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -2,7 +2,7 @@
INCLUDES=-I$(top_srcdir) $(DBUS_TEST_CFLAGS)
if DBUS_BUILD_TESTS
-TEST_BINARIES=echo-client echo-server unbase64 break-loader spawn-test
+TEST_BINARIES=test-service echo-client echo-server unbase64 break-loader spawn-test
else
TEST_BINARIES=
endif
@@ -19,6 +19,11 @@ echo_server_SOURCES= \
watch.c \
watch.h
+test_service_SOURCES= \
+ test-service.c \
+ watch.c \
+ watch.h
+
unbase64_SOURCES= \
unbase64.c
@@ -39,6 +44,7 @@ TEST_LIBS=$(DBUS_TEST_LIBS) $(top_builddir)/dbus/libdbus-convenience.la
echo_client_LDADD=$(TEST_LIBS)
echo_server_LDADD=$(TEST_LIBS)
+test_service_LDADD=$(TEST_LIBS)
unbase64_LDADD=$(TEST_LIBS)
break_loader_LDADD= $(TEST_LIBS)
#bus_test_LDADD=$(TEST_LIBS) $(top_builddir)/bus/libdbus-daemon.la
diff --git a/test/test-service.c b/test/test-service.c
new file mode 100644
index 00000000..a4dff0b3
--- /dev/null
+++ b/test/test-service.c
@@ -0,0 +1,30 @@
+#include <dbus/dbus.h>
+#include <stdio.h>
+#include "watch.h"
+
+int
+main (int argc,
+ char **argv)
+{
+ DBusConnection *connection;
+ DBusError error;
+ DBusMessage *message;
+
+ dbus_error_init (&error);
+ connection = dbus_bus_get (DBUS_BUS_ACTIVATION, &error);
+ if (connection == NULL)
+ {
+ fprintf (stderr, "Failed to open connection to activating message bus: %s\n",
+ error.message);
+ dbus_error_free (&error);
+ return 1;
+ }
+
+ setup_connection (connection);
+
+ do_mainloop ();
+
+ dbus_connection_unref (connection);
+
+ return 0;
+}