diff options
author | Jens Georg <mail@jensge.org> | 2021-12-29 17:44:51 +0100 |
---|---|---|
committer | Jens Georg <mail@jensge.org> | 2021-12-30 10:12:10 +0100 |
commit | c5bc89adb5b5e79e9227ce8c5c1cf3ddad21cde7 (patch) | |
tree | 59426c773c4017a369ef0c2aa5cdd4e5e0291ac3 /tests | |
parent | d39232a1d9c089c251339ba20fdc97639b0808a0 (diff) | |
download | gupnp-c5bc89adb5b5e79e9227ce8c5c1cf3ddad21cde7.tar.gz |
tests: Add some branches for ACL tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-acl.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/test-acl.c b/tests/test-acl.c index 25e2b42..cc848ca 100644 --- a/tests/test-acl.c +++ b/tests/test-acl.c @@ -283,7 +283,11 @@ test_gupnp_context_acl (ContextTestFixture *tf, gconstpointer user_data) &destroy_called, destroy_server_handler_data); - char *uri = g_uri_resolve_relative (tf->base_uri, "/foo", 0, &error); + // pass on a query, to cover more branches + char *uri = g_uri_resolve_relative (tf->base_uri, + "/foo?foo=bar&bar=baz", + 0, + &error); g_assert_nonnull (uri); g_assert_no_error (error); @@ -307,13 +311,15 @@ test_gupnp_context_acl (ContextTestFixture *tf, gconstpointer user_data) soup_server_remove_handler (gupnp_context_get_server (tf->context), "/foo"); + g_assert_cmpint (destroy_called, ==, 1); + destroy_called = FALSE; gupnp_context_add_server_handler (tf->context, TRUE, "/foo", acl_test_handler, - NULL, - NULL); + &destroy_called, + destroy_server_handler_data); g_object_unref (msg); msg = soup_message_new (SOUP_METHOD_HEAD, request_uri); @@ -396,8 +402,6 @@ test_gupnp_context_acl (ContextTestFixture *tf, gconstpointer user_data) int main (int argc, char *argv[]) { - GError *error; - g_test_init (&argc, &argv, NULL); GPtrArray *addresses = g_ptr_array_sized_new (2); |