aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-utils-test.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-08-17ASoC: soc-utils-test: Add test for snd_soc_params_to_bclk()Richard Fitzgerald1-0/+46
snd_soc_params_to_bclk() calculates the BCLK from only the information in snd_pcm_hw_params. It is therefore a subset of the functionality of snd_soc_tdm_params_to_bclk() so can use a subset of the test case table. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com> Link: https://lore.kernel.org/r/20220817125508.1406651-1-rf@opensource.cirrus.com Signed-off-by: Mark Brown <broonie@kernel.org>
2022-04-05ASoC: soc-utils: Add kunit test for snd_soc_tdm_params_to_bclk()Richard Fitzgerald1-0/+186
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>