]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit165a6c33a96dfffeef6b7c7d671337911c3f366f
tree8bba147d7d57d7ef2febced6c5c8f0ded728f3b2
parente8b030ba1826531f53232d757536af2d5d7d585b
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