[glib] Improve array test coverage
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Improve array test coverage
- Date: Sat, 18 Aug 2012 18:41:57 +0000 (UTC)
commit 06d837b6a3ac59f8e997d9f745136d48b85ecb38
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Aug 18 14:39:28 2012 -0400
Improve array test coverage
glib/tests/array-test.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/glib/tests/array-test.c b/glib/tests/array-test.c
index 5f9ccd5..255bb3f 100644
--- a/glib/tests/array-test.c
+++ b/glib/tests/array-test.c
@@ -429,19 +429,23 @@ pointer_array_free_func (void)
g_ptr_array_add (gparray, g_strdup ("baz"));
g_ptr_array_remove_index (gparray, 0);
g_assert_cmpint (num_free_func_invocations, ==, 1);
+ g_ptr_array_remove_index_fast (gparray, 1);
+ g_assert_cmpint (num_free_func_invocations, ==, 2);
s = g_strdup ("frob");
g_ptr_array_add (gparray, s);
g_assert (g_ptr_array_remove (gparray, s));
g_assert (!g_ptr_array_remove (gparray, "nuun"));
g_assert (!g_ptr_array_remove_fast (gparray, "mlo"));
- g_assert_cmpint (num_free_func_invocations, ==, 2);
- g_ptr_array_set_size (gparray, 1);
g_assert_cmpint (num_free_func_invocations, ==, 3);
+ s = g_strdup ("frob");
+ g_ptr_array_add (gparray, s);
+ g_ptr_array_set_size (gparray, 1);
+ g_assert_cmpint (num_free_func_invocations, ==, 4);
g_ptr_array_ref (gparray);
g_ptr_array_unref (gparray);
- g_assert_cmpint (num_free_func_invocations, ==, 3);
- g_ptr_array_unref (gparray);
g_assert_cmpint (num_free_func_invocations, ==, 4);
+ g_ptr_array_unref (gparray);
+ g_assert_cmpint (num_free_func_invocations, ==, 5);
num_free_func_invocations = 0;
gparray = g_ptr_array_new_full (10, my_free_func);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]