Merge "Effect: verify all AIDL IEffect versions are same as IFactory" into main am: 047484de60
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2945531 Change-Id: I4ca7e560dbe9a60dfb8b9420493edf5628e8560d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
4221f8783d
1 changed files with 19 additions and 0 deletions
|
@ -296,6 +296,25 @@ TEST_P(EffectFactoryTest, QueryProcess) {
|
|||
[&](const auto& proc) { return processingSet.find(proc) != processingSet.end(); }));
|
||||
}
|
||||
|
||||
// Make sure all effect instances have same HAL version number as IFactory.
|
||||
TEST_P(EffectFactoryTest, VersionNumberForAllEffectsEqualsToIFactory) {
|
||||
std::vector<Descriptor> descs;
|
||||
EXPECT_IS_OK(mEffectFactory->queryEffects(std::nullopt, std::nullopt, std::nullopt, &descs));
|
||||
EXPECT_NE(descs.size(), 0UL);
|
||||
|
||||
std::vector<std::shared_ptr<IEffect>> effects = createWithDescs(descs);
|
||||
int factoryVersion = 0;
|
||||
EXPECT_IS_OK(mEffectFactory->getInterfaceVersion(&factoryVersion));
|
||||
|
||||
for (const auto& effect : effects) {
|
||||
int effectVersion = 0;
|
||||
EXPECT_NE(nullptr, effect);
|
||||
EXPECT_IS_OK(effect->getInterfaceVersion(&effectVersion));
|
||||
EXPECT_EQ(factoryVersion, effectVersion);
|
||||
}
|
||||
ASSERT_NO_FATAL_FAILURE(destroyEffects(effects));
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(EffectFactoryTest, EffectFactoryTest,
|
||||
testing::ValuesIn(android::getAidlHalInstanceNames(IFactory::descriptor)),
|
||||
android::PrintInstanceNameToString);
|
||||
|
|
Loading…
Reference in a new issue