From 1c8a5a1b6aeaba7c7143162e409bd75dd541421e Mon Sep 17 00:00:00 2001 From: Lais Andrade Date: Wed, 3 Nov 2021 16:47:32 +0000 Subject: [PATCH] Check primitive duration is positive for supported primitives Fix: 203629838 Test: VtsHalVibratorTargetTest Change-Id: I2e534f4589c9f594884385a99051c06f518103f7 --- vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp index 53f8c0ef24..09cc21ba32 100644 --- a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp +++ b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp @@ -417,6 +417,9 @@ TEST_P(VibratorAidl, GetPrimitiveDuration) { if (isPrimitiveSupported) { EXPECT_EQ(Status::EX_NONE, status.exceptionCode()); + if (primitive != CompositePrimitive::NOOP) { + ASSERT_GT(duration, 0) << toString(primitive) << " " << duration; + } } else { EXPECT_TRUE(isUnknownOrUnsupported(status)) << status; }