diff options
author | David Robillard <d@drobilla.net> | 2022-11-25 09:55:27 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-11-25 10:08:49 -0500 |
commit | 0569a7ad70a82d68548bbe4cf79bcc64d5f9878d (patch) | |
tree | 1eefbd728f33f31b0d270b5c0e76754a6ced7913 /test/test_btree.c | |
parent | 112fa18bfa293629ccb90fbd952aa6e61398da80 (diff) | |
download | zix-0569a7ad70a82d68548bbe4cf79bcc64d5f9878d.tar.gz zix-0569a7ad70a82d68548bbe4cf79bcc64d5f9878d.tar.bz2 zix-0569a7ad70a82d68548bbe4cf79bcc64d5f9878d.zip |
Constrain test parameters to reasonable limits
Diffstat (limited to 'test/test_btree.c')
-rw-r--r-- | test/test_btree.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/test_btree.c b/test/test_btree.c index 259bb2a..a6f724a 100644 --- a/test/test_btree.c +++ b/test/test_btree.c @@ -6,6 +6,7 @@ #include "zix/btree.h" #include "failing_allocator.h" +#include "test_args.h" #include "test_data.h" #include "zix/allocator.h" @@ -628,7 +629,8 @@ main(int argc, char** argv) test_failed_alloc(); const unsigned n_tests = 3U; - const size_t n_elems = (argc > 1) ? strtoul(argv[1], NULL, 10) : 131072U; + const size_t n_elems = + (argc > 1) ? zix_test_size_arg(argv[1], 4U, 1U << 20U) : 131072U; printf("Running %u tests with %" PRIuPTR " elements", n_tests, n_elems); for (unsigned i = 0; i < n_tests; ++i) { |