VtsHalTargetTest: Configure channel layout and generate input data
correctly
This commit includes multiple changes:
- Updated generateSineWave function to generate both mono and stereo data
- Moved the calculateMagnitude function to a common location, the EffectHelper
class and added support for both mono and stereo data
- Modified the createParamCommon function
- Moved some constants to a common location, EffectHelper.h
- Updated some test functions to add support for both mono and stereo
- Added a function in EffectHelper to validate pffft input size
- Added checks in calculateMagnitudeMono() function to validate
input and output buffer size
Bug: 305866207
Test: atest hardware/interfaces/audio/aidl/vts/
Change-Id: Ia68108ad79349559b5b12bd6574da79fb1e117f3
diff --git a/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp b/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp
index 3ce9e53..f127c81 100644
--- a/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp
@@ -133,11 +133,11 @@
PresetReverbProcessTest() {
std::tie(mFactory, mDescriptor) = GetParam();
mInput.resize(kBufferSize);
- generateSineWave(1000 /*Input Frequency*/, mInput);
}
void SetUp() override {
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ ASSERT_NO_FATAL_FAILURE(generateSineWave(1000 /*Input Frequency*/, mInput));
ASSERT_NO_FATAL_FAILURE(SetUpPresetReverb());
}
void TearDown() override {