From 93bc140bf853531c62a70457507b4e6a5d1a6f2d Mon Sep 17 00:00:00 2001 From: Max Wash Date: Thu, 14 Nov 2024 22:00:01 +0000 Subject: [PATCH] core: handle btree test cases where two nodes have the same value --- core-test/core-units.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core-test/core-units.c b/core-test/core-units.c index a2fb24a..c202392 100644 --- a/core-test/core-units.c +++ b/core-test/core-units.c @@ -66,6 +66,7 @@ void test_btree_iterate(CuTest *tc) b_btree tree = {0}; struct test_tree_node *nodes = calloc(nr_nodes, sizeof *nodes); + CuAssertPtrNotNull(tc, nodes); for (int i = 0; i < nr_nodes; i++) { nodes[i].value = rand(); @@ -84,7 +85,7 @@ void test_btree_iterate(CuTest *tc) continue; } - CuAssertTrue(tc, prev < node->value); + CuAssertTrue(tc, prev <= node->value); prev = node->value; }