Effect AIDL replace test cases icombine vector values with set
To avoid potential test cases with duplicate name.
Also update replace hardcode enum values with ndk::enum_range.
Bug: 258124419
Test: atest VtsHalAECTargetTest
Test: atest VtsHalAGCTargetTest
Change-Id: I6131d99f8b443ae48a487800190365cb645032da
diff --git a/audio/aidl/vts/VtsHalNSTargetTest.cpp b/audio/aidl/vts/VtsHalNSTargetTest.cpp
index 186cb68..2845225 100644
--- a/audio/aidl/vts/VtsHalNSTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalNSTargetTest.cpp
@@ -19,6 +19,7 @@
#define LOG_TAG "VtsHalNSParamTest"
#include <Utils.h>
+#include <unordered_set>
#include "EffectHelper.h"
using namespace android;
@@ -69,7 +70,7 @@
static const long kInputFrameCount = 0x100, kOutputFrameCount = 0x100;
static const std::vector<std::pair<std::shared_ptr<IFactory>, Descriptor>> kFactoryDescList;
- static const std::vector<NoiseSuppression::Level> kLevelValues;
+ static const std::unordered_set<NoiseSuppression::Level> kLevelValues;
std::shared_ptr<IFactory> mFactory;
std::shared_ptr<IEffect> mEffect;
@@ -122,9 +123,9 @@
const std::vector<std::pair<std::shared_ptr<IFactory>, Descriptor>> kFactoryDescList =
EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor,
kNoiseSuppressionTypeUUID);
-const std::vector<NoiseSuppression::Level> NSParamTest::kLevelValues = {
- NoiseSuppression::Level::LOW, NoiseSuppression::Level::MEDIUM,
- NoiseSuppression::Level::HIGH};
+const std::unordered_set<NoiseSuppression::Level> NSParamTest::kLevelValues = {
+ ndk::enum_range<NoiseSuppression::Level>().begin(),
+ ndk::enum_range<NoiseSuppression::Level>().end()};
TEST_P(NSParamTest, SetAndGetLevel) {
EXPECT_NO_FATAL_FAILURE(addLevelParam(mLevel));