]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
bus tests: Skip unsupported fd-passing test internally, not from main()
authorSimon McVittie <smcv@collabora.com>
Mon, 3 Sep 2018 21:13:45 +0000 (14:13 -0700)
committerSimon McVittie <smcv@collabora.com>
Mon, 17 Dec 2018 14:12:59 +0000 (14:12 +0000)
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>
bus/dispatch.c
bus/test-main.c
bus/test.h

index b17d0ad2469323a22aaf8a9f97afaf5880c4eae8..e91a825546ddf270f409bf901322a69f4539297a 100644 (file)
@@ -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 */
index 0a4d6db052b66ed25da6822622709437378c5199..c9ef184d51b441fb54d23d06eebccb52a9514f22 100644 (file)
@@ -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 ();
 }
index 6136754295e4980af15721e5a6f05d86a459b22d..b80a3d7662f5791399ba88da4006c0822d058e4d 100644 (file)
@@ -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