Merge "Avoid sub_overflow_minimal in AIDL effects VTS" into main

This commit is contained in:
Shunkai Yao 2023-09-08 21:38:08 +00:00 committed by Gerrit Code Review
commit 5348432dea
2 changed files with 4 additions and 4 deletions

View file

@ -250,11 +250,11 @@ class EffectHelper {
maxLimit = std::numeric_limits<S>::max();
if (s.size()) {
const auto min = *s.begin(), max = *s.rbegin();
s.insert(min + (max - min) / 2);
if (min != minLimit) {
s.insert((min & max) + ((min ^ max) >> 1));
if (min > minLimit + 1) {
s.insert(min - 1);
}
if (max != maxLimit) {
if (max < maxLimit - 1) {
s.insert(max + 1);
}
}

View file

@ -208,7 +208,7 @@ INSTANTIATE_TEST_SUITE_P(
HapticGeneratorInvalidTest, HapticGeneratorParamTest,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
IFactory::descriptor, getEffectTypeUuidHapticGenerator())),
testing::Values(MIN_ID - 1),
testing::Values(MIN_ID),
testing::Values(HapticGenerator::VibratorScale::NONE),
testing::Values(MIN_FLOAT), testing::Values(MIN_FLOAT),
testing::Values(MIN_FLOAT)),