diff options
author | Jens Georg <mail@jensge.org> | 2022-05-25 20:56:27 +0200 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2022-05-25 20:56:27 +0200 |
commit | 8991a9b53fe1be3c6291454bb693e752ad0f1a05 (patch) | |
tree | 03844dd7caba20836fbdcb0e49406998e6448056 | |
parent | 49af00d33e127fe119c26d32e9cd21c75617fb1f (diff) | |
download | gupnp-8991a9b53fe1be3c6291454bb693e752ad0f1a05.tar.gz |
tests: In the double bind test, skip if ipv6 fails
-rw-r--r-- | tests/test-context.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/tests/test-context.c b/tests/test-context.c index 98ea7d5..7424afb 100644 --- a/tests/test-context.c +++ b/tests/test-context.c @@ -290,33 +290,35 @@ test_gupnp_context_error_when_bound () // IPv6 server = soup_server_new (NULL, NULL); soup_server_listen_local (server, 0, SOUP_SERVER_LISTEN_IPV6_ONLY, &error); - g_assert_no_error (error); + if (error == NULL) { + uris = soup_server_get_uris (server); - uris = soup_server_get_uris (server); + address = g_uri_get_host (uris->data); + port = g_uri_get_port (uris->data); - address = g_uri_get_host (uris->data); - port = g_uri_get_port (uris->data); + g_test_expect_message ("gupnp-context", + G_LOG_LEVEL_WARNING, + "*Unable to listen*Could not " + "listen*Address already in use*"); + context = g_initable_new (GUPNP_TYPE_CONTEXT, + NULL, + &error, + "host-ip", + address, + "port", + port, + NULL); - g_test_expect_message ( - "gupnp-context", - G_LOG_LEVEL_WARNING, - "*Unable to listen*Could not listen*Address already in use*"); - context = g_initable_new (GUPNP_TYPE_CONTEXT, - NULL, - &error, - "host-ip", - address, - "port", - port, - NULL); + g_slist_free_full (uris, (GDestroyNotify) g_uri_unref); - g_slist_free_full (uris, (GDestroyNotify) g_uri_unref); + g_test_assert_expected_messages (); + g_assert_error (error, + GUPNP_SERVER_ERROR, + GUPNP_SERVER_ERROR_OTHER); + g_assert_null (context); + g_clear_error (&error); + } g_object_unref (server); - - g_test_assert_expected_messages (); - g_assert_error (error, GUPNP_SERVER_ERROR, GUPNP_SERVER_ERROR_OTHER); - g_assert_null (context); - g_clear_error (&error); } void |