diff options
author | Philip Withnall <withnall@endlessm.com> | 2019-03-15 14:33:30 +0000 |
---|---|---|
committer | Philip Withnall <withnall@endlessm.com> | 2019-03-15 14:36:57 +0000 |
commit | f9fb7e8765999dcd142be67eff51703dfe48f298 (patch) | |
tree | f0e09a2038aa76f6a16573e1a74cfa96b8c5a14c | |
parent | 3cd30c59e9f8ab8ab1270fbb4bcc6f142e296ed5 (diff) | |
download | glib-f9fb7e8765999dcd142be67eff51703dfe48f298.tar.gz |
tests: Add test for unsupported unparseable D-Bus addresses
Signed-off-by: Philip Withnall <withnall@endlessm.com>
-rw-r--r-- | gio/tests/gdbus-addresses.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gio/tests/gdbus-addresses.c b/gio/tests/gdbus-addresses.c index 3400b37a1..3cf87dec8 100644 --- a/gio/tests/gdbus-addresses.c +++ b/gio/tests/gdbus-addresses.c @@ -39,6 +39,18 @@ test_empty_address (void) g_error_free (error); } +/* Test that g_dbus_is_supported_address() returns FALSE for an unparseable + * address. */ +static void +test_unsupported_address (void) +{ + GError *error = NULL; + + g_assert_false (g_dbus_is_supported_address (";", &error)); + g_assert_error (error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT); + g_clear_error (&error); +} + static void assert_is_supported_address (const gchar *address) { @@ -186,6 +198,7 @@ main (int argc, g_test_init (&argc, &argv, NULL); g_test_add_func ("/gdbus/empty-address", test_empty_address); + g_test_add_func ("/gdbus/unsupported-address", test_unsupported_address); g_test_add_func ("/gdbus/address-parsing", test_address_parsing); g_test_add_func ("/gdbus/unix-address", test_unix_address); g_test_add_func ("/gdbus/nonce-tcp-address", test_nonce_tcp_address); |