[glib: 3/4] tests: Add a test to avoid a set-but-unused variable
- From: Sebastian Dröge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 3/4] tests: Add a test to avoid a set-but-unused variable
- Date: Tue, 24 Nov 2020 09:40:35 +0000 (UTC)
commit 6e446931a809d2fc8c5799151740dfcdf9b6309e
Author: Philip Withnall <pwithnall endlessos org>
Date: Mon Nov 23 16:44:20 2020 +0000
tests: Add a test to avoid a set-but-unused variable
Spotted by `scan-build`.
Signed-off-by: Philip Withnall <pwithnall endlessos org>
glib/tests/timeout.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/glib/tests/timeout.c b/glib/tests/timeout.c
index 47f00ba89..fc836f312 100644
--- a/glib/tests/timeout.c
+++ b/glib/tests/timeout.c
@@ -126,6 +126,8 @@ test_far_future_ready_time (void)
n_fds = 0;
n_fds = g_main_context_query (context, priority, &timeout_, NULL, n_fds);
+ g_assert_cmpint (n_fds, >=, 0);
+
/* The true timeout in milliseconds doesn't fit into a gint. We definitely
* don't want poll() to block forever:
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]