Merge "Update vibrator VTS to only validate support from required primitives" into sc-dev am: afb4bfa127

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/15244130

Change-Id: Ia3130d4b17ae4aeaa16effd558ba873279dd140c
This commit is contained in:
TreeHugger Robot
2021-07-14 16:27:10 +00:00
committed by Automerger Merge Worker

View File

@@ -60,9 +60,10 @@ const std::vector<CompositePrimitive> kCompositePrimitives{
android::enum_range<CompositePrimitive>().begin(),
android::enum_range<CompositePrimitive>().end()};
const std::vector<CompositePrimitive> kOptionalPrimitives = {
CompositePrimitive::THUD,
CompositePrimitive::SPIN,
const std::vector<CompositePrimitive> kRequiredPrimitives = {
CompositePrimitive::CLICK, CompositePrimitive::LIGHT_TICK,
CompositePrimitive::QUICK_RISE, CompositePrimitive::SLOW_RISE,
CompositePrimitive::QUICK_FALL,
};
const std::vector<CompositePrimitive> kInvalidPrimitives = {
@@ -393,11 +394,11 @@ TEST_P(VibratorAidl, GetSupportedPrimitives) {
for (auto primitive : kCompositePrimitives) {
bool isPrimitiveSupported =
std::find(supported.begin(), supported.end(), primitive) != supported.end();
bool isPrimitiveOptional =
std::find(kOptionalPrimitives.begin(), kOptionalPrimitives.end(), primitive) !=
kOptionalPrimitives.end();
bool isPrimitiveRequired =
std::find(kRequiredPrimitives.begin(), kRequiredPrimitives.end(), primitive) !=
kRequiredPrimitives.end();
EXPECT_TRUE(isPrimitiveSupported || isPrimitiveOptional) << toString(primitive);
EXPECT_TRUE(isPrimitiveSupported || !isPrimitiveRequired) << toString(primitive);
}
}
}