Merge "Effect AIDL VTS: skip data path testing for offloading effects" into 24D1-dev
This commit is contained in:
commit
b2869538a7
5 changed files with 30 additions and 10 deletions
|
@ -104,11 +104,13 @@ inline ::testing::AssertionResult assertResultOrUnknownTransaction(
|
|||
EXPECT_PRED_FORMAT2(::android::hardware::audio::common::testing::detail::assertResult, \
|
||||
expected, ret)
|
||||
|
||||
#define SKIP_TEST_IF_DATA_UNSUPPORTED(flags) \
|
||||
({ \
|
||||
if ((flags).hwAcceleratorMode == Flags::HardwareAccelerator::TUNNEL || (flags).bypass) { \
|
||||
GTEST_SKIP() << "Skip data path for offload"; \
|
||||
} \
|
||||
#define SKIP_TEST_IF_DATA_UNSUPPORTED(flags) \
|
||||
({ \
|
||||
if ((flags).hwAcceleratorMode == \
|
||||
aidl::android::hardware::audio::effect::Flags::HardwareAccelerator::TUNNEL || \
|
||||
(flags).bypass) { \
|
||||
GTEST_SKIP() << "Skip data path for offload"; \
|
||||
} \
|
||||
})
|
||||
|
||||
// Test that the transaction status 'isOk' if it is a known transaction
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue