From: Matthias Clasen Date: Mon, 2 Apr 2012 12:00:48 +0000 (-0400) Subject: Use new hashset api in the hash set tests X-Git-Tag: 2.32.1~89 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e51c3b4cfe9f24ccf21ee3bd04186fe5c38d95f8;p=platform%2Fupstream%2Fglib.git Use new hashset api in the hash set tests --- diff --git a/glib/tests/hash.c b/glib/tests/hash.c index 290dc9c1f..fe0bb6914 100644 --- a/glib/tests/hash.c +++ b/glib/tests/hash.c @@ -508,13 +508,17 @@ set_hash_test (void) for (i = 2; i < 5000; i += 7) { char *s = g_strdup_printf ("%d", i); - g_hash_table_insert (hash_table, s, s); + g_hash_table_add (hash_table, s); } i = 0; g_hash_table_foreach (hash_table, set_check, &i); g_assert_cmpint (i, ==, g_hash_table_size (hash_table)); + g_assert (g_hash_table_contains (hash_table, "2")); + g_assert (g_hash_table_contains (hash_table, "9")); + g_assert (!g_hash_table_contains (hash_table, "a")); + /* this will cause the hash table to loose set nature */ g_hash_table_insert (hash_table, g_strdup ("a"), "b");