Merge "Format VTS test code"
This commit is contained in:
commit
e0ade8fe67
6 changed files with 15 additions and 18 deletions
|
@ -30,16 +30,15 @@
|
|||
#include <android/binder_auto_utils.h>
|
||||
#include <fmq/AidlMessageQueue.h>
|
||||
#include <gtest/gtest.h>
|
||||
#include <system/audio_aidl_utils.h>
|
||||
#include <system/audio_effects/aidl_effects_utils.h>
|
||||
#include <system/audio_effects/effect_uuid.h>
|
||||
#include <system/audio_aidl_utils.h>
|
||||
|
||||
#include "AudioHalBinderServiceUtil.h"
|
||||
#include "EffectFactoryHelper.h"
|
||||
#include "TestUtils.h"
|
||||
|
||||
using namespace android;
|
||||
using ::android::audio::utils::toString;
|
||||
using aidl::android::hardware::audio::effect::CommandId;
|
||||
using aidl::android::hardware::audio::effect::Descriptor;
|
||||
using aidl::android::hardware::audio::effect::IEffect;
|
||||
|
@ -53,6 +52,7 @@ using aidl::android::media::audio::common::AudioFormatDescription;
|
|||
using aidl::android::media::audio::common::AudioFormatType;
|
||||
using aidl::android::media::audio::common::AudioUuid;
|
||||
using aidl::android::media::audio::common::PcmType;
|
||||
using ::android::audio::utils::toString;
|
||||
using ::android::hardware::EventFlag;
|
||||
|
||||
const AudioFormatDescription kDefaultFormatDescription = {
|
||||
|
@ -65,10 +65,9 @@ typedef ::android::AidlMessageQueue<float,
|
|||
::aidl::android::hardware::common::fmq::SynchronizedReadWrite>
|
||||
DataMQ;
|
||||
|
||||
static inline std::string getPrefix(Descriptor &descriptor) {
|
||||
static inline std::string getPrefix(Descriptor& descriptor) {
|
||||
std::string prefix = "Implementor_" + descriptor.common.implementor + "_name_" +
|
||||
descriptor.common.name + "_UUID_" +
|
||||
toString(descriptor.common.id.uuid);
|
||||
descriptor.common.name + "_UUID_" + toString(descriptor.common.id.uuid);
|
||||
return prefix;
|
||||
}
|
||||
|
||||
|
|
|
@ -162,8 +162,8 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
|
||||
std::string echoDelay = std::to_string(std::get<PARAM_ECHO_DELAY>(info.param));
|
||||
std::string mobileMode = std::get<PARAM_MOBILE_MODE>(info.param) ? "true" : "false";
|
||||
std::string name = getPrefix(descriptor) + "_EchoDelay_" + echoDelay +
|
||||
"_MobileMode_" + mobileMode;
|
||||
std::string name =
|
||||
getPrefix(descriptor) + "_EchoDelay_" + echoDelay + "_MobileMode_" + mobileMode;
|
||||
std::replace_if(
|
||||
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
|
||||
return name;
|
||||
|
|
|
@ -177,9 +177,9 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
std::to_string(std::get<PARAM_MAX_COMPRESSION_GAIN>(info.param));
|
||||
std::string enableLimiter = std::to_string(std::get<PARAM_ENABLE_LIMITER>(info.param));
|
||||
|
||||
std::string name = getPrefix(descriptor) + "_target_peak_level_" +
|
||||
targetPeakLevel + "_max_compression_gain_" + maxCompressionGain +
|
||||
"_enable_limiter_" + enableLimiter;
|
||||
std::string name = getPrefix(descriptor) + "_target_peak_level_" + targetPeakLevel +
|
||||
"_max_compression_gain_" + maxCompressionGain + "_enable_limiter_" +
|
||||
enableLimiter;
|
||||
std::replace_if(
|
||||
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
|
||||
return name;
|
||||
|
|
|
@ -195,10 +195,10 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
std::to_string(std::get<PARAM_VIBRATION_INFORMATION_Q_FACTOR>(info.param));
|
||||
std::string maxAmplitude =
|
||||
std::to_string(std::get<PARAM_VIBRATION_INFORMATION_MAX_AMPLITUDE>(info.param));
|
||||
std::string name = getPrefix(descriptor) + "_hapticScaleId" +
|
||||
hapticScaleID + "_hapticScaleVibScale" + hapticScaleVibScale +
|
||||
"_resonantFrequency" + resonantFrequency + "_qFactor" + qFactor +
|
||||
"_maxAmplitude" + maxAmplitude;
|
||||
std::string name = getPrefix(descriptor) + "_hapticScaleId" + hapticScaleID +
|
||||
"_hapticScaleVibScale" + hapticScaleVibScale + "_resonantFrequency" +
|
||||
resonantFrequency + "_qFactor" + qFactor + "_maxAmplitude" +
|
||||
maxAmplitude;
|
||||
std::replace_if(
|
||||
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
|
||||
return name;
|
||||
|
|
|
@ -155,8 +155,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
std::get<PARAM_LEVEL>(info.param));
|
||||
std::string type = aidl::android::hardware::audio::effect::toString(
|
||||
std::get<PARAM_TYPE>(info.param));
|
||||
std::string name = getPrefix(descriptor) + "_level_" + level + "_type_" +
|
||||
type;
|
||||
std::string name = getPrefix(descriptor) + "_level_" + level + "_type_" + type;
|
||||
std::replace_if(
|
||||
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
|
||||
return name;
|
||||
|
|
|
@ -149,8 +149,7 @@ INSTANTIATE_TEST_SUITE_P(
|
|||
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
|
||||
std::string level = std::to_string(std::get<PARAM_LEVEL>(info.param));
|
||||
std::string mute = std::to_string(std::get<PARAM_MUTE>(info.param));
|
||||
std::string name = getPrefix(descriptor) + "_level" + level + "_mute" +
|
||||
mute;
|
||||
std::string name = getPrefix(descriptor) + "_level" + level + "_mute" + mute;
|
||||
std::replace_if(
|
||||
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
|
||||
return name;
|
||||
|
|
Loading…
Reference in a new issue