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.
This commit is contained in:
Norman Feske 2022-01-25 16:17:48 +01:00
parent 64af1d2d84
commit f7ee1f64a9

View File

@ -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