summaryrefslogtreecommitdiffstats
path: root/test/btree_test.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-13 23:51:27 +0200
committerDavid Robillard <d@drobilla.net>2020-08-14 09:43:38 +0200
commit8b4a8734dd3bf4b00fffdbde4b0b271b50f89c19 (patch)
treef8fee34cf69fe6101c47bf2130b16f72a14435e5 /test/btree_test.c
parentb655041650f496fc7367e2c5140c5835507b9e73 (diff)
downloadzix-8b4a8734dd3bf4b00fffdbde4b0b271b50f89c19.tar.gz
zix-8b4a8734dd3bf4b00fffdbde4b0b271b50f89c19.tar.bz2
zix-8b4a8734dd3bf4b00fffdbde4b0b271b50f89c19.zip
Fix potential division by zero
Diffstat (limited to 'test/btree_test.c')
-rw-r--r--test/btree_test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/btree_test.c b/test/btree_test.c
index 7c470c0..df44081 100644
--- a/test/btree_test.c
+++ b/test/btree_test.c
@@ -125,7 +125,9 @@ test_fail(ZixBTree* t, const char* fmt, ...)
static int
stress(const unsigned test_num, const size_t n_elems)
{
- assert(n_elems > 0);
+ if (n_elems == 0) {
+ return 0;
+ }
uintptr_t r = 0;
ZixBTree* t = zix_btree_new(int_cmp, NULL, NULL);