summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2018-09-03 14:13:45 -0700
committerSimon McVittie <smcv@collabora.com>2018-12-17 14:12:59 +0000
commit9c4f9206c494010dffdb4ede26087415f603016b (patch)
treec2f679beb6013a124450ccc668781d6c857cf79d
parent4587be14428c4970b2f8fa7065764a52de826eb1 (diff)
downloaddbus-9c4f9206c494010dffdb4ede26087415f603016b.tar.gz
bus tests: Skip unsupported fd-passing test internally, not from main()
This results in one less special case in test-main, which will be significant when we want to make the tests more data-driven. Signed-off-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--bus/dispatch.c7
-rw-r--r--bus/test-main.c5
-rw-r--r--bus/test.h3
3 files changed, 4 insertions, 11 deletions
diff --git a/bus/dispatch.c b/bus/dispatch.c
index b17d0ad2..e91a8255 100644
--- a/bus/dispatch.c
+++ b/bus/dispatch.c
@@ -5098,11 +5098,10 @@ bus_dispatch_sha1_test (const char *test_data_dir_cstr)
return TRUE;
}
-#ifdef HAVE_UNIX_FD_PASSING
-
dbus_bool_t
bus_unix_fds_passing_test (const char *test_data_dir_cstr)
{
+#ifdef HAVE_UNIX_FD_PASSING
DBusString test_data_dir;
BusContext *context;
DBusConnection *foo, *bar;
@@ -5248,8 +5247,10 @@ bus_unix_fds_passing_test (const char *test_data_dir_cstr)
bus_context_unref (context);
+#else
+ _dbus_test_skip ("fd-passing not supported on this platform");
+#endif
return TRUE;
}
-#endif
#endif /* DBUS_ENABLE_EMBEDDED_TESTS */
diff --git a/bus/test-main.c b/bus/test-main.c
index 0a4d6db0..c9ef184d 100644
--- a/bus/test-main.c
+++ b/bus/test-main.c
@@ -120,12 +120,7 @@ main (int argc, char **argv)
test_one ("dispatch", bus_dispatch_test, dir);
test_one ("activation-service-reload",
bus_activation_service_reload_test, dir);
-
-#ifdef HAVE_UNIX_FD_PASSING
test_one ("unix-fds-passing", bus_unix_fds_passing_test, dir);
-#else
- _dbus_test_skip ("fd-passing not supported on this platform");
-#endif
return _dbus_test_done_testing ();
}
diff --git a/bus/test.h b/bus/test.h
index 61367542..b80a3d76 100644
--- a/bus/test.h
+++ b/bus/test.h
@@ -50,10 +50,7 @@ void bus_test_run_clients_loop (dbus_bool_t block);
void bus_test_run_everything (BusContext *context);
BusContext* bus_context_new_test (const DBusString *test_data_dir,
const char *filename);
-
-#ifdef HAVE_UNIX_FD_PASSING
dbus_bool_t bus_unix_fds_passing_test (const char *test_data_dir_cstr);
-#endif
#endif