summaryrefslogtreecommitdiffstats
path: root/test/test-service.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-04-07 01:07:13 +0000
committerHavoc Pennington <hp@redhat.com>2003-04-07 01:07:13 +0000
commit98572905e60cac7ea971aa0830e2a629bfff208d (patch)
tree2e3ebcfe8670fc403ac4262c96fa714b7e574f83 /test/test-service.c
parentdf008ef97deacd5bb00ac335e5d8671798fa09dd (diff)
2003-04-06 Havoc Pennington <hp@pobox.com>
* test/Makefile.am: remove a lot of stuff that isn't immediately useful, it's in CVS history if we want it. * test/test-service.c: use dbus-mainloop instead of that watch.[hc] crack
Diffstat (limited to 'test/test-service.c')
-rw-r--r--test/test-service.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/test-service.c b/test/test-service.c
index 49048f66..9e06b604 100644
--- a/test/test-service.c
+++ b/test/test-service.c
@@ -1,7 +1,7 @@
-#include <dbus/dbus.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "watch.h"
+
+#include "test-utils.h"
+
+static DBusLoop *loop;
static void
die (const char *message)
@@ -79,7 +79,12 @@ main (int argc,
return 1;
}
- setup_connection (connection);
+ loop = _dbus_loop_new ();
+ if (loop == NULL)
+ die ("No memory\n");
+
+ if (!test_connection_setup (loop, connection))
+ die ("No memory\n");
handler = dbus_message_handler_new (echo_handler, NULL, NULL);
if (handler == NULL)
@@ -98,11 +103,14 @@ main (int argc,
return 1;
}
- do_mainloop ();
+ _dbus_loop_run (loop);
dbus_connection_unref (connection);
dbus_message_handler_unref (handler);
+
+ _dbus_loop_unref (loop);
+ loop = NULL;
dbus_shutdown ();