summaryrefslogtreecommitdiff
path: root/t/unit-tests/t-reftable-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 't/unit-tests/t-reftable-tree.c')
-rw-r--r--t/unit-tests/t-reftable-tree.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/t/unit-tests/t-reftable-tree.c b/t/unit-tests/t-reftable-tree.c
index 700479d34b..79b175a45a 100644
--- a/t/unit-tests/t-reftable-tree.c
+++ b/t/unit-tests/t-reftable-tree.c
@@ -37,16 +37,17 @@ static void t_tree_search(void)
* values[1] and values[10] (inclusive) in the tree.
*/
do {
- nodes[i] = tree_search(&values[i], &root, &t_compare, 1);
+ nodes[i] = tree_insert(&root, &values[i], &t_compare);
+ check(nodes[i] != NULL);
i = (i * 7) % 11;
} while (i != 1);
for (i = 1; i < ARRAY_SIZE(nodes); i++) {
check_pointer_eq(&values[i], nodes[i]->key);
- check_pointer_eq(nodes[i], tree_search(&values[i], &root, &t_compare, 0));
+ check_pointer_eq(nodes[i], tree_search(root, &values[i], &t_compare));
}
- check(!tree_search(values, &root, t_compare, 0));
+ check(!tree_search(root, values, t_compare));
tree_free(root);
}
@@ -62,7 +63,8 @@ static void t_infix_walk(void)
size_t count = 0;
do {
- tree_search(&values[i], &root, t_compare, 1);
+ struct tree_node *node = tree_insert(&root, &values[i], t_compare);
+ check(node != NULL);
i = (i * 7) % 11;
count++;
} while (i != 1);