Audio HAL: Align V2 and V4 VTS
It was thought that the V2 VTS were not going to be supported after V4
VTS were created. Thus a large portion of the code was copy paste and
modified.
That assumption ended up wrong as a lot of OEM reported bugs that needed
to be fixed in both versions.
As a result align the code of both version VTS as much as possible.
The code will be merged in a follow up patch.
Bug: 118203066
Test: compile
Change-Id: I994232db237b5d7c52e7d796f199ab3c6eec21f4
Signed-off-by: Kevin Rocard <krocard@google.com>
diff --git a/audio/effect/4.0/vts/functional/ValidateAudioEffectsConfiguration.cpp b/audio/effect/4.0/vts/functional/ValidateAudioEffectsConfiguration.cpp
index 6338563..2e94143 100644
--- a/audio/effect/4.0/vts/functional/ValidateAudioEffectsConfiguration.cpp
+++ b/audio/effect/4.0/vts/functional/ValidateAudioEffectsConfiguration.cpp
@@ -21,12 +21,19 @@
#include "utility/ValidateXml.h"
+// Stringify the argument.
+#define QUOTE(x) #x
+#define STRINGIFY(x) QUOTE(x)
+
+#define AUDIO_HAL_VERSION V4_0
+
TEST(CheckConfig, audioEffectsConfigurationValidation) {
RecordProperty("description",
"Verify that the effects configuration file is valid according to the schema");
using namespace android::effectsConfig;
std::vector<const char*> locations(std::begin(DEFAULT_LOCATIONS), std::end(DEFAULT_LOCATIONS));
- EXPECT_ONE_VALID_XML_MULTIPLE_LOCATIONS(DEFAULT_NAME, locations,
- "/data/local/tmp/audio_effects_conf_V4_0.xsd");
+ const char* xsd = "/data/local/tmp/audio_effects_conf_" STRINGIFY(AUDIO_HAL_VERSION) ".xsd";
+ // Starting with V4, audio effect XML is required
+ EXPECT_ONE_VALID_XML_MULTIPLE_LOCATIONS(DEFAULT_NAME, locations, xsd);
}
diff --git a/audio/effect/4.0/vts/functional/VtsHalAudioEffectTargetTest.cpp b/audio/effect/4.0/vts/functional/VtsHalAudioEffectTargetTest.cpp
index 5c10c69..96b8602 100644
--- a/audio/effect/4.0/vts/functional/VtsHalAudioEffectTargetTest.cpp
+++ b/audio/effect/4.0/vts/functional/VtsHalAudioEffectTargetTest.cpp
@@ -39,7 +39,7 @@
using android::hardware::MQDescriptorSync;
using android::hardware::Return;
using android::hardware::Void;
-using android::hardware::audio::common::utils::mkBitfield;
+using android::hardware::audio::common::utils::mkEnumBitfield;
using android::hardware::audio::common::V4_0::AudioDevice;
using android::hardware::audio::common::V4_0::AudioHandleConsts;
using android::hardware::audio::common::V4_0::AudioMode;
@@ -399,7 +399,7 @@
TEST_F(AudioEffectHidlTest, SetDevice) {
description("Verify that SetDevice works for an output chain effect");
- Return<Result> ret = effect->setDevice(mkBitfield(AudioDevice::OUT_SPEAKER));
+ Return<Result> ret = effect->setDevice(mkEnumBitfield(AudioDevice::OUT_SPEAKER));
EXPECT_TRUE(ret.isOk());
EXPECT_EQ(Result::OK, ret);
}
@@ -449,7 +449,7 @@
TEST_F(AudioEffectHidlTest, SetInputDevice) {
description("Verify that SetInputDevice does not crash");
- Return<Result> ret = effect->setInputDevice(mkBitfield(AudioDevice::IN_BUILTIN_MIC));
+ Return<Result> ret = effect->setInputDevice(mkEnumBitfield(AudioDevice::IN_BUILTIN_MIC));
EXPECT_TRUE(ret.isOk());
}