[glib: 2/4] tests: Add a test to avoid a set-but-unused variable




commit eafc6b257cadf4e4129d7011e6564f178ef704a3
Author: Philip Withnall <pwithnall endlessos org>
Date:   Mon Nov 23 16:43:55 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/gdatetime.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c
index 14d13db66..a25ae916f 100644
--- a/glib/tests/gdatetime.c
+++ b/glib/tests/gdatetime.c
@@ -2384,6 +2384,7 @@ test_adjust_time (void)
   g_date_time_unref (dt);
 
   i1 = g_time_zone_adjust_time (tz, G_TIME_TYPE_DAYLIGHT, &u2);
+  g_assert_cmpint (i1, >=, 0);
   g_assert (u == u2);
 
   g_time_zone_unref (tz);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]