Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cd374a6 authored by Ruchi Kandoi's avatar Ruchi Kandoi
Browse files

Add VTS Test for getConfig() in NFC 1.1

Test: run VtsHalNfcV1_1TargetTest
Bug: 72080121
Merged-In: I89600b54d64d4f274647ab4426faf5e05b2f3d34
Change-Id: I89600b54d64d4f274647ab4426faf5e05b2f3d34
parent d128c87f
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
using ::android::hardware::nfc::V1_1::INfc;
using ::android::hardware::nfc::V1_1::INfcClientCallback;
using ::android::hardware::nfc::V1_1::NfcEvent;
using ::android::hardware::nfc::V1_1::NfcConfig;
using ::android::hardware::nfc::V1_0::NfcStatus;
using ::android::hardware::nfc::V1_0::NfcData;
using ::android::hardware::Return;
@@ -37,6 +38,9 @@ using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
using ::android::sp;

// 261 bytes is the default and minimum transceive length
constexpr unsigned int MIN_ISO_DEP_TRANSCEIVE_LENGTH = 261;

constexpr char kCallbackNameSendEvent[] = "sendEvent";
constexpr char kCallbackNameSendData[] = "sendData";

@@ -209,6 +213,17 @@ TEST_F(NfcHidlTest, CloseForPowerCaseOffAfterClose) {
    EXPECT_EQ(NfcStatus::OK, res.args->last_status_);
}

/*
 * getConfig:
 * Calls getConfig()
 * checks if fields in NfcConfig are populated correctly
 */
TEST_F(NfcHidlTest, GetConfig) {
    nfc_->getConfig([](NfcConfig config) {
        EXPECT_GE(config.maxIsoDepTransceiveLength, MIN_ISO_DEP_TRANSCEIVE_LENGTH);
    });
}

int main(int argc, char** argv) {
    ::testing::AddGlobalTestEnvironment(NfcHidlEnvironment::Instance());
    ::testing::InitGoogleTest(&argc, argv);