core: handle btree test cases where two nodes have the same value

This commit is contained in:
2024-11-14 22:00:01 +00:00
parent 1bab373547
commit 93bc140bf8

View File

@@ -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;
}