test repeated g_hash_table_remove_all calls

I just came across a situation where code ended up stuck in
an infinite loop in GHashTable code, so lets verify that this
is a safe thing.
This commit is contained in:
Matthias Clasen
2015-08-28 14:13:24 -04:00
parent 323b1d9c5f
commit eb7ffccf44

View File

@@ -823,6 +823,10 @@ test_remove_all (void)
g_assert_cmpint (destroy_counter, ==, 2);
g_assert_cmpint (destroy_key_counter, ==, 2);
g_hash_table_remove_all (h);
g_assert_cmpint (destroy_counter, ==, 2);
g_assert_cmpint (destroy_key_counter, ==, 2);
g_hash_table_unref (h);
}