From a7e10fa0b6c1772b8be49f17bb3e1eeb3477c26c Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 18 Aug 2012 14:41:07 -0400 Subject: [PATCH] Improve GPrivate test coverage --- glib/tests/private.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glib/tests/private.c b/glib/tests/private.c index cacf3f5..1bdcffa 100644 --- a/glib/tests/private.c +++ b/glib/tests/private.c @@ -85,6 +85,7 @@ private2_func (gpointer data) * - destroy notifies are called for each thread exit * - destroy notifies are called for g_thread_exit() too * - destroy notifies are not called on g_private_set() + * - destroy notifies are called on g_private_replace() */ static void test_private2 (void) @@ -94,13 +95,16 @@ test_private2 (void) private2 = g_private_new (private2_destroy); + g_private_set (private2, GINT_TO_POINTER(234)); + g_private_replace (private2, GINT_TO_POINTER(123)); + for (i = 0; i < 10; i++) thread[i] = g_thread_create (private2_func, GINT_TO_POINTER (i), TRUE, NULL); for (i = 0; i < 10; i++) g_thread_join (thread[i]); - g_assert_cmpint (private2_destroy_count, ==, 10); + g_assert_cmpint (private2_destroy_count, ==, 11); } static gboolean private3_freed; -- 2.7.4