Update contexthub VTS based on latest spec

Bug: 180606685
Test: compile
Change-Id: I2e9e02aed4dae2a35b0b780e1f3379c08e80a6c4
This commit is contained in:
Anthony Stange 2021-03-17 17:31:15 +00:00
parent 778fb3e717
commit a03042d7a4

View file

@ -195,39 +195,8 @@ class TxnResultCallback : public ContexthubCallbackV1_2 {
std::promise<TransactionResult> promise;
};
// Parameterized fixture that sets the callback to TxnResultCallback
class ContexthubTxnTest : public ContexthubHidlTest {
public:
virtual void SetUp() override {
ContexthubHidlTest::SetUp();
ASSERT_OK(registerCallback_1_2(cb));
}
sp<TxnResultCallback> cb = new TxnResultCallback();
};
TEST_P(ContexthubTxnTest, TestSendMessageToNonExistentNanoApp) {
ContextHubMsg msg;
msg.msg_1_0.appName = kNonExistentAppId;
msg.msg_1_0.msgType = 1;
msg.msg_1_0.msg.resize(4);
std::fill(msg.msg_1_0.msg.begin(), msg.msg_1_0.msg.end(), 0);
ALOGD("Sending message to non-existent nanoapp");
Result result = hubApi->sendMessageToHub_1_2(getHubId(), msg);
if (result != Result::OK && result != Result::BAD_PARAMS &&
result != Result::TRANSACTION_FAILED) {
FAIL() << "Got result " << asBaseType(result) << ", expected OK, BAD_PARAMS"
<< ", or TRANSACTION_FAILED";
}
}
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ContexthubHidlTest);
INSTANTIATE_TEST_SUITE_P(HubIdSpecificTests, ContexthubHidlTest, testing::ValuesIn(kTestParameters),
android::hardware::PrintInstanceTupleNameToString<>);
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ContexthubTxnTest);
INSTANTIATE_TEST_SUITE_P(HubIdSpecificTests, ContexthubTxnTest, testing::ValuesIn(kTestParameters),
android::hardware::PrintInstanceTupleNameToString<>);
} // anonymous namespace