From 92cd748451f34639169d00ee13db078fad4ce350 Mon Sep 17 00:00:00 2001 From: Shunkai Yao Date: Mon, 18 Sep 2023 17:37:45 +0000 Subject: [PATCH] Effect AIDL: Skipping vts test case if its not supported by effect Check audioModeIndication/audioSourceIndication/volume flags and only test if they are supported Bug: 300735428 Test: atest VtsHalAudioEffectTargetTest Change-Id: I539b408fcdb73c25984ec8f39b401475a3ccab69 --- .../aidl/vts/VtsHalAudioEffectTargetTest.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp index 3011a5ed2c..aa61593dfa 100644 --- a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp +++ b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp @@ -504,6 +504,11 @@ TEST_P(AudioEffectTest, SetAndGetParameterAfterReset) { // Set and get AudioDeviceDescription in Parameter TEST_P(AudioEffectTest, SetAndGetParameterDeviceDescription) { + if (!mDescriptor.common.flags.deviceIndication) { + GTEST_SKIP() << "Skipping test as effect does not support deviceIndication" + << mDescriptor.common.flags.toString(); + } + ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor)); ASSERT_NO_FATAL_FAILURE(open(mEffect)); @@ -527,6 +532,11 @@ TEST_P(AudioEffectTest, SetAndGetParameterDeviceDescription) { // Set and get AudioMode in Parameter TEST_P(AudioEffectTest, SetAndGetParameterAudioMode) { + if (!mDescriptor.common.flags.audioModeIndication) { + GTEST_SKIP() << "Skipping test as effect does not support audioModeIndication" + << mDescriptor.common.flags.toString(); + } + ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor)); ASSERT_NO_FATAL_FAILURE(open(mEffect)); @@ -547,6 +557,11 @@ TEST_P(AudioEffectTest, SetAndGetParameterAudioMode) { // Set and get AudioSource in Parameter TEST_P(AudioEffectTest, SetAndGetParameterAudioSource) { + if (!mDescriptor.common.flags.audioSourceIndication) { + GTEST_SKIP() << "Skipping test as effect does not support audioSourceIndication" + << mDescriptor.common.flags.toString(); + } + ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor)); ASSERT_NO_FATAL_FAILURE(open(mEffect)); @@ -567,6 +582,11 @@ TEST_P(AudioEffectTest, SetAndGetParameterAudioSource) { // Set and get VolumeStereo in Parameter TEST_P(AudioEffectTest, SetAndGetParameterVolume) { + if (mDescriptor.common.flags.volume == Flags::Volume::NONE) { + GTEST_SKIP() << "Skipping test as effect does not support volume" + << mDescriptor.common.flags.toString(); + } + ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor)); ASSERT_NO_FATAL_FAILURE(open(mEffect));