Update vibrator VTS to only validate support from required primitives
Change-Id: I93cf92636af7a89371f1e87a5a0b40de9d3ee3ed Fix: 193196353 Test: VtsHalVibratorTargetTest Merged-In: Icb69a799d204102880efd685312d3a0e2e22b7bb Merged-In: I7ec2f0d82290f42259f8383db9ff00a126a2a7a4
This commit is contained in:
parent
d4019c4139
commit
46819a1675
1 changed files with 10 additions and 7 deletions
|
@ -55,9 +55,12 @@ 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 = {
|
||||
|
@ -274,11 +277,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue