summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2022-06-05 14:23:25 +0200
committerJens Georg <mail@jensge.org>2022-06-05 14:23:25 +0200
commit3fc3a1b4eba60cc0e475723e3efe08f4dcf02f6f (patch)
tree712205b812cdb29f431c28e05e27d718189ea4d1 /tests
parent8b1e1d151bb59e3fa389d281030acaf24b25de78 (diff)
downloadgupnp-3fc3a1b4eba60cc0e475723e3efe08f4dcf02f6f.tar.gz
all: Coverity fixes
CID352971, CID352973, CID352974, CID352977, CID352980 Also sprinkle some coverity false-positive markers
Diffstat (limited to 'tests')
-rw-r--r--tests/test-acl.c3
-rw-r--r--tests/test-context.c2
-rw-r--r--tests/test-service-proxy.c10
3 files changed, 11 insertions, 4 deletions
diff --git a/tests/test-acl.c b/tests/test-acl.c
index 12bc89c..275446a 100644
--- a/tests/test-acl.c
+++ b/tests/test-acl.c
@@ -272,7 +272,6 @@ test_gupnp_context_acl (ContextTestFixture *tf, gconstpointer user_data)
acl->is_allowed = TRUE;
gupnp_context_set_acl (tf->context, GUPNP_ACL (acl));
- g_object_unref (acl);
g_assert (acl == (TestAcl *) gupnp_context_get_acl (tf->context));
@@ -397,6 +396,8 @@ test_gupnp_context_acl (ContextTestFixture *tf, gconstpointer user_data)
g_object_unref (msg);
g_free (request_uri);
+
+ g_object_unref (acl);
}
int
diff --git a/tests/test-context.c b/tests/test-context.c
index e646d63..2dda7f7 100644
--- a/tests/test-context.c
+++ b/tests/test-context.c
@@ -155,6 +155,8 @@ request_range_and_compare (GMappedFile *file,
&got_length);
g_assert_cmpint (got_start, ==, want_start);
g_assert_cmpint (got_end, ==, want_end);
+
+ // coverity[leaked_storage]
result = memcmp (g_mapped_file_get_contents (file) + want_start,
g_bytes_get_data (h.body, NULL),
want_length);
diff --git a/tests/test-service-proxy.c b/tests/test-service-proxy.c
index 240c154..f81b134 100644
--- a/tests/test-service-proxy.c
+++ b/tests/test-service-proxy.c
@@ -473,9 +473,9 @@ thread_func (gpointer data)
gupnp_service_proxy_action_unref (action);
if (d->expected_error.domain != 0)
- g_error_matches (error,
- d->expected_error.domain,
- d->expected_error.code);
+ g_assert_error (error,
+ d->expected_error.domain,
+ d->expected_error.code);
g_object_unref (gpd.p);
g_object_unref (cp);
@@ -515,6 +515,8 @@ test_sync_call (ProxyTestFixture *tf, gconstpointer user_data)
// Spin the loop for a bit...
g_timeout_add (500, (GSourceFunc) delayed_loop_quitter, tf->loop);
g_main_loop_run (tf->loop);
+
+ g_thread_unref (t);
}
gboolean
@@ -554,6 +556,7 @@ test_cancel_sync_call (ProxyTestFixture *tf, gconstpointer user_data)
// Spin the loop for a bit...
g_timeout_add (500, (GSourceFunc) delayed_loop_quitter, tf->loop);
g_main_loop_run (tf->loop);
+ g_thread_unref (t);
}
void
@@ -632,6 +635,7 @@ test_finish_soap_error_sync (ProxyTestFixture *tf, gconstpointer user_data)
// Spin the loop for a bit...
g_timeout_add (500, (GSourceFunc) delayed_loop_quitter, tf->loop);
g_main_loop_run (tf->loop);
+ g_thread_unref (t);
}
int