From 3cd30c59e9f8ab8ab1270fbb4bcc6f142e296ed5 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 15 Mar 2019 14:25:19 +0000 Subject: [PATCH] tests: Compile the test_unix_address() test unconditionally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just skip the test if the unix transport isn’t supported. This means we get better compilation coverage, and more explicit TAP output saying that the test is being skipped on unsupported platforms. Signed-off-by: Philip Withnall --- gio/tests/gdbus-addresses.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gio/tests/gdbus-addresses.c b/gio/tests/gdbus-addresses.c index 1638bd9f5..3400b37a1 100644 --- a/gio/tests/gdbus-addresses.c +++ b/gio/tests/gdbus-addresses.c @@ -89,10 +89,12 @@ test_address_parsing (void) assert_not_supported_address ("magic-tractor:"); } -#ifdef G_OS_UNIX static void test_unix_address (void) { +#ifndef G_OS_UNIX + g_test_skip ("unix transport is not supported on non-Unix platforms"); +#else assert_is_supported_address ("unix:path=/tmp/dbus-test"); assert_is_supported_address ("unix:abstract=/tmp/dbus-another-test"); assert_not_supported_address ("unix:foo=bar"); @@ -103,8 +105,8 @@ test_unix_address (void) assert_not_supported_address ("unix:tmpdir=/tmp,abstract=/tmp/foo"); assert_not_supported_address ("unix:path=/tmp,abstract=/tmp/foo"); assert_not_supported_address ("unix:"); -} #endif +} static void test_nonce_tcp_address (void) @@ -185,9 +187,7 @@ main (int argc, g_test_add_func ("/gdbus/empty-address", test_empty_address); g_test_add_func ("/gdbus/address-parsing", test_address_parsing); -#ifdef G_OS_UNIX g_test_add_func ("/gdbus/unix-address", test_unix_address); -#endif g_test_add_func ("/gdbus/nonce-tcp-address", test_nonce_tcp_address); g_test_add_func ("/gdbus/tcp-address", test_tcp_address); g_test_add_func ("/gdbus/autolaunch-address", test_autolaunch_address);