Commit dca6a601 authored by Matthias Clasen's avatar Matthias Clasen

Improve GCache test coverage

parent eeedaac3
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment