From 7f8fb92524cee19cd8a0ce959ddfb7794846b4f0 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Wed, 4 Nov 2020 11:50:41 -0800 Subject: [PATCH] omx: validate only standard OMX roles Test uses ::android::GetComponentRole to get OMX role for media type that only supports standard types (on GSI where VTS is run). Bug: 164550113 Bug: 171536493 Bug: 194827876 Test: atest VtsHalMediaOmxV1_0TargetStoreTest Change-Id: Ia9e64c8d887518f6c7d8c650a942bad7ce3457f0 --- .../store/VtsHalMediaOmxV1_0TargetStoreTest.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp index e73196cfb2..8699de3eb8 100644 --- a/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp +++ b/media/omx/1.0/vts/functional/store/VtsHalMediaOmxV1_0TargetStoreTest.cpp @@ -264,11 +264,13 @@ TEST_P(StoreHidlTest, ListRoles) { // Make sure role name follows expected format based on type and // isEncoder - const std::string role_name( - ::android::GetComponentRole(role.isEncoder, role.type.c_str())); - EXPECT_EQ(role_name, role.role) << "Role \"" << role.role << "\" does not match " - << (role.isEncoder ? "an encoder " : "a decoder ") - << "for mime type \"" << role.type << "."; + const char* role_name = ::android::GetComponentRole(role.isEncoder, role.type.c_str()); + if (role_name != nullptr) { + EXPECT_EQ(std::string(role_name), role.role) + << "Role \"" << role.role << "\" does not match " + << (role.isEncoder ? "an encoder " : "a decoder ") << "for media type \"" + << role.type << "."; + } // Check the nodes for this role std::set nodeKeys;