mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Add VTS Test for getConfig() in NFC 1.1
Test: run VtsHalNfcV1_1TargetTest Bug: 72080121 Change-Id: I89600b54d64d4f274647ab4426faf5e05b2f3d34 Merged-In: I89600b54d64d4f274647ab4426faf5e05b2f3d34 (cherry picked from commit 7fb95e3b56cfb53835cc37d3333eff7574371671)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user