test: test sandbox sound driver more rigorously

Consider unexpected values for frequency:

* negative frequency
* zero frequency
* frequency exceeding sampling frequency

As in these cases the sum of the samples is zero also check the count of
the samples.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Heinrich Schuchardt
2022-12-04 17:11:41 +01:00
parent d0e8777bee
commit 968eaaeaa7
3 changed files with 30 additions and 0 deletions

View File

@@ -188,6 +188,16 @@ int sandbox_get_setup_called(struct udevice *dev);
*/
int sandbox_get_sound_active(struct udevice *dev);
/**
* sandbox_get_sound_count() - Read back the count of the sound data so far
*
* This data is provided to the sandbox driver by the sound play() method.
*
* @dev: Device to check
* Return: count of audio data
*/
int sandbox_get_sound_count(struct udevice *dev);
/**
* sandbox_get_sound_sum() - Read back the sum of the sound data so far
*