DynamicsProcessing VTS: remove stageInUse testing am: f137ba4d92

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/26924921

Change-Id: I7372c7686b7480ad799165c234ce5dad9598dc26
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Shunkai Yao 2024-04-16 08:08:52 +00:00 committed by Automerger Merge Worker
commit 8c47facb19

View file

@ -453,12 +453,11 @@ enum EngineArchitectureTestParamName {
ENGINE_TEST_INSTANCE_NAME,
ENGINE_TEST_RESOLUTION_PREFERENCE,
ENGINE_TEST_PREFERRED_DURATION,
ENGINE_TEST_STAGE_ENABLEMENT,
ENGINE_TEST_LIMITER_IN_USE
ENGINE_TEST_STAGE_ENABLEMENT
};
using EngineArchitectureTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>,
DynamicsProcessing::ResolutionPreference, float,
DynamicsProcessing::StageEnablement, bool>;
DynamicsProcessing::StageEnablement>;
void fillEngineArchConfig(DynamicsProcessing::EngineArchitecture& cfg,
const EngineArchitectureTestParams& params) {
@ -466,7 +465,7 @@ void fillEngineArchConfig(DynamicsProcessing::EngineArchitecture& cfg,
cfg.preferredProcessingDurationMs = std::get<ENGINE_TEST_PREFERRED_DURATION>(params);
cfg.preEqStage = cfg.postEqStage = cfg.mbcStage =
std::get<ENGINE_TEST_STAGE_ENABLEMENT>(params);
cfg.limiterInUse = std::get<ENGINE_TEST_LIMITER_IN_USE>(params);
cfg.limiterInUse = true;
}
class DynamicsProcessingTestEngineArchitecture
@ -501,8 +500,8 @@ INSTANTIATE_TEST_SUITE_P(
static_cast<DynamicsProcessing::ResolutionPreference>(-1)), // variant
testing::Values(-10.f, 0.f, 10.f), // processing duration
testing::ValuesIn(
DynamicsProcessingTestHelper::kStageEnablementTestSet), // preEQ/postEQ/mbc
testing::Bool()), // limiter enable
DynamicsProcessingTestHelper::kStageEnablementTestSet) // preEQ/postEQ/mbc
),
[](const auto& info) {
auto descriptor = std::get<ENGINE_TEST_INSTANCE_NAME>(info.param).second;
DynamicsProcessing::EngineArchitecture cfg;
@ -568,7 +567,6 @@ enum LimiterConfigTestParamName {
LIMITER_CHANNEL,
LIMITER_ENABLE,
LIMITER_LINK_GROUP,
LIMITER_ENGINE_IN_USE,
LIMITER_ADDITIONAL,
};
enum LimiterConfigTestAdditionalParam {
@ -587,9 +585,8 @@ static constexpr std::array<LimiterConfigTestAdditional, 4> kLimiterConfigTestAd
{1, -60, 2.5, -2, 3.14},
{1, 60, 2.5, -2, 3.14}}};
using LimiterConfigTestParams =
std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t, bool, int32_t, bool,
LimiterConfigTestAdditional>;
using LimiterConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>,
int32_t, bool, int32_t, LimiterConfigTestAdditional>;
void fillLimiterConfig(DynamicsProcessing::LimiterConfig& cfg,
const LimiterConfigTestParams& params) {
@ -609,8 +606,7 @@ class DynamicsProcessingTestLimiterConfig
public DynamicsProcessingTestHelper {
public:
DynamicsProcessingTestLimiterConfig()
: DynamicsProcessingTestHelper(std::get<LIMITER_INSTANCE_NAME>(GetParam())),
mLimiterInUseEngine(std::get<LIMITER_ENGINE_IN_USE>(GetParam())) {
: DynamicsProcessingTestHelper(std::get<LIMITER_INSTANCE_NAME>(GetParam())) {
fillLimiterConfig(mCfg, GetParam());
}
@ -619,11 +615,9 @@ class DynamicsProcessingTestLimiterConfig
void TearDown() override { TearDownDynamicsProcessingEffect(); }
DynamicsProcessing::LimiterConfig mCfg;
bool mLimiterInUseEngine;
};
TEST_P(DynamicsProcessingTestLimiterConfig, SetAndGetLimiterConfig) {
mEngineConfigPreset.limiterInUse = mLimiterInUseEngine;
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
EXPECT_NO_FATAL_FAILURE(addLimiterConfig({mCfg}));
SetAndGetDynamicsProcessingParameters();
@ -633,21 +627,18 @@ INSTANTIATE_TEST_SUITE_P(
DynamicsProcessingTest, DynamicsProcessingTestLimiterConfig,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
testing::Values(-1, 0, 1, 2), // channel count
testing::Bool(), // enable
testing::Values(3), // link group
testing::Bool(), // engine limiter enable
testing::Values(-1, 0, 1, 2), // channel count
testing::Bool(), // enable
testing::Values(3), // link group
testing::ValuesIn(kLimiterConfigTestAdditionalParam)), // Additional
[](const auto& info) {
auto descriptor = std::get<LIMITER_INSTANCE_NAME>(info.param).second;
DynamicsProcessing::LimiterConfig cfg;
fillLimiterConfig(cfg, info.param);
std::string engineLimiterInUse =
std::to_string(std::get<LIMITER_ENGINE_IN_USE>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
toString(descriptor.common.id.uuid) + "_limiterConfig_" +
cfg.toString() + "_engineSetting_" + engineLimiterInUse;
cfg.toString();
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@ -659,11 +650,10 @@ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DynamicsProcessingTestLimiterConfi
*/
enum ChannelConfigTestParamName {
BAND_CHANNEL_TEST_INSTANCE_NAME,
BAND_CHANNEL_TEST_CHANNEL_CONFIG,
BAND_CHANNEL_TEST_ENGINE_IN_USE
BAND_CHANNEL_TEST_CHANNEL_CONFIG
};
using ChannelConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>,
std::vector<DynamicsProcessing::ChannelConfig>, bool>;
std::vector<DynamicsProcessing::ChannelConfig>>;
class DynamicsProcessingTestChannelConfig
: public ::testing::TestWithParam<ChannelConfigTestParams>,
@ -671,33 +661,28 @@ class DynamicsProcessingTestChannelConfig
public:
DynamicsProcessingTestChannelConfig()
: DynamicsProcessingTestHelper(std::get<BAND_CHANNEL_TEST_INSTANCE_NAME>(GetParam())),
mCfg(std::get<BAND_CHANNEL_TEST_CHANNEL_CONFIG>(GetParam())),
mInUseEngine(std::get<BAND_CHANNEL_TEST_ENGINE_IN_USE>(GetParam())) {}
mCfg(std::get<BAND_CHANNEL_TEST_CHANNEL_CONFIG>(GetParam())) {}
void SetUp() override { SetUpDynamicsProcessingEffect(); }
void TearDown() override { TearDownDynamicsProcessingEffect(); }
std::vector<DynamicsProcessing::ChannelConfig> mCfg;
const bool mInUseEngine;
};
TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetPreEqChannelConfig) {
mEngineConfigPreset.preEqStage.inUse = mInUseEngine;
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
EXPECT_NO_FATAL_FAILURE(addPreEqChannelConfig(mCfg));
SetAndGetDynamicsProcessingParameters();
}
TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetPostEqChannelConfig) {
mEngineConfigPreset.postEqStage.inUse = mInUseEngine;
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
EXPECT_NO_FATAL_FAILURE(addPostEqChannelConfig(mCfg));
SetAndGetDynamicsProcessingParameters();
}
TEST_P(DynamicsProcessingTestChannelConfig, SetAndGetMbcChannelConfig) {
mEngineConfigPreset.mbcStage.inUse = mInUseEngine;
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
EXPECT_NO_FATAL_FAILURE(addMbcChannelConfig(mCfg));
SetAndGetDynamicsProcessingParameters();
@ -709,19 +694,15 @@ INSTANTIATE_TEST_SUITE_P(
testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
testing::ValuesIn(
DynamicsProcessingTestHelper::kChannelConfigTestSet), // channel config
testing::Bool()), // Engine inUse
DynamicsProcessingTestHelper::kChannelConfigTestSet)), // channel config
[](const auto& info) {
auto descriptor = std::get<BAND_CHANNEL_TEST_INSTANCE_NAME>(info.param).second;
std::string engineInUse =
std::to_string(std::get<BAND_CHANNEL_TEST_ENGINE_IN_USE>(info.param));
std::string channelConfig = ::android::internal::ToString(
std::get<BAND_CHANNEL_TEST_CHANNEL_CONFIG>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
toString(descriptor.common.id.uuid) + "_" + channelConfig +
"_engineInUse_" + engineInUse;
toString(descriptor.common.id.uuid) + "_" + channelConfig;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@ -736,11 +717,10 @@ enum EqBandConfigTestParamName {
EQ_BAND_CHANNEL,
EQ_BAND_ENABLE,
EQ_BAND_CUT_OFF_FREQ,
EQ_BAND_GAIN,
EQ_BAND_STAGE_IN_USE
EQ_BAND_GAIN
};
using EqBandConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t,
bool, std::vector<std::pair<int, float>>, float, bool>;
bool, std::vector<std::pair<int, float>>, float>;
void fillEqBandConfig(std::vector<DynamicsProcessing::EqBandConfig>& cfgs,
const EqBandConfigTestParams& params) {
@ -760,8 +740,7 @@ class DynamicsProcessingTestEqBandConfig : public ::testing::TestWithParam<EqBan
public DynamicsProcessingTestHelper {
public:
DynamicsProcessingTestEqBandConfig()
: DynamicsProcessingTestHelper(std::get<EQ_BAND_INSTANCE_NAME>(GetParam())),
mStageInUse(std::get<EQ_BAND_STAGE_IN_USE>(GetParam())) {
: DynamicsProcessingTestHelper(std::get<EQ_BAND_INSTANCE_NAME>(GetParam())) {
fillEqBandConfig(mCfgs, GetParam());
}
@ -770,11 +749,9 @@ class DynamicsProcessingTestEqBandConfig : public ::testing::TestWithParam<EqBan
void TearDown() override { TearDownDynamicsProcessingEffect(); }
std::vector<DynamicsProcessing::EqBandConfig> mCfgs;
const bool mStageInUse;
};
TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPreEqBandConfig) {
mEngineConfigPreset.preEqStage.inUse = mStageInUse;
mEngineConfigPreset.preEqStage.bandCount = mCfgs.size();
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
@ -788,7 +765,6 @@ TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPreEqBandConfig) {
}
TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPostEqBandConfig) {
mEngineConfigPreset.postEqStage.inUse = mStageInUse;
mEngineConfigPreset.postEqStage.bandCount = mCfgs.size();
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
@ -849,21 +825,19 @@ INSTANTIATE_TEST_SUITE_P(
DynamicsProcessingTest, DynamicsProcessingTestEqBandConfig,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
testing::Values(-1, 0, 10), // channel ID
testing::Bool(), // band enable
testing::ValuesIn(kBands), // cut off frequencies
testing::Values(-3.14f, 3.14f), // gain
testing::Values(true)), // stage in use
testing::Values(-1, 0, 10), // channel ID
testing::Bool(), // band enable
testing::ValuesIn(kBands), // cut off frequencies
testing::Values(-3.14f, 3.14f) // gain
),
[](const auto& info) {
auto descriptor = std::get<EQ_BAND_INSTANCE_NAME>(info.param).second;
std::vector<DynamicsProcessing::EqBandConfig> cfgs;
fillEqBandConfig(cfgs, info.param);
std::string bands = ::android::internal::ToString(cfgs);
std::string stageInUse = std::to_string(std::get<EQ_BAND_STAGE_IN_USE>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
toString(descriptor.common.id.uuid) + "_bands_" + bands +
"_stageInUse_" + stageInUse;
toString(descriptor.common.id.uuid) + "_bands_" + bands;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@ -879,7 +853,6 @@ enum MbcBandConfigParamName {
MBC_BAND_CHANNEL,
MBC_BAND_ENABLE,
MBC_BAND_CUTOFF_FREQ,
MBC_BAND_STAGE_IN_USE,
MBC_BAND_ADDITIONAL
};
enum MbcBandConfigAdditional {
@ -905,7 +878,7 @@ static constexpr std::array<TestParamsMbcBandConfigAdditional, 4> kMbcBandConfig
using TestParamsMbcBandConfig =
std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t, bool,
std::vector<std::pair<int, float>>, bool, TestParamsMbcBandConfigAdditional>;
std::vector<std::pair<int, float>>, TestParamsMbcBandConfigAdditional>;
void fillMbcBandConfig(std::vector<DynamicsProcessing::MbcBandConfig>& cfgs,
const TestParamsMbcBandConfig& params) {
@ -936,8 +909,7 @@ class DynamicsProcessingTestMbcBandConfig
public DynamicsProcessingTestHelper {
public:
DynamicsProcessingTestMbcBandConfig()
: DynamicsProcessingTestHelper(std::get<MBC_BAND_INSTANCE_NAME>(GetParam())),
mStageInUse(std::get<MBC_BAND_STAGE_IN_USE>(GetParam())) {
: DynamicsProcessingTestHelper(std::get<MBC_BAND_INSTANCE_NAME>(GetParam())) {
fillMbcBandConfig(mCfgs, GetParam());
}
@ -946,11 +918,9 @@ class DynamicsProcessingTestMbcBandConfig
void TearDown() override { TearDownDynamicsProcessingEffect(); }
std::vector<DynamicsProcessing::MbcBandConfig> mCfgs;
const bool mStageInUse;
};
TEST_P(DynamicsProcessingTestMbcBandConfig, SetAndGetMbcBandConfig) {
mEngineConfigPreset.mbcStage.inUse = mStageInUse;
mEngineConfigPreset.mbcStage.bandCount = mCfgs.size();
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
@ -970,18 +940,15 @@ INSTANTIATE_TEST_SUITE_P(
testing::Values(-1, 0, 10), // channel count
testing::Bool(), // enable
testing::ValuesIn(kBands), // cut off frequencies
testing::Bool(), // stage in use
testing::ValuesIn(kMbcBandConfigAdditionalParam)), // Additional
[](const auto& info) {
auto descriptor = std::get<MBC_BAND_INSTANCE_NAME>(info.param).second;
std::vector<DynamicsProcessing::MbcBandConfig> cfgs;
fillMbcBandConfig(cfgs, info.param);
std::string mbcBands = ::android::internal::ToString(cfgs);
std::string stageInUse = std::to_string(std::get<MBC_BAND_STAGE_IN_USE>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
toString(descriptor.common.id.uuid) + "_bands_" + mbcBands +
"_stageInUse_" + stageInUse;
toString(descriptor.common.id.uuid) + "_bands_" + mbcBands;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;