kselftest: alsa: Add test case for writing invalid values
authorMark Brown <broonie@kernel.org>
Tue, 25 Jan 2022 16:28:24 +0000 (16:28 +0000)
committerTakashi Iwai <tiwai@suse.de>
Wed, 26 Jan 2022 14:59:49 +0000 (15:59 +0100)
commit88b6132248940954b958cd4e6d0432c640a9abd2
tree8bba147d7d57d7ef2febced6c5c8f0ded728f3b2
parent2b101256fd552bf2e29980d51394ebd88737159c
kselftest: alsa: Add test case for writing invalid values

Attempt to write various invalid values for control types we know about and
check that something sensible happens. The ABI isn't quite as clearly
defined as one might like, rather than generating an error when an invalid
value is written many devices will silently rewrite the value into one that
is valid for the control. The exact value chosen is not predictable so in
the case the write succeeds we just check that the value we read back is
one that is valid for the control.

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20220125162824.3816659-1-broonie@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
tools/testing/selftests/alsa/mixer-test.c