From f7ee1f64a9037d4797c52245f936ff7580f9f47d Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Tue, 25 Jan 2022 16:17:48 +0100 Subject: [PATCH] block_tester: warn on wrong length argument When specifying a low value, the tester won't spawn any job but stay silent. The message helps diagnosing such configuration problems. --- repos/os/src/app/block_tester/test_sequential.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/repos/os/src/app/block_tester/test_sequential.h b/repos/os/src/app/block_tester/test_sequential.h index 7607006fd5..758bfb9fac 100644 --- a/repos/os/src/app/block_tester/test_sequential.h +++ b/repos/os/src/app/block_tester/test_sequential.h @@ -52,6 +52,10 @@ struct Test::Sequential : Test_base _size_in_blocks = _size / _info.block_size; _length_in_blocks = _length / _info.block_size; _end = _start + _length_in_blocks; + + if (_length == 0 || (_length % _info.block_size) != 0) + error("length attribute (", _length, ") must be a multiple of " + "block size (", _info.block_size, ")"); } void _spawn_job() override