[PATCH v3 1/2] kselftest: alsa: Check for event generation when we write to controls

Takashi Iwai tiwai at suse.de
Fri Feb 4 10:40:08 CET 2022


On Wed, 02 Feb 2022 16:09:01 +0100,
Mark Brown wrote:
> 
> Add some coverage of event generation to mixer-test. Rather than doing a
> separate set of writes designed to trigger events we add a step to the
> existing write_and_verify() which checks to see if the value we read back
> from non-volatile controls matches the value before writing and that an
> event is or isn't generated as appropriate. The "tests" for events then
> simply check that no spurious or missing events were detected. This avoids
> needing further logic to generate appropriate values for each control type
> and maximises coverage.
> 
> When checking for events we use a timeout of 0. This relies on the kernel
> generating any event prior to returning to userspace when setting a control.
> That is currently the case and it is difficult to see it changing, if it
> does the test will need to be updated. Using a delay of 0 means that we
> don't slow things down unduly when checking for no event or when events
> fail to be generated.
> 
> We don't check behaviour for volatile controls since we can't tell what
> the behaviour is supposed to be for any given control.
> 
> Signed-off-by: Mark Brown <broonie at kernel.org>
> Reviewed-by: Shuah Khan <skhan at linuxfoundation.org>
> Reviewed-by: Jaroslav Kysela <perex at perex.cz>

Thanks, applied now to for-next branch.


Takashi


More information about the Alsa-devel mailing list