From 0569a7ad70a82d68548bbe4cf79bcc64d5f9878d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 25 Nov 2022 09:55:27 -0500 Subject: Constrain test parameters to reasonable limits --- test/test_btree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test/test_btree.c') 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) { -- cgit v1.2.1