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

Commit a9ee578b authored by Ruchi Kandoi's avatar Ruchi Kandoi Committed by android-build-merger
Browse files

Add VTS Test for getConfig() in NFC 1.1 am: 0f0743a5

am: cf3d870b

Change-Id: Ie398c137aee6f017787788a145aaca9c1b2f4eb6
parents 4bc35789 cf3d870b
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);