From 685d6058329dd98ced1add715bfb10c68b442cdd Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Fri, 15 Mar 2019 14:22:15 +0000 Subject: [PATCH] =?UTF-8?q?tests:=20Always=20check=20an=20address=20is=20v?= =?UTF-8?q?alid=20before=20checking=20it=E2=80=99s=20supported?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This gets us extra test coverage for free. Signed-off-by: Philip Withnall --- gio/tests/gdbus-addresses.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gio/tests/gdbus-addresses.c b/gio/tests/gdbus-addresses.c index febfe9073..29c307a31 100644 --- a/gio/tests/gdbus-addresses.c +++ b/gio/tests/gdbus-addresses.c @@ -44,6 +44,8 @@ assert_is_supported_address (const gchar *address) { GError *error = NULL; + g_assert_true (g_dbus_is_address (address)); + g_assert_true (g_dbus_is_supported_address (address, NULL)); g_assert_true (g_dbus_is_supported_address (address, &error)); g_assert_no_error (error); @@ -54,6 +56,8 @@ assert_not_supported_address (const gchar *address) { GError *error = NULL; + g_assert_true (g_dbus_is_address (address)); + g_assert_false (g_dbus_is_supported_address (address, NULL)); g_assert_false (g_dbus_is_supported_address (address, &error)); g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); @@ -67,10 +71,8 @@ test_unix_address (void) assert_not_supported_address ("some-imaginary-transport:foo=bar"); assert_is_supported_address ("unix:path=/tmp/dbus-test"); assert_is_supported_address ("unix:abstract=/tmp/dbus-another-test"); - g_assert_true (g_dbus_is_address ("unix:foo=bar")); assert_not_supported_address ("unix:foo=bar"); g_assert_false (g_dbus_is_address ("unix:path=/foo;abstract=/bar")); - assert_not_supported_address ("unix:path=/foo;abstract=/bar"); assert_is_supported_address ("unix:path=/tmp/concrete;unix:abstract=/tmp/abstract"); g_assert_true (g_dbus_is_address ("some-imaginary-transport:foo=bar"));