summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Naganov <mnaganov@google.com>2020-03-18 14:37:43 -0700
committerMikhail Naganov <mnaganov@google.com>2020-03-23 15:32:51 -0700
commit113bd8111a04b3eef9970144800b1e5db1d57776 (patch)
tree522f91ae9224fb34d0dd4e5b130bdda4a9ff665b
parent1be73e85a1f3a5d03b7c1a662f5a4efe5c8b318a (diff)
downloadplatform_hardware_interfaces-113bd8111a04b3eef9970144800b1e5db1d57776.tar.gz
platform_hardware_interfaces-113bd8111a04b3eef9970144800b1e5db1d57776.tar.bz2
platform_hardware_interfaces-113bd8111a04b3eef9970144800b1e5db1d57776.zip
Audio Effects: Skip CheckConfig test for non-matching HAL versions
In vts-core a test suite for version N can be called for HAL of version M. Since in the case of the Effects HAL the XSD configuration for the effects is version-dependent, the test must not validate the effects config using XSD file for other version. Thus, the configuration validity check must be skipped if no corresponding version of IEffectsFactory is found on the device. Bug: 142397658 Bug: 146015418 Test: atest VtsHalAudioEffectV6_0TargetTest on a device that uses earlier version of Audio HAL; CheckConfig#audioEffectsConfigurationValidation must be IGNORED Change-Id: I4b34cc34091447c04bf8d3e988c9bd4048dc8ef9 Merged-In: I4b34cc34091447c04bf8d3e988c9bd4048dc8ef9
-rw-r--r--audio/effect/all-versions/vts/functional/ValidateAudioEffectsConfiguration.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/audio/effect/all-versions/vts/functional/ValidateAudioEffectsConfiguration.cpp b/audio/effect/all-versions/vts/functional/ValidateAudioEffectsConfiguration.cpp
index f9e4aa30eb..9c0135bf93 100644
--- a/audio/effect/all-versions/vts/functional/ValidateAudioEffectsConfiguration.cpp
+++ b/audio/effect/all-versions/vts/functional/ValidateAudioEffectsConfiguration.cpp
@@ -18,6 +18,12 @@
#include <iterator>
#include <media/EffectsConfig.h>
+// clang-format off
+#include PATH(android/hardware/audio/effect/FILE_VERSION/IEffectsFactory.h)
+// clang-format on
+
+#include <gtest/gtest.h>
+#include <hidl/ServiceManagement.h>
#include "utility/ValidateXml.h"
@@ -29,6 +35,11 @@ TEST(CheckConfig, audioEffectsConfigurationValidation) {
RecordProperty("description",
"Verify that the effects configuration file is valid according to the schema");
using namespace android::effectsConfig;
+ if (android::hardware::getAllHalInstanceNames(
+ ::android::hardware::audio::effect::CPP_VERSION::IEffectsFactory::descriptor)
+ .size() == 0) {
+ GTEST_SKIP() << "No Effects HAL version " STRINGIFY(CPP_VERSION) " on this device";
+ }
std::vector<const char*> locations(std::begin(DEFAULT_LOCATIONS), std::end(DEFAULT_LOCATIONS));
const char* xsd = "/data/local/tmp/audio_effects_conf_" STRINGIFY(CPP_VERSION) ".xsd";