[glib: 7/9] tests: Remove assertion that unused buckets should have NULL key/value



commit eed0f182fd4bef801156195a6194d78c87c5aa61
Author: Hans Petter Jansson <hpj cl no>
Date:   Mon Jul 30 15:13:44 2018 +0200

    tests: Remove assertion that unused buckets should have NULL key/value
    
    We still clear the key/value on removal, but since we're growing the
    arrays with realloc() now, we can't guarantee that incoming memory is
    cleared. There's no reason it should be either, since we check the
    hashes array (which is always in a defined state) before accessing the
    other arrays.

 glib/tests/hash.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
---
diff --git a/glib/tests/hash.c b/glib/tests/hash.c
index 982252f46..16acbbf2a 100644
--- a/glib/tests/hash.c
+++ b/glib/tests/hash.c
@@ -1414,12 +1414,7 @@ check_data (GHashTable *h)
 
   for (i = 0; i < h->size; i++)
     {
-      if (h->hashes[i] < 2)
-        {
-          g_assert (fetch_key_or_value (h->keys, i, h->have_big_keys) == NULL);
-          g_assert (fetch_key_or_value (h->values, i, h->have_big_values) == NULL);
-        }
-      else
+      if (h->hashes[i] >= 2)
         {
           g_assert_cmpint (h->hashes[i], ==, h->hash_func (fetch_key_or_value (h->keys, i, 
h->have_big_keys)));
         }


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