summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2005-05-17 15:33:36 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2005-05-17 15:33:36 +0000
commit0c04a92b2ba019acb142561319875ca4973328cd (patch)
treeeceecd155bd12bf5f776f97df2df22de43d4f4e4 /tests
parent16d8ccb0b5e80a859556f861e6875b53a1158661 (diff)
Check the return values of g_tree_remove().
2005-05-17 Matthias Clasen <mclasen@redhat.com> * tests/tree-test.c (main): Check the return values of g_tree_remove(). * glib/gtree.c (g_tree_remove, g_tree_steal): Return a boolean indicating wether the key was found. (#302545, Matthew F. Barnes)
Diffstat (limited to 'tests')
-rw-r--r--tests/tree-test.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/tree-test.c b/tests/tree-test.c
index 226ab88a4..18443d235 100644
--- a/tests/tree-test.c
+++ b/tests/tree-test.c
@@ -83,7 +83,9 @@ main (int argc,
{
gint i, j;
GTree *tree;
+ gboolean removed;
char chars[62];
+ char c;
tree = g_tree_new (my_compare);
i = 0;
@@ -108,7 +110,14 @@ main (int argc,
g_assert (g_tree_nnodes (tree) == (10 + 26 + 26));
for (i = 0; i < 10; i++)
- g_tree_remove (tree, &chars[i]);
+ {
+ removed = g_tree_remove (tree, &chars[i]);
+ g_assert (removed);
+ }
+
+ c = '\0';
+ removed = g_tree_remove (tree, &c);
+ g_assert (removed == FALSE);
g_tree_foreach (tree, my_traverse, NULL);