mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-02 02:42:35 +00:00
Merge "vts: Don't excercise data path for offloaded/bypass effects" am: a2d5a26476 am: 7ab910076a am: 4ab418839e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2626523 Change-Id: I16cbaba8795b29aa94759fece7ed8ce178ec8ec2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -77,3 +77,10 @@ inline ::testing::AssertionResult assertResult(const char* exp_expr, const char*
|
|||||||
#define EXPECT_STATUS(expected, ret) \
|
#define EXPECT_STATUS(expected, ret) \
|
||||||
EXPECT_PRED_FORMAT2(::android::hardware::audio::common::testing::detail::assertResult, \
|
EXPECT_PRED_FORMAT2(::android::hardware::audio::common::testing::detail::assertResult, \
|
||||||
expected, ret)
|
expected, ret)
|
||||||
|
|
||||||
|
#define SKIP_TEST_IF_DATA_UNSUPPORTED(flags) \
|
||||||
|
({ \
|
||||||
|
if ((flags).hwAcceleratorMode == Flags::HardwareAccelerator::TUNNEL || (flags).bypass) { \
|
||||||
|
GTEST_SKIP() << "Skip data path for offload"; \
|
||||||
|
} \
|
||||||
|
})
|
||||||
@@ -46,6 +46,7 @@ using aidl::android::hardware::audio::effect::IEffect;
|
|||||||
using aidl::android::hardware::audio::effect::IFactory;
|
using aidl::android::hardware::audio::effect::IFactory;
|
||||||
using aidl::android::hardware::audio::effect::Parameter;
|
using aidl::android::hardware::audio::effect::Parameter;
|
||||||
using aidl::android::hardware::audio::effect::State;
|
using aidl::android::hardware::audio::effect::State;
|
||||||
|
using aidl::android::hardware::audio::effect::Flags;
|
||||||
using aidl::android::media::audio::common::AudioDeviceDescription;
|
using aidl::android::media::audio::common::AudioDeviceDescription;
|
||||||
using aidl::android::media::audio::common::AudioDeviceType;
|
using aidl::android::media::audio::common::AudioDeviceType;
|
||||||
using aidl::android::media::audio::common::AudioMode;
|
using aidl::android::media::audio::common::AudioMode;
|
||||||
@@ -85,6 +86,14 @@ class AudioEffectTest : public testing::TestWithParam<EffectTestParam>, public E
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class AudioEffectDataPathTest : public AudioEffectTest {
|
||||||
|
public:
|
||||||
|
void SetUp() override {
|
||||||
|
AudioEffectTest::SetUp();
|
||||||
|
SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
TEST_P(AudioEffectTest, SetupAndTearDown) {
|
TEST_P(AudioEffectTest, SetupAndTearDown) {
|
||||||
// Intentionally empty test body.
|
// Intentionally empty test body.
|
||||||
}
|
}
|
||||||
@@ -577,7 +586,8 @@ TEST_P(AudioEffectTest, SetAndGetParameterVolume) {
|
|||||||
|
|
||||||
/// Data processing test
|
/// Data processing test
|
||||||
// Send data to effects and expect it to be consumed by checking statusMQ.
|
// Send data to effects and expect it to be consumed by checking statusMQ.
|
||||||
TEST_P(AudioEffectTest, ConsumeDataInProcessingState) {
|
// Effects exposing bypass flags or operating in offload mode will be skipped.
|
||||||
|
TEST_P(AudioEffectDataPathTest, ConsumeDataInProcessingState) {
|
||||||
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
||||||
|
|
||||||
Parameter::Common common = EffectHelper::createParamCommon(
|
Parameter::Common common = EffectHelper::createParamCommon(
|
||||||
@@ -610,7 +620,8 @@ TEST_P(AudioEffectTest, ConsumeDataInProcessingState) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send data to effects and expect it to be consumed after effect restart.
|
// Send data to effects and expect it to be consumed after effect restart.
|
||||||
TEST_P(AudioEffectTest, ConsumeDataAfterRestart) {
|
// Effects exposing bypass flags or operating in offload mode will be skipped.
|
||||||
|
TEST_P(AudioEffectDataPathTest, ConsumeDataAfterRestart) {
|
||||||
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
||||||
|
|
||||||
Parameter::Common common = EffectHelper::createParamCommon(
|
Parameter::Common common = EffectHelper::createParamCommon(
|
||||||
@@ -649,7 +660,8 @@ TEST_P(AudioEffectTest, ConsumeDataAfterRestart) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send data to IDLE effects and expect it to be consumed after effect start.
|
// Send data to IDLE effects and expect it to be consumed after effect start.
|
||||||
TEST_P(AudioEffectTest, SendDataAtIdleAndConsumeDataInProcessing) {
|
// Effects exposing bypass flags or operating in offload mode will be skipped.
|
||||||
|
TEST_P(AudioEffectDataPathTest, SendDataAtIdleAndConsumeDataInProcessing) {
|
||||||
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
||||||
|
|
||||||
Parameter::Common common = EffectHelper::createParamCommon(
|
Parameter::Common common = EffectHelper::createParamCommon(
|
||||||
@@ -682,7 +694,8 @@ TEST_P(AudioEffectTest, SendDataAtIdleAndConsumeDataInProcessing) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send data multiple times.
|
// Send data multiple times.
|
||||||
TEST_P(AudioEffectTest, ProcessDataMultipleTimes) {
|
// Effects exposing bypass flags or operating in offload mode will be skipped.
|
||||||
|
TEST_P(AudioEffectDataPathTest, ProcessDataMultipleTimes) {
|
||||||
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
||||||
|
|
||||||
Parameter::Common common = EffectHelper::createParamCommon(
|
Parameter::Common common = EffectHelper::createParamCommon(
|
||||||
@@ -721,7 +734,8 @@ TEST_P(AudioEffectTest, ProcessDataMultipleTimes) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send data to processing state effects, stop, and restart.
|
// Send data to processing state effects, stop, and restart.
|
||||||
TEST_P(AudioEffectTest, ConsumeDataAndRestart) {
|
// Effects exposing bypass flags or operating in offload mode will be skipped.
|
||||||
|
TEST_P(AudioEffectDataPathTest, ConsumeDataAndRestart) {
|
||||||
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
||||||
|
|
||||||
Parameter::Common common = EffectHelper::createParamCommon(
|
Parameter::Common common = EffectHelper::createParamCommon(
|
||||||
@@ -762,7 +776,8 @@ TEST_P(AudioEffectTest, ConsumeDataAndRestart) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send data to closed effects and expect it not be consumed.
|
// Send data to closed effects and expect it not be consumed.
|
||||||
TEST_P(AudioEffectTest, NotConsumeDataByClosedEffect) {
|
// Effects exposing bypass flags or operating in offload mode will be skipped.
|
||||||
|
TEST_P(AudioEffectDataPathTest, NotConsumeDataByClosedEffect) {
|
||||||
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
|
||||||
|
|
||||||
Parameter::Common common = EffectHelper::createParamCommon(
|
Parameter::Common common = EffectHelper::createParamCommon(
|
||||||
@@ -788,7 +803,8 @@ TEST_P(AudioEffectTest, NotConsumeDataByClosedEffect) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Send data to multiple effects.
|
// Send data to multiple effects.
|
||||||
TEST_P(AudioEffectTest, ConsumeDataMultipleEffects) {
|
// Effects exposing bypass flags or operating in offload mode will be skipped.
|
||||||
|
TEST_P(AudioEffectDataPathTest, ConsumeDataMultipleEffects) {
|
||||||
std::shared_ptr<IEffect> effect1, effect2;
|
std::shared_ptr<IEffect> effect1, effect2;
|
||||||
ASSERT_NO_FATAL_FAILURE(create(mFactory, effect1, mDescriptor));
|
ASSERT_NO_FATAL_FAILURE(create(mFactory, effect1, mDescriptor));
|
||||||
ASSERT_NO_FATAL_FAILURE(create(mFactory, effect2, mDescriptor));
|
ASSERT_NO_FATAL_FAILURE(create(mFactory, effect2, mDescriptor));
|
||||||
@@ -855,6 +871,20 @@ INSTANTIATE_TEST_SUITE_P(
|
|||||||
});
|
});
|
||||||
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AudioEffectTest);
|
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AudioEffectTest);
|
||||||
|
|
||||||
|
INSTANTIATE_TEST_SUITE_P(
|
||||||
|
SingleEffectInstanceTest, AudioEffectDataPathTest,
|
||||||
|
::testing::Combine(testing::ValuesIn(
|
||||||
|
EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor))),
|
||||||
|
[](const testing::TestParamInfo<AudioEffectDataPathTest::ParamType>& info) {
|
||||||
|
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
|
||||||
|
std::string name = getPrefix(descriptor);
|
||||||
|
std::replace_if(
|
||||||
|
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
|
||||||
|
return name;
|
||||||
|
});
|
||||||
|
|
||||||
|
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(AudioEffectDataPathTest);
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
::testing::InitGoogleTest(&argc, argv);
|
||||||
ABinderProcess_setThreadPoolMaxThreadCount(1);
|
ABinderProcess_setThreadPoolMaxThreadCount(1);
|
||||||
|
|||||||
Reference in New Issue
Block a user