mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge "Audio Effect VTS: run Dowmmix data path test only after HAL version 2" into main am: 8c00013594 am: 76268cc57d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2894923 Change-Id: Ie59e64bec5d8488c438ed16c470780f5e9fec4b3 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -32,6 +32,9 @@ using aidl::android::hardware::audio::effect::Parameter;
|
|||||||
using android::audio_utils::channels::ChannelMix;
|
using android::audio_utils::channels::ChannelMix;
|
||||||
using android::hardware::audio::common::testing::detail::TestExecutionTracer;
|
using android::hardware::audio::common::testing::detail::TestExecutionTracer;
|
||||||
|
|
||||||
|
// minimal HAL interface version to run downmix data path test
|
||||||
|
constexpr int32_t kMinDataTestHalVersion = 2;
|
||||||
|
|
||||||
// Testing for enum values
|
// Testing for enum values
|
||||||
static const std::vector<Downmix::Type> kTypeValues = {ndk::enum_range<Downmix::Type>().begin(),
|
static const std::vector<Downmix::Type> kTypeValues = {ndk::enum_range<Downmix::Type>().begin(),
|
||||||
ndk::enum_range<Downmix::Type>().end()};
|
ndk::enum_range<Downmix::Type>().end()};
|
||||||
@@ -228,6 +231,10 @@ class DownmixFoldDataTest : public ::testing::TestWithParam<DownmixDataTestParam
|
|||||||
|
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
SetUpDownmix(mInputChannelLayout);
|
SetUpDownmix(mInputChannelLayout);
|
||||||
|
if (int32_t version;
|
||||||
|
mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
|
||||||
|
GTEST_SKIP() << "Skipping the data test for version: " << version << "\n";
|
||||||
|
}
|
||||||
if (!isLayoutValid(mInputChannelLayout)) {
|
if (!isLayoutValid(mInputChannelLayout)) {
|
||||||
GTEST_SKIP() << "Layout not supported \n";
|
GTEST_SKIP() << "Layout not supported \n";
|
||||||
}
|
}
|
||||||
@@ -375,6 +382,10 @@ class DownmixStripDataTest : public ::testing::TestWithParam<DownmixStripDataTes
|
|||||||
|
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
SetUpDownmix(mInputChannelLayout);
|
SetUpDownmix(mInputChannelLayout);
|
||||||
|
if (int32_t version;
|
||||||
|
mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
|
||||||
|
GTEST_SKIP() << "Skipping the data test for version: " << version << "\n";
|
||||||
|
}
|
||||||
if (!isLayoutValid(mInputChannelLayout)) {
|
if (!isLayoutValid(mInputChannelLayout)) {
|
||||||
GTEST_SKIP() << "Layout not supported \n";
|
GTEST_SKIP() << "Layout not supported \n";
|
||||||
}
|
}
|
||||||
@@ -418,7 +429,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
[](const testing::TestParamInfo<DownmixParamTest::ParamType>& info) {
|
[](const testing::TestParamInfo<DownmixParamTest::ParamType>& info) {
|
||||||
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
|
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
|
||||||
std::string type = std::to_string(static_cast<int>(std::get<PARAM_TYPE>(info.param)));
|
std::string type = std::to_string(static_cast<int>(std::get<PARAM_TYPE>(info.param)));
|
||||||
std::string name = getPrefix(descriptor) + "_type" + type;
|
std::string name = getPrefix(descriptor) + "_type_" + type;
|
||||||
std::replace_if(
|
std::replace_if(
|
||||||
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
|
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
|
||||||
return name;
|
return name;
|
||||||
@@ -434,7 +445,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
[](const testing::TestParamInfo<DownmixFoldDataTest::ParamType>& info) {
|
[](const testing::TestParamInfo<DownmixFoldDataTest::ParamType>& info) {
|
||||||
auto descriptor = std::get<FOLD_INSTANCE_NAME>(info.param).second;
|
auto descriptor = std::get<FOLD_INSTANCE_NAME>(info.param).second;
|
||||||
std::string layout = std::to_string(std::get<FOLD_INPUT_LAYOUT>(info.param));
|
std::string layout = std::to_string(std::get<FOLD_INPUT_LAYOUT>(info.param));
|
||||||
std::string name = getPrefix(descriptor) + "_fold" + "_layout" + layout;
|
std::string name = getPrefix(descriptor) + "_fold_layout_" + layout;
|
||||||
std::replace_if(
|
std::replace_if(
|
||||||
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
|
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
|
||||||
return name;
|
return name;
|
||||||
@@ -451,7 +462,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
auto descriptor = std::get<STRIP_INSTANCE_NAME>(info.param).second;
|
auto descriptor = std::get<STRIP_INSTANCE_NAME>(info.param).second;
|
||||||
std::string layout =
|
std::string layout =
|
||||||
std::to_string(static_cast<int>(std::get<STRIP_INPUT_LAYOUT>(info.param)));
|
std::to_string(static_cast<int>(std::get<STRIP_INPUT_LAYOUT>(info.param)));
|
||||||
std::string name = getPrefix(descriptor) + "_strip" + "_layout" + layout;
|
std::string name = getPrefix(descriptor) + "_strip_layout_" + layout;
|
||||||
std::replace_if(
|
std::replace_if(
|
||||||
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
|
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
|
||||||
return name;
|
return name;
|
||||||
|
|||||||
Reference in New Issue
Block a user