From c45cedc6bb5e5ebdac9cc538f15ea8969d53a2c3 Mon Sep 17 00:00:00 2001 From: Imran Zaman Date: Wed, 30 Oct 2013 13:05:29 +0200 Subject: [PATCH] removed unnecessary gtestbus code --- test/daemon/Makefile.am | 5 ----- test/daemon/daemon-test.c | 24 +++--------------------- test/lib/Makefile.am | 7 +------ test/lib/client-test.c | 24 +++--------------------- 4 files changed, 7 insertions(+), 53 deletions(-) diff --git a/test/daemon/Makefile.am b/test/daemon/Makefile.am index c21cade..0214e37 100644 --- a/test/daemon/Makefile.am +++ b/test/daemon/Makefile.am @@ -21,11 +21,6 @@ daemontest_CFLAGS = \ -U G_LOG_DOMAIN \ -DG_LOG_DOMAIN=\"gum-test-daemon\" -if USE_GTESTDBUS -daemontest_CFLAGS += \ - -DGUMD_TEST_DBUS_SERVICE_DIR=\""$(abs_top_builddir)/test/data/services"\" -endif - daemontest_LDADD = \ $(top_builddir)/src/daemon/gumd-gumd-daemon-user.o \ $(top_builddir)/src/daemon/gumd-gumd-daemon-group.o \ diff --git a/test/daemon/daemon-test.c b/test/daemon/daemon-test.c index 066af15..c96364a 100644 --- a/test/daemon/daemon-test.c +++ b/test/daemon/daemon-test.c @@ -62,11 +62,7 @@ gchar *exe_name = 0; -#if HAVE_GTESTDBUS -GTestDBus *dbus = NULL; -#else GPid daemon_pid = 0; -#endif static GMainLoop *main_loop = NULL; @@ -176,17 +172,8 @@ _setup_daemon (void) _setup_env (); -#if HAVE_GTESTDBUS - dbus = g_test_dbus_new (G_TEST_DBUS_NONE); - fail_unless (dbus != NULL, "could not create test dbus"); - - g_test_dbus_add_service_dir (dbus, GUMD_TEST_DBUS_SERVICE_DIR); - - g_test_dbus_up (dbus); - DBG ("Test dbus server address : %s\n", g_test_dbus_get_bus_address(dbus)); -#else GError *error = NULL; -# ifdef GUM_BUS_TYPE_P2P +#ifdef GUM_BUS_TYPE_P2P /* start daemon maually */ gchar *argv[2]; gchar *test_daemon_path = g_build_filename (g_getenv("UM_BIN_DIR"), @@ -201,7 +188,7 @@ _setup_daemon (void) fail_if (error != NULL, "Failed to span daemon : %s", error ? error->message : ""); sleep (5); /* 5 seconds */ -# else +#else /* session bus where no GTestBus support */ GIOChannel *channel = NULL; gchar *bus_address = NULL; @@ -268,20 +255,15 @@ _setup_daemon (void) g_error_free (error); } } -# endif +#endif DBG ("Daemon PID = %d\n", daemon_pid); -#endif } static void _teardown_daemon (void) { -#if HAVE_GTESTDBUS - g_test_dbus_down (dbus); -#else if (daemon_pid) kill (daemon_pid, SIGTERM); -#endif _unset_env (); } diff --git a/test/lib/Makefile.am b/test/lib/Makefile.am index 95de98a..566fde1 100644 --- a/test/lib/Makefile.am +++ b/test/lib/Makefile.am @@ -21,13 +21,8 @@ clienttest_CFLAGS = \ -U G_LOG_DOMAIN \ -DG_LOG_DOMAIN=\"gum-test-client\" -if USE_GTESTDBUS -clienttest_CFLAGS += \ - -DGUMD_TEST_DBUS_SERVICE_DIR=\""$(abs_top_builddir)/test/data/services"\" -endif - clienttest_LDADD = \ $(top_builddir)/src/common/libgum-common.la \ $(top_builddir)/src/lib/libgum.la \ $(GUMD_LIBS) \ - $(CHECK_LIBS) \ No newline at end of file + $(CHECK_LIBS) diff --git a/test/lib/client-test.c b/test/lib/client-test.c index 117a1af..5aecc16 100644 --- a/test/lib/client-test.c +++ b/test/lib/client-test.c @@ -61,11 +61,7 @@ gchar *exe_name = 0; -#if HAVE_GTESTDBUS -GTestDBus *dbus = NULL; -#else GPid daemon_pid = 0; -#endif static GMainLoop *main_loop = NULL; @@ -182,17 +178,8 @@ _setup_daemon (void) _setup_env (); -#if HAVE_GTESTDBUS - dbus = g_test_dbus_new (G_TEST_DBUS_NONE); - fail_unless (dbus != NULL, "could not create test dbus"); - - g_test_dbus_add_service_dir (dbus, GUMD_TEST_DBUS_SERVICE_DIR); - - g_test_dbus_up (dbus); - DBG ("Test dbus server address : %s\n", g_test_dbus_get_bus_address(dbus)); -#else GError *error = NULL; -# ifdef GUM_BUS_TYPE_P2P +#ifdef GUM_BUS_TYPE_P2P /* start daemon maually */ gchar *argv[2]; gchar *test_daemon_path = g_build_filename (g_getenv("UM_BIN_DIR"), @@ -207,7 +194,7 @@ _setup_daemon (void) fail_if (error != NULL, "Failed to span daemon : %s", error ? error->message : ""); sleep (5); /* 5 seconds */ -# else +#else /* session bus where no GTestBus support */ GIOChannel *channel = NULL; gchar *bus_address = NULL; @@ -274,20 +261,15 @@ _setup_daemon (void) g_error_free (error); } } -# endif +#endif DBG ("Daemon PID = %d\n", daemon_pid); -#endif } static void _teardown_daemon (void) { -#if HAVE_GTESTDBUS - g_test_dbus_down (dbus); -#else if (daemon_pid) kill (daemon_pid, SIGTERM); -#endif _unset_env (); } -- 2.7.4