]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: soc-utils: Add kunit test for snd_soc_tdm_params_to_bclk()
authorRichard Fitzgerald <rf@opensource.cirrus.com>
Tue, 5 Apr 2022 13:54:17 +0000 (14:54 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 5 Apr 2022 17:27:56 +0000 (18:27 +0100)
commitded0ca802b56c320883d40fb80ebf61ba4e09387
treed8a67daabd4b7c1e75e190c496b03c56f867cc5f
parentc1d22b3a3aa9762dbdc2a3a8d7acf8b0ffabf04b
ASoC: soc-utils: Add kunit test for snd_soc_tdm_params_to_bclk()

Create a new kunit test for soc-utils and use it to test
snd_soc_tdm_params_to_bclk().

The test uses a table of values to avoid the possibility that an
on-the-fly generator contains the same algorithmic error as the
function-under-test and so fails to detect a bug.

There is no need to test every possible combination of values.
Enough test cases are included to give confidence that the function
is producing the correct results.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220405135419.1230088-4-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/Kconfig
sound/soc/Makefile
sound/soc/soc-utils-test.c [new file with mode: 0644]