summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2014-01-04 01:07:58 (GMT)
committerJason Evans <je@fb.com>2014-01-04 01:07:58 (GMT)
commit8cd0d949779930b63d763c3642de157c9f77e1fd (patch)
tree47593b45e73663166254eae2f690fc6138cbfb76
parent981bb499d92fee940d5be79cec3abdd3de3891b8 (diff)
downloadjemalloc-8cd0d949779930b63d763c3642de157c9f77e1fd.zip
jemalloc-8cd0d949779930b63d763c3642de157c9f77e1fd.tar.gz
jemalloc-8cd0d949779930b63d763c3642de157c9f77e1fd.tar.bz2
Convert assert() in test code to assert_*().
-rw-r--r--test/unit/rb.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/unit/rb.c b/test/unit/rb.c
index a41eee1..d79ec52 100644
--- a/test/unit/rb.c
+++ b/test/unit/rb.c
@@ -167,11 +167,17 @@ node_remove(tree_t *tree, node_t *node, unsigned nnodes)
/* Test rb_nsearch(). */
search_node = tree_nsearch(tree, node);
- assert(search_node == NULL || search_node->key >= node->key);
+ if (search_node != NULL) {
+ assert_u64_ge(search_node->key, node->key,
+ "Key ordering error");
+ }
/* Test rb_psearch(). */
search_node = tree_psearch(tree, node);
- assert(search_node == NULL || search_node->key <= node->key);
+ if (search_node != NULL) {
+ assert_u64_le(search_node->key, node->key,
+ "Key ordering error");
+ }
node->magic = 0;
@@ -179,8 +185,10 @@ node_remove(tree_t *tree, node_t *node, unsigned nnodes)
imbalances = tree_recurse(tree->rbt_root, black_height, 0,
&(tree->rbt_nil));
assert_u_eq(imbalances, 0, "Tree is unbalanced");
- assert(nnodes - 1 == tree_iterate(tree));
- assert(nnodes - 1 == tree_iterate_reverse(tree));
+ assert_u_eq(tree_iterate(tree), nnodes-1,
+ "Unexpected node iteration count");
+ assert_u_eq(tree_iterate_reverse(tree), nnodes-1,
+ "Unexpected node iteration count");
}
static node_t *