Add a VTS test to validate NNAPI driver name string. am: cc18d3fede am: eb72581807

Change-Id: Id743da698ba9a384256e1f28b6f9e4b8afdea1f7
This commit is contained in:
Automerger Merge Worker 2020-02-12 00:17:51 +00:00
commit 30f25018ec

View file

@ -79,6 +79,18 @@ TEST_P(NeuralnetworksHidlTest, GetDeviceTypeTest) {
EXPECT_TRUE(ret.isOk());
}
// device name test
TEST_P(NeuralnetworksHidlTest, GetDeviceNameTest) {
const std::string deviceName = getName(GetParam());
auto pos = deviceName.find('-');
EXPECT_NE(pos, std::string::npos);
// The separator should not be the first or last character.
EXPECT_NE(pos, 0);
EXPECT_NE(pos, deviceName.length() - 1);
// There should only be 1 separator.
EXPECT_EQ(std::string::npos, deviceName.find('-', pos + 1));
}
// device supported extensions test
TEST_P(NeuralnetworksHidlTest, GetDeviceSupportedExtensionsTest) {
Return<void> ret = kDevice->getSupportedExtensions(