Merge "Effect AIDL VTS: skip data path testing for offloading effects" into 24D1-dev

This commit is contained in:
Shunkai Yao 2024-03-14 16:58:44 +00:00 committed by Android (Google) Code Review
commit b2869538a7
5 changed files with 30 additions and 10 deletions

View file

@ -106,7 +106,9 @@ inline ::testing::AssertionResult assertResultOrUnknownTransaction(
#define SKIP_TEST_IF_DATA_UNSUPPORTED(flags) \
({ \
if ((flags).hwAcceleratorMode == Flags::HardwareAccelerator::TUNNEL || (flags).bypass) { \
if ((flags).hwAcceleratorMode == \
aidl::android::hardware::audio::effect::Flags::HardwareAccelerator::TUNNEL || \
(flags).bypass) { \
GTEST_SKIP() << "Skip data path for offload"; \
} \
})

View file

@ -166,6 +166,7 @@ class BassBoostDataTest : public ::testing::TestWithParam<BassBoostDataTestParam
}
void SetUp() override {
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
ASSERT_NO_FATAL_FAILURE(SetUpBassBoost(mChannelLayout));
if (int32_t version;
mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
@ -173,7 +174,10 @@ class BassBoostDataTest : public ::testing::TestWithParam<BassBoostDataTestParam
}
}
void TearDown() override { TearDownBassBoost(); }
void TearDown() override {
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
TearDownBassBoost();
}
// Find FFT bin indices for testFrequencies and get bin center frequencies
void roundToFreqCenteredToFftBin(std::vector<int>& testFrequencies,

View file

@ -230,6 +230,7 @@ class DownmixFoldDataTest : public ::testing::TestWithParam<DownmixDataTestParam
}
void SetUp() override {
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
SetUpDownmix(mInputChannelLayout);
if (int32_t version;
mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
@ -241,7 +242,10 @@ class DownmixFoldDataTest : public ::testing::TestWithParam<DownmixDataTestParam
setDataTestParams(mInputChannelLayout);
}
void TearDown() override { TearDownDownmix(); }
void TearDown() override {
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
TearDownDownmix();
}
void checkAtLeft(int32_t position) {
for (size_t i = 0, j = position; i < mOutputBufferSize;

View file

@ -156,6 +156,7 @@ class LoudnessEnhancerDataTest : public ::testing::TestWithParam<LoudnessEnhance
}
void SetUp() override {
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
SetUpLoudnessEnhancer();
// Creating AidlMessageQueues
@ -164,7 +165,10 @@ class LoudnessEnhancerDataTest : public ::testing::TestWithParam<LoudnessEnhance
mOutputMQ = std::make_unique<EffectHelper::DataMQ>(mOpenEffectReturn.outputDataMQ);
}
void TearDown() override { TearDownLoudnessEnhancer(); }
void TearDown() override {
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
TearDownLoudnessEnhancer();
}
// Fill inputBuffer with random values between -kMaxAudioSample to kMaxAudioSample
void generateInputBuffer() {

View file

@ -163,8 +163,14 @@ class VolumeDataTest : public ::testing::TestWithParam<VolumeDataTestParam>,
// Convert Decibel value to Percentage
int percentageDb(float level) { return std::round((1 - (pow(10, level / 20))) * 100); }
void SetUp() override { ASSERT_NO_FATAL_FAILURE(SetUpVolumeControl()); }
void TearDown() override { TearDownVolumeControl(); }
void SetUp() override {
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
ASSERT_NO_FATAL_FAILURE(SetUpVolumeControl());
}
void TearDown() override {
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
TearDownVolumeControl();
}
static constexpr int kMaxAudioSample = 1;
static constexpr int kTransitionDuration = 300;