mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-02 15:46:17 +01:00
Improve GCache test coverage
This commit is contained in:
parent
eeedaac3e8
commit
dca6a601c1
@ -87,6 +87,17 @@ key_foreach (gpointer valuep, gpointer keyp, gpointer data)
|
||||
g_assert_cmpint (*key, ==, 2);
|
||||
}
|
||||
|
||||
static void
|
||||
value_foreach (gpointer keyp, gpointer nodep, gpointer data)
|
||||
{
|
||||
gint *count = data;
|
||||
gint *key = keyp;
|
||||
|
||||
(*count)++;
|
||||
|
||||
g_assert_cmpint (*key, ==, 2);
|
||||
}
|
||||
|
||||
static void
|
||||
test_cache_basic (void)
|
||||
{
|
||||
@ -114,6 +125,10 @@ test_cache_basic (void)
|
||||
g_cache_key_foreach (c, key_foreach, &count);
|
||||
g_assert_cmpint (count, ==, 1);
|
||||
|
||||
count = 0;
|
||||
g_cache_value_foreach (c, value_foreach, &count);
|
||||
g_assert_cmpint (count, ==, 1);
|
||||
|
||||
value = g_cache_insert (c, key);
|
||||
g_assert_cmpint (*value, ==, 4);
|
||||
g_assert_cmpint (value_create_count, ==, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user