[libdazzle] tests: silence checked-return-value warnings



commit 964486cd0eb167a47bfdb026c36f7c751f440c36
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jul 10 16:19:44 2017 -0700

    tests: silence checked-return-value warnings

 tests/test-desktop-index.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/tests/test-desktop-index.c b/tests/test-desktop-index.c
index c3e4099..b1f7909 100644
--- a/tests/test-desktop-index.c
+++ b/tests/test-desktop-index.c
@@ -45,9 +45,12 @@ query_cb (GObject      *object,
       g_autofree gchar *subtitle = NULL;
       g_autofree gchar *escape_keyword = NULL;
 
-      g_variant_dict_lookup (dict, "id", "&s", &id);
-      g_variant_dict_lookup (dict, "title", "&s", &title);
-      g_variant_dict_lookup (dict, "icon-name", "&s", &icon_name);
+      if (!g_variant_dict_lookup (dict, "id", "&s", &id))
+        id = NULL;
+      if (!g_variant_dict_lookup (dict, "title", "&s", &title))
+        title = NULL;
+      if (!g_variant_dict_lookup (dict, "icon-name", "&s", &icon_name))
+        icon_name = NULL;
 
       if (g_hash_table_contains (hash, id))
         continue;


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