ALSA: core: Add sound core KUnit test
authorIvan Orlov <ivan.orlov0322@gmail.com>
Thu, 25 Jan 2024 22:35:21 +0000 (22:35 +0000)
committerTakashi Iwai <tiwai@suse.de>
Tue, 30 Jan 2024 13:11:37 +0000 (14:11 +0100)
commit3e39acf56ededdebd1033349a16b704839b94b28
tree00475f236e209be978ffe191a8dcac06918a9050
parentd1eb913c8df4574df2861db03d2411023bd7930a
ALSA: core: Add sound core KUnit test

At the moment, we have a decent amount of integration tests (selftests)
covering different aspects of the sound subsystem. However, a lot of
of sound-related in-kernel functions remains uncovered. This patch
introduces the KUnit test for the core part of the sound subsystem.
It includes 10 test cases:

- Coverage of the format-related inline functions from 'pcm.h' header
file: snd_pcm_format_physical_width, snd_pcm_format_width,
snd_pcm_format_signed, test_format_endianness

- Coverage of the available bytes counting functions from 'pcm.h'
header: snd_pcm_capture_avail, snd_pcm_playback_avail

- Coverage of functions from pcm_misc: snd_pcm_format_set_silence,
snd_pcm_format_name

- Coverage of card-related functions from init.c: snd_card_set_id,
snd_component_add

This patch depends on the previous patches in this patch series as they
contain fix for the bug, which was found during the test development.
Without them, the test doesn't pass.

Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com>
Link: https://lore.kernel.org/r/20240125223522.1122765-3-ivan.orlov0322@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
MAINTAINERS
sound/core/Kconfig
sound/core/Makefile
sound/core/sound_kunit.c [new file with mode: 0644]