Merge "[vts-core] add VtsHalAudioEffectV*_0TargetTest to vts-core" am: 4472878a42
am: 96dd61d29b
Change-Id: I8841dfe4b46102173e64755dfe36b09e32af6ee5
This commit is contained in:
commit
e876443913
10 changed files with 243 additions and 97 deletions
8
audio/effect/2.0/xml/Android.bp
Normal file
8
audio/effect/2.0/xml/Android.bp
Normal file
|
@ -0,0 +1,8 @@
|
|||
genrule {
|
||||
name: "audio_effects_conf_V2_0",
|
||||
srcs: ["audio_effects_conf.xsd"],
|
||||
out: [
|
||||
"audio_effects_conf_V2_0.xsd",
|
||||
],
|
||||
cmd: "cp -f $(in) $(genDir)/audio_effects_conf_V2_0.xsd",
|
||||
}
|
8
audio/effect/4.0/xml/Android.bp
Normal file
8
audio/effect/4.0/xml/Android.bp
Normal file
|
@ -0,0 +1,8 @@
|
|||
genrule {
|
||||
name: "audio_effects_conf_V4_0",
|
||||
srcs: ["audio_effects_conf.xsd"],
|
||||
out: [
|
||||
"audio_effects_conf_V4_0.xsd",
|
||||
],
|
||||
cmd: "cp -f $(in) $(genDir)/audio_effects_conf_V4_0.xsd",
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
xsd_config {
|
||||
name: "audio_effects_conf_V5_0",
|
||||
srcs: ["audio_effects_conf.xsd"],
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
xsd_config {
|
||||
name: "audio_effects_conf_V6_0",
|
||||
srcs: ["audio_effects_conf.xsd"],
|
||||
|
|
|
@ -31,16 +31,22 @@ cc_defaults {
|
|||
header_libs: [
|
||||
"android.hardware.audio.common.util@all-versions",
|
||||
],
|
||||
test_suites: ["general-tests"],
|
||||
test_suites: ["general-tests", "vts-core"],
|
||||
}
|
||||
|
||||
cc_test {
|
||||
name: "VtsHalAudioEffectV2_0TargetTest",
|
||||
defaults: ["VtsHalAudioEffectTargetTest_default"],
|
||||
// Use test_config for vts-core suite.
|
||||
// TODO(b/146104851): Add auto-gen rules and remove it.
|
||||
test_config: "VtsHalAudioEffectV2_0TargetTest.xml",
|
||||
static_libs: [
|
||||
"android.hardware.audio.common@2.0",
|
||||
"android.hardware.audio.effect@2.0",
|
||||
],
|
||||
data: [
|
||||
":audio_effects_conf_V2_0",
|
||||
],
|
||||
cflags: [
|
||||
"-DMAJOR_VERSION=2",
|
||||
"-DMINOR_VERSION=0",
|
||||
|
@ -51,10 +57,16 @@ cc_test {
|
|||
cc_test {
|
||||
name: "VtsHalAudioEffectV4_0TargetTest",
|
||||
defaults: ["VtsHalAudioEffectTargetTest_default"],
|
||||
// Use test_config for vts-core suite.
|
||||
// TODO(b/146104851): Add auto-gen rules and remove it.
|
||||
test_config: "VtsHalAudioEffectV4_0TargetTest.xml",
|
||||
static_libs: [
|
||||
"android.hardware.audio.common@4.0",
|
||||
"android.hardware.audio.effect@4.0",
|
||||
],
|
||||
data: [
|
||||
":audio_effects_conf_V4_0",
|
||||
],
|
||||
cflags: [
|
||||
"-DMAJOR_VERSION=4",
|
||||
"-DMINOR_VERSION=0",
|
||||
|
@ -65,10 +77,16 @@ cc_test {
|
|||
cc_test {
|
||||
name: "VtsHalAudioEffectV5_0TargetTest",
|
||||
defaults: ["VtsHalAudioEffectTargetTest_default"],
|
||||
// Use test_config for vts-core suite.
|
||||
// TODO(b/146104851): Add auto-gen rules and remove it.
|
||||
test_config: "VtsHalAudioEffectV5_0TargetTest.xml",
|
||||
static_libs: [
|
||||
"android.hardware.audio.common@5.0",
|
||||
"android.hardware.audio.effect@5.0",
|
||||
],
|
||||
data: [
|
||||
":audio_effects_conf_V5_0",
|
||||
],
|
||||
cflags: [
|
||||
"-DMAJOR_VERSION=5",
|
||||
"-DMINOR_VERSION=0",
|
||||
|
@ -79,10 +97,16 @@ cc_test {
|
|||
cc_test {
|
||||
name: "VtsHalAudioEffectV6_0TargetTest",
|
||||
defaults: ["VtsHalAudioEffectTargetTest_default"],
|
||||
// Use test_config for vts-core suite.
|
||||
// TODO(b/146104851): Add auto-gen rules and remove it.
|
||||
test_config: "VtsHalAudioEffectV6_0TargetTest.xml",
|
||||
static_libs: [
|
||||
"android.hardware.audio.common@6.0",
|
||||
"android.hardware.audio.effect@6.0",
|
||||
],
|
||||
data: [
|
||||
":audio_effects_conf_V6_0",
|
||||
],
|
||||
cflags: [
|
||||
"-DMAJOR_VERSION=6",
|
||||
"-DMINOR_VERSION=0",
|
||||
|
|
|
@ -28,14 +28,9 @@
|
|||
|
||||
#include <common/all-versions/VersionUtils.h>
|
||||
|
||||
#if MAJOR_VERSION <= 5
|
||||
#include <VtsHalHidlTargetTestBase.h>
|
||||
#include <VtsHalHidlTargetTestEnvBase.h>
|
||||
#elif MAJOR_VERSION >= 6
|
||||
#include <gtest/gtest.h>
|
||||
#include <hidl/GtestPrinter.h>
|
||||
#include <hidl/ServiceManagement.h>
|
||||
#endif
|
||||
|
||||
using ::android::sp;
|
||||
using ::android::hardware::hidl_handle;
|
||||
|
@ -55,45 +50,12 @@ using namespace ::android::hardware::audio::effect::CPP_VERSION;
|
|||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
|
||||
#endif
|
||||
|
||||
#if MAJOR_VERSION <= 5
|
||||
// For HAL versions 2..5 Vts Environment and Test base classes are used.
|
||||
// The tests are non-parametrized.
|
||||
#define EFFECT_TEST TEST_F
|
||||
|
||||
// Test environment for Audio Effects Factory HIDL HAL.
|
||||
class AudioEffectsFactoryHidlEnvironment : public ::testing::VtsHalHidlTargetTestEnvBase {
|
||||
public:
|
||||
// get the test environment singleton
|
||||
static AudioEffectsFactoryHidlEnvironment* Instance() {
|
||||
static AudioEffectsFactoryHidlEnvironment* instance =
|
||||
new AudioEffectsFactoryHidlEnvironment;
|
||||
return instance;
|
||||
}
|
||||
|
||||
virtual void registerTestServices() override { registerTestService<IEffectsFactory>(); }
|
||||
};
|
||||
|
||||
// The main test class for Audio Effects Factory HIDL HAL.
|
||||
class AudioEffectsFactoryHidlTest : public ::testing::VtsHalHidlTargetTestBase {
|
||||
public:
|
||||
void SetUp() override {
|
||||
effectsFactory = ::testing::VtsHalHidlTargetTestBase::getService<IEffectsFactory>(
|
||||
AudioEffectsFactoryHidlEnvironment::Instance()->getServiceName<IEffectsFactory>());
|
||||
ASSERT_NE(effectsFactory, nullptr);
|
||||
}
|
||||
|
||||
#elif MAJOR_VERSION >= 6
|
||||
// For HAL version 6 and above, standard GTest Environment and Test base classes are used.
|
||||
// The tests are parametrized by the IEffectsFactory instance name.
|
||||
#define EFFECT_TEST TEST_P
|
||||
|
||||
class AudioEffectsFactoryHidlTest : public ::testing::TestWithParam<std::string> {
|
||||
public:
|
||||
void SetUp() override {
|
||||
effectsFactory = IEffectsFactory::getService(GetParam());
|
||||
ASSERT_NE(effectsFactory, nullptr);
|
||||
}
|
||||
#endif // The rest of the AudioEffectsFactoryHidlTest class definition is the same.
|
||||
void TearDown() override { effectsFactory.clear(); }
|
||||
|
||||
protected:
|
||||
|
@ -104,7 +66,7 @@ class AudioEffectsFactoryHidlTest : public ::testing::TestWithParam<std::string>
|
|||
sp<IEffectsFactory> effectsFactory;
|
||||
};
|
||||
|
||||
EFFECT_TEST(AudioEffectsFactoryHidlTest, EnumerateEffects) {
|
||||
TEST_P(AudioEffectsFactoryHidlTest, EnumerateEffects) {
|
||||
description("Verify that EnumerateEffects returns at least one effect");
|
||||
Result retval = Result::NOT_INITIALIZED;
|
||||
size_t effectCount = 0;
|
||||
|
@ -118,7 +80,7 @@ EFFECT_TEST(AudioEffectsFactoryHidlTest, EnumerateEffects) {
|
|||
EXPECT_GT(effectCount, 0u);
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectsFactoryHidlTest, CreateEffect) {
|
||||
TEST_P(AudioEffectsFactoryHidlTest, CreateEffect) {
|
||||
description("Verify that an effect can be created via CreateEffect");
|
||||
bool gotEffect = false;
|
||||
Uuid effectUuid;
|
||||
|
@ -146,7 +108,7 @@ EFFECT_TEST(AudioEffectsFactoryHidlTest, CreateEffect) {
|
|||
EXPECT_NE(nullptr, effect.get());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectsFactoryHidlTest, GetDescriptor) {
|
||||
TEST_P(AudioEffectsFactoryHidlTest, GetDescriptor) {
|
||||
description(
|
||||
"Verify that effects factory can provide an effect descriptor via "
|
||||
"GetDescriptor");
|
||||
|
@ -169,7 +131,7 @@ EFFECT_TEST(AudioEffectsFactoryHidlTest, GetDescriptor) {
|
|||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectsFactoryHidlTest, DebugDumpInvalidArgument) {
|
||||
TEST_P(AudioEffectsFactoryHidlTest, DebugDumpInvalidArgument) {
|
||||
description("Verify that debugDump doesn't crash on invalid arguments");
|
||||
#if MAJOR_VERSION == 2
|
||||
Return<void> ret = effectsFactory->debugDump(hidl_handle());
|
||||
|
@ -191,17 +153,10 @@ static const Uuid LOUDNESS_ENHANCER_EFFECT_TYPE = {
|
|||
std::array<uint8_t, 6>{{0x11, 0x26, 0x0e, 0xb6, 0x3c, 0xf1}}};
|
||||
|
||||
// The main test class for Audio Effect HIDL HAL.
|
||||
#if MAJOR_VERSION <= 5
|
||||
class AudioEffectHidlTest : public ::testing::VtsHalHidlTargetTestBase {
|
||||
public:
|
||||
void SetUp() override {
|
||||
effectsFactory = ::testing::VtsHalHidlTargetTestBase::getService<IEffectsFactory>();
|
||||
#elif MAJOR_VERSION >= 6
|
||||
class AudioEffectHidlTest : public ::testing::TestWithParam<std::string> {
|
||||
public:
|
||||
void SetUp() override {
|
||||
effectsFactory = IEffectsFactory::getService(GetParam());
|
||||
#endif
|
||||
ASSERT_NE(nullptr, effectsFactory.get());
|
||||
|
||||
findAndCreateEffect(getEffectType());
|
||||
|
@ -280,14 +235,14 @@ void AudioEffectHidlTest::getChannelCount(uint32_t* channelCount) {
|
|||
static_cast<audio_channel_mask_t>(currentConfig.outputCfg.channels));
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, Close) {
|
||||
TEST_P(AudioEffectHidlTest, Close) {
|
||||
description("Verify that an effect can be closed");
|
||||
Return<Result> ret = effect->close();
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
EXPECT_EQ(Result::OK, ret);
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, GetDescriptor) {
|
||||
TEST_P(AudioEffectHidlTest, GetDescriptor) {
|
||||
description("Verify that an effect can return its own descriptor via GetDescriptor");
|
||||
Result retval = Result::NOT_INITIALIZED;
|
||||
Uuid actualType;
|
||||
|
@ -302,7 +257,7 @@ EFFECT_TEST(AudioEffectHidlTest, GetDescriptor) {
|
|||
EXPECT_EQ(getEffectType(), actualType);
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, GetSetConfig) {
|
||||
TEST_P(AudioEffectHidlTest, GetSetConfig) {
|
||||
description(
|
||||
"Verify that it is possible to manipulate effect config via Get / "
|
||||
"SetConfig");
|
||||
|
@ -321,26 +276,26 @@ EFFECT_TEST(AudioEffectHidlTest, GetSetConfig) {
|
|||
EXPECT_EQ(Result::OK, ret2);
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, GetConfigReverse) {
|
||||
TEST_P(AudioEffectHidlTest, GetConfigReverse) {
|
||||
description("Verify that GetConfigReverse does not crash");
|
||||
Return<void> ret = effect->getConfigReverse([&](Result, const EffectConfig&) {});
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, GetSupportedAuxChannelsConfigs) {
|
||||
TEST_P(AudioEffectHidlTest, GetSupportedAuxChannelsConfigs) {
|
||||
description("Verify that GetSupportedAuxChannelsConfigs does not crash");
|
||||
Return<void> ret = effect->getSupportedAuxChannelsConfigs(
|
||||
0, [&](Result, const hidl_vec<EffectAuxChannelsConfig>&) {});
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, GetAuxChannelsConfig) {
|
||||
TEST_P(AudioEffectHidlTest, GetAuxChannelsConfig) {
|
||||
description("Verify that GetAuxChannelsConfig does not crash");
|
||||
Return<void> ret = effect->getAuxChannelsConfig([&](Result, const EffectAuxChannelsConfig&) {});
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, SetAuxChannelsConfig) {
|
||||
TEST_P(AudioEffectHidlTest, SetAuxChannelsConfig) {
|
||||
description("Verify that SetAuxChannelsConfig does not crash");
|
||||
Return<Result> ret = effect->setAuxChannelsConfig(EffectAuxChannelsConfig());
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
|
@ -379,7 +334,7 @@ inline bool operator==(const EffectConfig& lhs, const EffectConfig& rhs) {
|
|||
} // namespace hardware
|
||||
} // namespace android
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, Reset) {
|
||||
TEST_P(AudioEffectHidlTest, Reset) {
|
||||
description("Verify that Reset preserves effect configuration");
|
||||
Result retval = Result::NOT_INITIALIZED;
|
||||
EffectConfig originalConfig;
|
||||
|
@ -404,7 +359,7 @@ EFFECT_TEST(AudioEffectHidlTest, Reset) {
|
|||
EXPECT_EQ(originalConfig, configAfterReset);
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, DisableEnableDisable) {
|
||||
TEST_P(AudioEffectHidlTest, DisableEnableDisable) {
|
||||
description("Verify Disable -> Enable -> Disable sequence for an effect");
|
||||
Return<Result> ret = effect->disable();
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
|
@ -417,14 +372,14 @@ EFFECT_TEST(AudioEffectHidlTest, DisableEnableDisable) {
|
|||
EXPECT_EQ(Result::OK, ret);
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, SetDevice) {
|
||||
TEST_P(AudioEffectHidlTest, SetDevice) {
|
||||
description("Verify that SetDevice works for an output chain effect");
|
||||
Return<Result> ret = effect->setDevice(mkEnumBitfield(AudioDevice::OUT_SPEAKER));
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
EXPECT_EQ(Result::OK, ret);
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, SetAndGetVolume) {
|
||||
TEST_P(AudioEffectHidlTest, SetAndGetVolume) {
|
||||
description("Verify that SetAndGetVolume method works for an effect");
|
||||
uint32_t channelCount;
|
||||
getChannelCount(&channelCount);
|
||||
|
@ -440,7 +395,7 @@ EFFECT_TEST(AudioEffectHidlTest, SetAndGetVolume) {
|
|||
EXPECT_EQ(Result::OK, retval);
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, VolumeChangeNotification) {
|
||||
TEST_P(AudioEffectHidlTest, VolumeChangeNotification) {
|
||||
description("Verify that effect accepts VolumeChangeNotification");
|
||||
uint32_t channelCount;
|
||||
getChannelCount(&channelCount);
|
||||
|
@ -454,32 +409,32 @@ EFFECT_TEST(AudioEffectHidlTest, VolumeChangeNotification) {
|
|||
EXPECT_EQ(Result::OK, ret);
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, SetAudioMode) {
|
||||
TEST_P(AudioEffectHidlTest, SetAudioMode) {
|
||||
description("Verify that SetAudioMode works for an effect");
|
||||
Return<Result> ret = effect->setAudioMode(AudioMode::NORMAL);
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
EXPECT_EQ(Result::OK, ret);
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, SetConfigReverse) {
|
||||
TEST_P(AudioEffectHidlTest, SetConfigReverse) {
|
||||
description("Verify that SetConfigReverse does not crash");
|
||||
Return<Result> ret = effect->setConfigReverse(EffectConfig(), nullptr, nullptr);
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, SetInputDevice) {
|
||||
TEST_P(AudioEffectHidlTest, SetInputDevice) {
|
||||
description("Verify that SetInputDevice does not crash");
|
||||
Return<Result> ret = effect->setInputDevice(mkEnumBitfield(AudioDevice::IN_BUILTIN_MIC));
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, SetAudioSource) {
|
||||
TEST_P(AudioEffectHidlTest, SetAudioSource) {
|
||||
description("Verify that SetAudioSource does not crash");
|
||||
Return<Result> ret = effect->setAudioSource(AudioSource::MIC);
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, Offload) {
|
||||
TEST_P(AudioEffectHidlTest, Offload) {
|
||||
description("Verify that calling Offload method does not crash");
|
||||
EffectOffloadParameter offloadParam;
|
||||
offloadParam.isOffload = false;
|
||||
|
@ -488,7 +443,7 @@ EFFECT_TEST(AudioEffectHidlTest, Offload) {
|
|||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, PrepareForProcessing) {
|
||||
TEST_P(AudioEffectHidlTest, PrepareForProcessing) {
|
||||
description("Verify that PrepareForProcessing method works for an effect");
|
||||
Result retval = Result::NOT_INITIALIZED;
|
||||
Return<void> ret = effect->prepareForProcessing(
|
||||
|
@ -497,7 +452,7 @@ EFFECT_TEST(AudioEffectHidlTest, PrepareForProcessing) {
|
|||
EXPECT_EQ(Result::OK, retval);
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, SetProcessBuffers) {
|
||||
TEST_P(AudioEffectHidlTest, SetProcessBuffers) {
|
||||
description("Verify that SetProcessBuffers works for an effect");
|
||||
sp<IAllocator> ashmem = IAllocator::getService("ashmem");
|
||||
ASSERT_NE(nullptr, ashmem.get());
|
||||
|
@ -516,41 +471,41 @@ EFFECT_TEST(AudioEffectHidlTest, SetProcessBuffers) {
|
|||
EXPECT_EQ(Result::OK, ret2);
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, Command) {
|
||||
TEST_P(AudioEffectHidlTest, Command) {
|
||||
description("Verify that Command does not crash");
|
||||
Return<void> ret =
|
||||
effect->command(0, hidl_vec<uint8_t>(), 0, [&](int32_t, const hidl_vec<uint8_t>&) {});
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, SetParameter) {
|
||||
TEST_P(AudioEffectHidlTest, SetParameter) {
|
||||
description("Verify that SetParameter does not crash");
|
||||
Return<Result> ret = effect->setParameter(hidl_vec<uint8_t>(), hidl_vec<uint8_t>());
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, GetParameter) {
|
||||
TEST_P(AudioEffectHidlTest, GetParameter) {
|
||||
description("Verify that GetParameter does not crash");
|
||||
Return<void> ret =
|
||||
effect->getParameter(hidl_vec<uint8_t>(), 0, [&](Result, const hidl_vec<uint8_t>&) {});
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, GetSupportedConfigsForFeature) {
|
||||
TEST_P(AudioEffectHidlTest, GetSupportedConfigsForFeature) {
|
||||
description("Verify that GetSupportedConfigsForFeature does not crash");
|
||||
Return<void> ret = effect->getSupportedConfigsForFeature(
|
||||
0, 0, 0, [&](Result, uint32_t, const hidl_vec<uint8_t>&) {});
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, GetCurrentConfigForFeature) {
|
||||
TEST_P(AudioEffectHidlTest, GetCurrentConfigForFeature) {
|
||||
description("Verify that GetCurrentConfigForFeature does not crash");
|
||||
Return<void> ret =
|
||||
effect->getCurrentConfigForFeature(0, 0, [&](Result, const hidl_vec<uint8_t>&) {});
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
}
|
||||
|
||||
EFFECT_TEST(AudioEffectHidlTest, SetCurrentConfigForFeature) {
|
||||
TEST_P(AudioEffectHidlTest, SetCurrentConfigForFeature) {
|
||||
description("Verify that SetCurrentConfigForFeature does not crash");
|
||||
Return<Result> ret = effect->setCurrentConfigForFeature(0, hidl_vec<uint8_t>());
|
||||
EXPECT_TRUE(ret.isOk());
|
||||
|
@ -636,21 +591,21 @@ void EqualizerAudioEffectHidlTest::getPresetCount(size_t* count) {
|
|||
ASSERT_EQ(Result::OK, retval);
|
||||
}
|
||||
|
||||
EFFECT_TEST(EqualizerAudioEffectHidlTest, GetNumBands) {
|
||||
TEST_P(EqualizerAudioEffectHidlTest, GetNumBands) {
|
||||
description("Verify that Equalizer effect reports at least one band");
|
||||
uint16_t numBands = 0;
|
||||
getNumBands(&numBands);
|
||||
EXPECT_GT(numBands, 0);
|
||||
}
|
||||
|
||||
EFFECT_TEST(EqualizerAudioEffectHidlTest, GetLevelRange) {
|
||||
TEST_P(EqualizerAudioEffectHidlTest, GetLevelRange) {
|
||||
description("Verify that Equalizer effect reports adequate band level range");
|
||||
int16_t minLevel = 0x7fff, maxLevel = 0;
|
||||
getLevelRange(&minLevel, &maxLevel);
|
||||
EXPECT_GT(maxLevel, minLevel);
|
||||
}
|
||||
|
||||
EFFECT_TEST(EqualizerAudioEffectHidlTest, GetSetBandLevel) {
|
||||
TEST_P(EqualizerAudioEffectHidlTest, GetSetBandLevel) {
|
||||
description("Verify that manipulating band levels works for Equalizer effect");
|
||||
uint16_t numBands = 0;
|
||||
getNumBands(&numBands);
|
||||
|
@ -679,7 +634,7 @@ EFFECT_TEST(EqualizerAudioEffectHidlTest, GetSetBandLevel) {
|
|||
}
|
||||
}
|
||||
|
||||
EFFECT_TEST(EqualizerAudioEffectHidlTest, GetBandCenterFrequencyAndRange) {
|
||||
TEST_P(EqualizerAudioEffectHidlTest, GetBandCenterFrequencyAndRange) {
|
||||
description("Verify that Equalizer effect reports adequate band frequency range");
|
||||
uint16_t numBands = 0;
|
||||
getNumBands(&numBands);
|
||||
|
@ -694,7 +649,7 @@ EFFECT_TEST(EqualizerAudioEffectHidlTest, GetBandCenterFrequencyAndRange) {
|
|||
}
|
||||
}
|
||||
|
||||
EFFECT_TEST(EqualizerAudioEffectHidlTest, GetBandForFrequency) {
|
||||
TEST_P(EqualizerAudioEffectHidlTest, GetBandForFrequency) {
|
||||
description("Verify that Equalizer effect supports GetBandForFrequency correctly");
|
||||
uint16_t numBands = 0;
|
||||
getNumBands(&numBands);
|
||||
|
@ -723,14 +678,14 @@ EFFECT_TEST(EqualizerAudioEffectHidlTest, GetBandForFrequency) {
|
|||
}
|
||||
}
|
||||
|
||||
EFFECT_TEST(EqualizerAudioEffectHidlTest, GetPresetNames) {
|
||||
TEST_P(EqualizerAudioEffectHidlTest, GetPresetNames) {
|
||||
description("Verify that Equalizer effect reports at least one preset");
|
||||
size_t presetCount;
|
||||
getPresetCount(&presetCount);
|
||||
EXPECT_GT(presetCount, 0u);
|
||||
}
|
||||
|
||||
EFFECT_TEST(EqualizerAudioEffectHidlTest, GetSetCurrentPreset) {
|
||||
TEST_P(EqualizerAudioEffectHidlTest, GetSetCurrentPreset) {
|
||||
description("Verify that manipulating the current preset for Equalizer effect");
|
||||
size_t presetCount;
|
||||
getPresetCount(&presetCount);
|
||||
|
@ -753,7 +708,7 @@ EFFECT_TEST(EqualizerAudioEffectHidlTest, GetSetCurrentPreset) {
|
|||
}
|
||||
}
|
||||
|
||||
EFFECT_TEST(EqualizerAudioEffectHidlTest, GetSetAllProperties) {
|
||||
TEST_P(EqualizerAudioEffectHidlTest, GetSetAllProperties) {
|
||||
description(
|
||||
"Verify that setting band levels and presets works via Get / "
|
||||
"SetAllProperties for Equalizer effect");
|
||||
|
@ -817,7 +772,7 @@ class LoudnessEnhancerAudioEffectHidlTest : public AudioEffectHidlTest {
|
|||
sp<ILoudnessEnhancerEffect> enhancer;
|
||||
};
|
||||
|
||||
EFFECT_TEST(LoudnessEnhancerAudioEffectHidlTest, GetSetTargetGain) {
|
||||
TEST_P(LoudnessEnhancerAudioEffectHidlTest, GetSetTargetGain) {
|
||||
description(
|
||||
"Verify that manipulating the target gain works for Loudness Enhancer "
|
||||
"effect");
|
||||
|
@ -838,20 +793,14 @@ EFFECT_TEST(LoudnessEnhancerAudioEffectHidlTest, GetSetTargetGain) {
|
|||
EXPECT_EQ(gain, actualGain);
|
||||
}
|
||||
|
||||
#if MAJOR_VERSION <= 5
|
||||
int main(int argc, char** argv) {
|
||||
::testing::AddGlobalTestEnvironment(AudioEffectsFactoryHidlEnvironment::Instance());
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
AudioEffectsFactoryHidlEnvironment::Instance()->init(&argc, argv);
|
||||
int status = RUN_ALL_TESTS();
|
||||
LOG(INFO) << "Test result = " << status;
|
||||
return status;
|
||||
}
|
||||
#elif MAJOR_VERSION >= 6
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
EffectsFactory, AudioEffectsFactoryHidlTest,
|
||||
testing::ValuesIn(android::hardware::getAllHalInstanceNames(IEffectsFactory::descriptor)),
|
||||
android::hardware::PrintInstanceNameToString);
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Equalizer, AudioEffectHidlTest,
|
||||
testing::ValuesIn(android::hardware::getAllHalInstanceNames(IEffectsFactory::descriptor)),
|
||||
android::hardware::PrintInstanceNameToString);
|
||||
INSTANTIATE_TEST_SUITE_P(
|
||||
Equalizer, EqualizerAudioEffectHidlTest,
|
||||
testing::ValuesIn(android::hardware::getAllHalInstanceNames(IEffectsFactory::descriptor)),
|
||||
|
@ -860,4 +809,3 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
LoudnessEnhancer, LoudnessEnhancerAudioEffectHidlTest,
|
||||
testing::ValuesIn(android::hardware::getAllHalInstanceNames(IEffectsFactory::descriptor)),
|
||||
android::hardware::PrintInstanceNameToString);
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2019 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<configuration description="Runs VtsHalAudioEffectV2_0TargetTest.">
|
||||
<option name="test-suite-tag" value="apct" />
|
||||
<option name="test-suite-tag" value="apct-native" />
|
||||
|
||||
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
|
||||
</target_preparer>
|
||||
|
||||
<target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
|
||||
<option name="run-command" value="stop"/>
|
||||
<option name="run-command" value="setprop vts.native_server.on 1"/>
|
||||
<option name="teardown-command" value="start"/>
|
||||
<option name="teardown-command" value="setprop vts.native_server.on 0"/>
|
||||
</target_preparer>
|
||||
|
||||
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
|
||||
<option name="cleanup" value="true" />
|
||||
<option name="push" value="VtsHalAudioEffectV2_0TargetTest->/data/local/tmp/VtsHalAudioEffectV2_0TargetTest" />
|
||||
<option name="push" value="audio_effects_conf_V2_0.xsd->/data/local/tmp/audio_effects_conf_V2_0.xsd" />
|
||||
</target_preparer>
|
||||
|
||||
<test class="com.android.tradefed.testtype.GTest" >
|
||||
<option name="native-test-device-path" value="/data/local/tmp" />
|
||||
<option name="module-name" value="VtsHalAudioEffectV2_0TargetTest" />
|
||||
</test>
|
||||
</configuration>
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2019 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<configuration description="Runs VtsHalAudioEffectV4_0TargetTest.">
|
||||
<option name="test-suite-tag" value="apct" />
|
||||
<option name="test-suite-tag" value="apct-native" />
|
||||
|
||||
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
|
||||
</target_preparer>
|
||||
|
||||
<target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
|
||||
<option name="run-command" value="stop"/>
|
||||
<option name="run-command" value="setprop vts.native_server.on 1"/>
|
||||
<option name="teardown-command" value="start"/>
|
||||
<option name="teardown-command" value="setprop vts.native_server.on 0"/>
|
||||
</target_preparer>
|
||||
|
||||
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
|
||||
<option name="cleanup" value="true" />
|
||||
<option name="push" value="VtsHalAudioEffectV4_0TargetTest->/data/local/tmp/VtsHalAudioEffectV4_0TargetTest" />
|
||||
<option name="push" value="audio_effects_conf_V4_0.xsd->/data/local/tmp/audio_effects_conf_V4_0.xsd" />
|
||||
</target_preparer>
|
||||
|
||||
<test class="com.android.tradefed.testtype.GTest" >
|
||||
<option name="native-test-device-path" value="/data/local/tmp" />
|
||||
<option name="module-name" value="VtsHalAudioEffectV4_0TargetTest" />
|
||||
</test>
|
||||
</configuration>
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2019 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<configuration description="Runs VtsHalAudioEffectV5_0TargetTest.">
|
||||
<option name="test-suite-tag" value="apct" />
|
||||
<option name="test-suite-tag" value="apct-native" />
|
||||
|
||||
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
|
||||
</target_preparer>
|
||||
|
||||
<target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
|
||||
<option name="run-command" value="stop"/>
|
||||
<option name="run-command" value="setprop vts.native_server.on 1"/>
|
||||
<option name="teardown-command" value="start"/>
|
||||
<option name="teardown-command" value="setprop vts.native_server.on 0"/>
|
||||
</target_preparer>
|
||||
|
||||
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
|
||||
<option name="cleanup" value="true" />
|
||||
<option name="push" value="VtsHalAudioEffectV5_0TargetTest->/data/local/tmp/VtsHalAudioEffectV5_0TargetTest" />
|
||||
<option name="push" value="audio_effects_conf_V5_0.xsd->/data/local/tmp/audio_effects_conf_V5_0.xsd" />
|
||||
</target_preparer>
|
||||
|
||||
<test class="com.android.tradefed.testtype.GTest" >
|
||||
<option name="native-test-device-path" value="/data/local/tmp" />
|
||||
<option name="module-name" value="VtsHalAudioEffectV5_0TargetTest" />
|
||||
</test>
|
||||
</configuration>
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright (C) 2019 The Android Open Source Project
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<configuration description="Runs VtsHalAudioEffectV6_0TargetTest.">
|
||||
<option name="test-suite-tag" value="apct" />
|
||||
<option name="test-suite-tag" value="apct-native" />
|
||||
|
||||
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
|
||||
</target_preparer>
|
||||
|
||||
<target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
|
||||
<option name="run-command" value="stop"/>
|
||||
<option name="run-command" value="setprop vts.native_server.on 1"/>
|
||||
<option name="teardown-command" value="start"/>
|
||||
<option name="teardown-command" value="setprop vts.native_server.on 0"/>
|
||||
</target_preparer>
|
||||
|
||||
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
|
||||
<option name="cleanup" value="true" />
|
||||
<option name="push" value="VtsHalAudioEffectV6_0TargetTest->/data/local/tmp/VtsHalAudioEffectV6_0TargetTest" />
|
||||
<option name="push" value="audio_effects_conf_V6_0.xsd->/data/local/tmp/audio_effects_conf_V6_0.xsd" />
|
||||
</target_preparer>
|
||||
|
||||
<test class="com.android.tradefed.testtype.GTest" >
|
||||
<option name="native-test-device-path" value="/data/local/tmp" />
|
||||
<option name="module-name" value="VtsHalAudioEffectV6_0TargetTest" />
|
||||
</test>
|
||||
</configuration>
|
Loading…
Reference in a new issue