[glib: 2/3] tests: Add some assertions to avoid unused variable warnings on Clang



commit 37a3da891b695413db9ff50e890e758491091348
Author: Philip Withnall <withnall endlessm com>
Date:   Mon Feb 24 15:38:51 2020 +0000

    tests: Add some assertions to avoid unused variable warnings on Clang
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 glib/tests/autoptr.c    | 1 +
 gobject/tests/autoptr.c | 1 +
 2 files changed, 2 insertions(+)
---
diff --git a/glib/tests/autoptr.c b/glib/tests/autoptr.c
index 788d05c5e..cd510ed16 100644
--- a/glib/tests/autoptr.c
+++ b/glib/tests/autoptr.c
@@ -180,6 +180,7 @@ test_g_main_context_pusher (void)
   if (TRUE)
     {
       g_autoptr(GMainContextPusher) val = g_main_context_pusher_new (context);
+      g_assert_nonnull (val);
 
       /* Check it’s now the thread-default main context */
       g_assert_true (g_main_context_get_thread_default () == context);
diff --git a/gobject/tests/autoptr.c b/gobject/tests/autoptr.c
index 19421c220..ec3c89ebc 100644
--- a/gobject/tests/autoptr.c
+++ b/gobject/tests/autoptr.c
@@ -77,6 +77,7 @@ test_autoptr (void)
 
   {
     g_autoptr (TestAutoCleanup) tac = tac_ptr;
+    g_assert_nonnull (tac);
   }
 #ifdef __GNUC__
   g_assert_null (tac_ptr);


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