summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-03-05 18:58:12 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2021-03-06 22:08:36 +0100
commit919d1e85f2cc17059f72db48c3bc38e0b524f6c0 (patch)
treecac9b227ee4edac72b7c850370c23cbcf68d3d93 /tests
parent02db0ae8ff83a42913b1b4224ccd8377f5fc5323 (diff)
Add a context pointer to the rbtree key comparison
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'tests')
-rw-r--r--tests/libutil/rbtree.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/libutil/rbtree.c b/tests/libutil/rbtree.c
index 03c0025..25c9b61 100644
--- a/tests/libutil/rbtree.c
+++ b/tests/libutil/rbtree.c
@@ -9,8 +9,9 @@
#include "rbtree.h"
#include "../test.h"
-static int key_compare(const void *a, const void *b)
+static int key_compare(const void *ctx, const void *a, const void *b)
{
+ (void)ctx;
return *((sqfs_s32 *)a) - *((sqfs_s32 *)b);
}
@@ -66,14 +67,14 @@ static void check_binary_tree_dfs(rbtree_node_t *n)
if (n->left != NULL) {
cmp = rbtree_node_key(n->left);
- TEST_ASSERT(key_compare(cmp, key) < 0);
+ TEST_ASSERT(key_compare(NULL, cmp, key) < 0);
check_binary_tree_dfs(n->left);
}
if (n->right != NULL) {
cmp = rbtree_node_key(n->right);
- TEST_ASSERT(key_compare(cmp, key) > 0);
+ TEST_ASSERT(key_compare(NULL, cmp, key) > 0);
check_binary_tree_dfs(n->right);
}