summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2022-05-27 11:42:51 +0200
committerJens Georg <mail@jensge.org>2022-05-27 11:45:04 +0200
commit935efb3f7398d7eff6c6dd972fa964405b512fdc (patch)
tree1a56fb4989abb40277ba642e18e2f5ae745e008b /tests
parentdeb28a4d96922d9c68ce96743f1016c7ab9ebd59 (diff)
downloadgupnp-935efb3f7398d7eff6c6dd972fa964405b512fdc.tar.gz
tests: One more v6 test as optional
Diffstat (limited to 'tests')
-rw-r--r--tests/test-context.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/tests/test-context.c b/tests/test-context.c
index 7424afb..e646d63 100644
--- a/tests/test-context.c
+++ b/tests/test-context.c
@@ -360,25 +360,27 @@ test_gupnp_context_rewrite_uri ()
"::1",
NULL);
- g_assert_no_error (error);
- g_assert_nonnull (context);
- // Rewriting a v6 uri on a v4 context should not work
- uri = gupnp_context_rewrite_uri (context, "http://[fe80::1]");
- char *expected = g_strdup_printf (
- "http://[fe80::1%%25%d]",
- gssdp_client_get_index (GSSDP_CLIENT (context)));
- g_assert_cmpstr (uri, ==, expected);
- g_free (expected);
- g_free (uri);
+ // Skip test if IPv6 could not be found
+ if (error == NULL) {
+ g_assert_nonnull (context);
+ // Rewriting a v6 uri on a v4 context should not work
+ uri = gupnp_context_rewrite_uri (context, "http://[fe80::1]");
+ char *expected = g_strdup_printf (
+ "http://[fe80::1%%25%d]",
+ gssdp_client_get_index (GSSDP_CLIENT (context)));
+ g_assert_cmpstr (uri, ==, expected);
+ g_free (expected);
+ g_free (uri);
- g_test_expect_message ("gupnp-context",
- G_LOG_LEVEL_WARNING,
- "Address*family*mismatch*");
- uri = gupnp_context_rewrite_uri (context, "http://127.0.0.1");
- g_assert_null (uri);
- g_test_assert_expected_messages ();
+ g_test_expect_message ("gupnp-context",
+ G_LOG_LEVEL_WARNING,
+ "Address*family*mismatch*");
+ uri = gupnp_context_rewrite_uri (context, "http://127.0.0.1");
+ g_assert_null (uri);
+ g_test_assert_expected_messages ();
- g_object_unref (context);
+ g_object_unref (context);
+ }
}
void