Merge changes I95f19d20,Ic720e74c into main
* changes: minor improvements for VtsHalAudioEffectFactoryTargetTest Effect AIDL VTS: skip data path testing for offloading effects
This commit is contained in:
commit
49800ab894
6 changed files with 38 additions and 19 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
|
||||
|
|
|
@ -65,7 +65,7 @@ class EffectFactoryTest : public testing::TestWithParam<std::string> {
|
|||
}
|
||||
}
|
||||
|
||||
std::string kServiceName = GetParam();
|
||||
const std::string kServiceName = GetParam();
|
||||
std::shared_ptr<IFactory> mEffectFactory;
|
||||
std::vector<std::shared_ptr<IEffect>> mEffects;
|
||||
const Descriptor::Identity kNullId = {.uuid = getEffectUuidNull()};
|
||||
|
@ -118,6 +118,10 @@ class EffectFactoryTest : public testing::TestWithParam<std::string> {
|
|||
mEffectFactory = IFactory::fromBinder(mBinderUtil.connectToService(kServiceName));
|
||||
ASSERT_NE(mEffectFactory, nullptr);
|
||||
}
|
||||
void restartAndGetFactory() {
|
||||
mEffectFactory = IFactory::fromBinder(mBinderUtil.restartService());
|
||||
ASSERT_NE(mEffectFactory, nullptr);
|
||||
}
|
||||
};
|
||||
|
||||
TEST_P(EffectFactoryTest, SetupAndTearDown) {
|
||||
|
@ -126,8 +130,7 @@ TEST_P(EffectFactoryTest, SetupAndTearDown) {
|
|||
|
||||
TEST_P(EffectFactoryTest, CanBeRestarted) {
|
||||
ASSERT_NE(mEffectFactory, nullptr);
|
||||
mEffectFactory = IFactory::fromBinder(mBinderUtil.restartService());
|
||||
ASSERT_NE(mEffectFactory, nullptr);
|
||||
restartAndGetFactory();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -249,9 +252,7 @@ TEST_P(EffectFactoryTest, CreateDestroyWithRestart) {
|
|||
EXPECT_NE(descs.size(), 0UL);
|
||||
creatAndDestroyDescs(descs);
|
||||
|
||||
mEffectFactory = IFactory::fromBinder(mBinderUtil.restartService());
|
||||
ASSERT_NE(mEffectFactory, nullptr);
|
||||
|
||||
restartAndGetFactory();
|
||||
connectAndGetFactory();
|
||||
creatAndDestroyDescs(descs);
|
||||
}
|
||||
|
@ -263,9 +264,7 @@ TEST_P(EffectFactoryTest, EffectInvalidAfterRestart) {
|
|||
EXPECT_NE(descs.size(), 0UL);
|
||||
std::vector<std::shared_ptr<IEffect>> effects = createWithDescs(descs);
|
||||
|
||||
mEffectFactory = IFactory::fromBinder(mBinderUtil.restartService());
|
||||
ASSERT_NE(mEffectFactory, nullptr);
|
||||
|
||||
restartAndGetFactory();
|
||||
connectAndGetFactory();
|
||||
destroyEffects(effects, EX_ILLEGAL_ARGUMENT);
|
||||
}
|
||||
|
|
|
@ -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