]> git.alsa-project.org Git - alsa-lib.git/commit
ctl: add test program for control element set
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Fri, 17 Jun 2016 12:26:42 +0000 (21:26 +0900)
committerTakashi Iwai <tiwai@suse.de>
Fri, 17 Jun 2016 13:12:20 +0000 (15:12 +0200)
commit5ba71a7b8144dc29c29ea36d5d2d221ebf8848da
treeb3f324243f524a279b324eb4f046af443abe7170
parentfe1b08803db61ebd27719cb0c5909219a9d3c7d4
ctl: add test program for control element set

The feature of control element set has been abandoned for a long time since
firstly introduced in 2003. Furthermore, there's few applications to utilize
this feature. These situations bring a hard work to persons who need the
feature. Especially, a lack of test program make it harder to fix much bugs
in this feature.

This commit adds a test program as a sample of the feature. This program
adds element sets of each element type to 'hw:0' in this order; boolean,
integer, enumerated, bytes, IEC958 and integer64. Each iteration includes
below scheme:

1. add an element set with 900 elements. Each of them has maximum number
   of members allowed by ALSA ctl core.
2. check all of events generated by above operation.
3. retrieve information of each element, then validate it.
4. unlock each member of all elements because they're initially locked.
5. write to all of members in all elements and read.
6. check all of events generated by above operation.
7. write information for threshold level to the element set and read it.
8. check all of events generated by above operation.
9. remove the element set.
10.check all of events generated by above operation.

When any of these operations fail, it means regression occurs. Then, added
elements still remain in a certain sound card. In this case, unloading
drivers corresponding to the card is an easy way to recover.

Besides, this program doesn't perform below element operations of ALSA ctl
feature:
 - list
 - lock
 - replace

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
test/Makefile.am
test/user-ctl-element-set.c [new file with mode: 0644]