[dconf/wip/reorg] DConfChangeset: pointless fiddling with asserts



commit 8317a107de299e5e03dc5511fefdcf5383a82bd7
Author: Ryan Lortie <desrt desrt ca>
Date:   Tue Jul 10 11:43:11 2012 -0400

    DConfChangeset: pointless fiddling with asserts
    
    Adjust the way that an assert is done in order to convince lcov that we
    have 100% line coverage (since the 'g_assert_not_reached()' wasn't being
    hit before).

 common/dconf-changeset.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/common/dconf-changeset.c b/common/dconf-changeset.c
index 195841a..177f682 100644
--- a/common/dconf-changeset.c
+++ b/common/dconf-changeset.c
@@ -337,13 +337,14 @@ dconf_changeset_build_description (DConfChangeset *changeset)
   {
     GHashTableIter iter;
     const gchar *first;
+    gboolean have_one;
     gpointer key;
 
     g_hash_table_iter_init (&iter, changeset->table);
 
     /* We checked above that we have at least one item. */
-    if (!g_hash_table_iter_next (&iter, &key, NULL))
-      g_assert_not_reached ();
+    have_one = g_hash_table_iter_next (&iter, &key, NULL);
+    g_assert (have_one);
 
     prefix_length = strlen (key);
     first = key;



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