[PATCH v2] kselftest: alsa: Add simplistic test for ALSA mixer controls kselftest

Mark Brown broonie at kernel.org
Mon Dec 6 17:39:23 CET 2021


On Mon, Dec 06, 2021 at 10:27:26AM -0600, Pierre-Louis Bossart wrote:

> > This is added as a kselftest since unlike other ALSA test programs it does
> > not require either physical setup of the device or interactive monitoring

> what did you mean by 'not require physical setup of the device'?

You don't need for example a loopback cable plugging in.

> > +// This test will iterate over all cards detected in the system, exercising

> would it make sense to test only specific cards? People doing automated
> tests might have a USB device for capture of analog loopbacks, or
> injection of specific streams for capture, and usually care about
> testing such devices - which do need manual setups and wiring btw.

It's not really idiomatic for kselftest to require any per system
configuration by default - half the thing is that you can just run it
and it should do as much as it can sensibly on the system.  You could
definitely add some command line options for development or manual usage
though.

> > +		    snd_ctl_elem_info_get_step64(ctl->info)) {
> > +			ksft_print_msg("%s value %lld invalid for step %lld minimum %lld\n",
> > +				       ctl->name, int64_val,
> > +				       snd_ctl_elem_info_get_step64(ctl->info),
> > +				       snd_ctl_elem_info_get_min64(ctl->info));
> > +			err = -1;
> > +		}
> > +		break;
> > +
> > +	default:
> > +		/* No tests for other types */

> these types include ENUMERATED, BYTES and IEC958, but see below for
> ENUMERATED...

These are tests that the information returned when we query the card
status is coherent, we're not doing any validation at present that the
enumeration's return value was sensible.

> > +	case SND_CTL_ELEM_TYPE_ENUMERATED:
> 
> ... here you are handling ENUMERATED types?
> 

This is a different test, that we can write all valid values. 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20211206/6b4ad0d3/attachment-0001.sig>


More information about the Alsa-devel mailing list