le_audio: Fix flaky audio hal client test
Sometimes the test takes a bit longer than usually and the periodic
audio data reading function runs twice. This fixes the following error
caused by improper mocking of periodically called function:
GMOCK WARNING:
packages/modules/Bluetooth/system/bta/le_audio/audio_hal_client/audio_hal_client_test.cc:465:
Actions ran out in EXPECT_CALL(mock_hal_interface_audio_sink_, Read(_,
_))...
Called 2 times, but only 1 WillOnce() is specified - returning default
value.
Stack trace:
packages/modules/Bluetooth/system/bta/le_audio/audio_hal_client/audio_hal_client_test.cc:486:
Failure
Mock function called more times than expected - returning directly.
Function call: OnAudioDataReady(@0x7ba4429c66a0 { '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', ... })
Expected: to be called once
Actual: called twice - over-saturated and active
Bug: 264033479
Tag: #feature
Test: atest --host LeAudioClientAudioTest#testAudioHalClientResumeStartSourceTask --no-bazel-mode --rerun-until-failure 10000
Change-Id: If489eebeb4a5f97c86715aa068508dd32e05c266
Loading
Please register or sign in to comment