From 7e643777e125a0caf655629c8d993390bdeb7aa4 Mon Sep 17 00:00:00 2001 From: Lais Andrade Date: Fri, 9 Jul 2021 14:59:44 +0100 Subject: [PATCH] Update vibrator VTS to only validate support from required primitives Bug: 193196353 Test: VtsHalVibratorTargetTest Change-Id: I7ec2f0d82290f42259f8383db9ff00a126a2a7a4 --- vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp index c56bd9a4d4..553d7f0a4a 100644 --- a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp +++ b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp @@ -60,9 +60,10 @@ const std::vector kCompositePrimitives{ android::enum_range().begin(), android::enum_range().end()}; -const std::vector kOptionalPrimitives = { - CompositePrimitive::THUD, - CompositePrimitive::SPIN, +const std::vector kRequiredPrimitives = { + CompositePrimitive::CLICK, CompositePrimitive::LIGHT_TICK, + CompositePrimitive::QUICK_RISE, CompositePrimitive::SLOW_RISE, + CompositePrimitive::QUICK_FALL, }; const std::vector 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); } } }