mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 21:37:44 +00:00
Merge "Format VTS test code" am: e0ade8fe67 am: 1e58a2b6dd
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2636889 Change-Id: Ied32c9b7db481a94210c8bf73c1397416b104839 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user