summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuchi Kandoi <kandoiruchi@google.com>2017-06-19 16:33:33 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2017-06-19 16:33:35 +0000
commit55f3ddf53b051a28c2773c872a398786a060dc30 (patch)
tree90a0f7f2feea8edce7b5b37d1661b2d51f01ab7e
parente812feb56f7ed63e23995149896e3e2003449eb4 (diff)
parent36193658d22841d4aec1c9ce1353580cac6ac43e (diff)
downloadplatform_hardware_interfaces-55f3ddf53b051a28c2773c872a398786a060dc30.tar.gz
platform_hardware_interfaces-55f3ddf53b051a28c2773c872a398786a060dc30.tar.bz2
platform_hardware_interfaces-55f3ddf53b051a28c2773c872a398786a060dc30.zip
Merge "Nfc: Vts: modify WriteInvalidAndThenValidCommand" into oc-dev
-rw-r--r--nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp b/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
index 094e8a16ea..e67f94f723 100644
--- a/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
+++ b/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
@@ -46,8 +46,6 @@ using ::android::sp;
{ 0x20, 0x01, 0x00 }
#define INVALID_COMMAND \
{ 0x20, 0x00, 0x00 }
-#define FAULTY_DATA_PACKET \
- { 0x00, 0x00, 0xFF }
#define LOOP_BACK_HEADER_SIZE 3
#define SYNTAX_ERROR 5
@@ -271,8 +269,8 @@ TEST_F(NfcHidlTest, WriteInvalidCommand) {
/*
* WriteInvalidAndThenValidCommand:
- * Sends an Faulty Data Packet
- * Waits for CORE_INTERFACE_ERROR_NTF
+ * Sends an Invalid command
+ * Waits for response
* Checks SYNTAX_ERROR status
* Repeat for 100 times appending 0xFF each time to the packet
* Send CORE_CONN_CREATE_CMD for loop-back mode
@@ -303,7 +301,7 @@ TEST_F(NfcHidlTest, WriteInvalidAndThenValidCommand) {
EXPECT_EQ((int)NfcStatus::OK, res.args->last_data_[3]);
// Send an Error Data Packet
- cmd = FAULTY_DATA_PACKET;
+ cmd = INVALID_COMMAND;
data = cmd;
size_t size = data.size();
@@ -311,13 +309,10 @@ TEST_F(NfcHidlTest, WriteInvalidAndThenValidCommand) {
data.resize(++size);
data[size - 1] = 0xFF;
EXPECT_EQ(data.size(), nfc_->write(data));
- // Wait for CORE_INTERFACE_ERROR_NTF
+ // Wait for response with SYNTAX_ERROR
res = nfc_cb_->WaitForCallback(kCallbackNameSendData);
EXPECT_TRUE(res.no_timeout);
- EXPECT_EQ(5ul, res.args->last_data_.size());
- EXPECT_EQ(0x60, res.args->last_data_[0]);
- EXPECT_EQ(0x08, res.args->last_data_[1]);
- EXPECT_EQ(0x02, res.args->last_data_[2]);
+ EXPECT_EQ(4ul, res.args->last_data_.size());
EXPECT_EQ(SYNTAX_ERROR, res.args->last_data_[3]);
}