summaryrefslogtreecommitdiffstats
path: root/test/btree_test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-09-10 20:11:36 -0400
committerDavid Robillard <d@drobilla.net>2021-09-10 20:54:28 -0400
commitb91461c15620e0f2214edda70048b0a8420a70ed (patch)
treebda506bd543ce25ba2e293e3095f61f5582466aa /test/btree_test.c
parent4b86bcd2713a0ccb6b171371a5d0eb70be4f1f1b (diff)
downloadzix-b91461c15620e0f2214edda70048b0a8420a70ed.tar.gz
zix-b91461c15620e0f2214edda70048b0a8420a70ed.tar.bz2
zix-b91461c15620e0f2214edda70048b0a8420a70ed.zip
Simplify BTree implementation
Diffstat (limited to 'test/btree_test.c')
-rw-r--r--test/btree_test.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/btree_test.c b/test/btree_test.c
index 9c4eab8..77771c4 100644
--- a/test/btree_test.c
+++ b/test/btree_test.c
@@ -234,7 +234,7 @@ stress(const unsigned test_num, const size_t n_elems)
// Find the lower bound of all elements and ensure it's exact
for (size_t i = 0; i < n_elems; ++i) {
r = ith_elem(test_num, n_elems, i);
- if (zix_btree_lower_bound(t, (void*)r, &ti)) {
+ if (zix_btree_lower_bound(t, int_cmp, NULL, (void*)r, &ti)) {
return test_fail(
t, "Lower bound %" PRIuPTR " @ %" PRIuPTR " failed\n", (uintptr_t)r, i);
}
@@ -467,7 +467,7 @@ stress(const unsigned test_num, const size_t n_elems)
// Find lower bound of wildcard
const uintptr_t wildcard = 0;
- if (zix_btree_lower_bound(t, (void*)wildcard, &ti)) {
+ if (zix_btree_lower_bound(t, wildcard_cmp, &ctx, (void*)wildcard, &ti)) {
return test_fail(t, "Lower bound failed\n");
}
@@ -490,7 +490,7 @@ stress(const unsigned test_num, const size_t n_elems)
// Find lower bound of value past end
const uintptr_t max = (uintptr_t)-1;
- if (zix_btree_lower_bound(t, (void*)max, &ti)) {
+ if (zix_btree_lower_bound(t, wildcard_cmp, &ctx, (void*)max, &ti)) {
return test_fail(t, "Lower bound failed\n");
}