From 8f2abea4de8a71b167372bba48a0706c0d6e62ef Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 31 Oct 2017 10:51:17 -0700 Subject: [PATCH] test-tool/test_compareandwrite_simple: Limit the number of blocks used Make sure that 'maxbl' does not exceed the LUN capacity. Signed-off-by: Bart Van Assche --- test-tool/test_compareandwrite_simple.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test-tool/test_compareandwrite_simple.c b/test-tool/test_compareandwrite_simple.c index d3499d1..b4b840e 100644 --- a/test-tool/test_compareandwrite_simple.c +++ b/test-tool/test_compareandwrite_simple.c @@ -48,6 +48,8 @@ test_compareandwrite_simple(void) n = 256; if (n + 0U > num_blocks) n = num_blocks; + if (maxbl + 0U > num_blocks) + maxbl = num_blocks; logging(LOG_VERBOSE, LOG_BLANK_LINE); logging(LOG_VERBOSE, "Test COMPARE_AND_WRITE of 1-%d blocks at the "