summaryrefslogtreecommitdiffstats
path: root/test/test_ring.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-11-25 09:55:27 -0500
committerDavid Robillard <d@drobilla.net>2022-11-25 10:08:49 -0500
commit0569a7ad70a82d68548bbe4cf79bcc64d5f9878d (patch)
tree1eefbd728f33f31b0d270b5c0e76754a6ced7913 /test/test_ring.c
parent112fa18bfa293629ccb90fbd952aa6e61398da80 (diff)
downloadzix-0569a7ad70a82d68548bbe4cf79bcc64d5f9878d.tar.gz
zix-0569a7ad70a82d68548bbe4cf79bcc64d5f9878d.tar.bz2
zix-0569a7ad70a82d68548bbe4cf79bcc64d5f9878d.zip
Constrain test parameters to reasonable limits
Diffstat (limited to 'test/test_ring.c')
-rw-r--r--test/test_ring.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test_ring.c b/test/test_ring.c
index 7209ac0..c61b3a3 100644
--- a/test/test_ring.c
+++ b/test/test_ring.c
@@ -4,6 +4,7 @@
#undef NDEBUG
#include "failing_allocator.h"
+#include "test_args.h"
#include "zix/attributes.h"
#include "zix/ring.h"
@@ -185,9 +186,10 @@ main(int argc, char** argv)
}
const unsigned size =
- (argc > 1) ? (unsigned)strtoul(argv[1], NULL, 10) : 1024;
+ (argc > 1) ? (unsigned)zix_test_size_arg(argv[1], 4U, 1U << 20U) : 1024U;
- n_writes = (argc > 2) ? (unsigned)strtoul(argv[2], NULL, 10) : size * 1024;
+ n_writes = (argc > 2) ? (unsigned)zix_test_size_arg(argv[2], 4U, 1U << 20U)
+ : size * 1024;
test_failed_alloc();
test_ring(size);