mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 05:49:27 +00:00
Use parameterized test to disable test for devices without NFC
Test: atest VtsNfcBehaviorChangesTest Bug: 345575225 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f113bc3a9ea32c6eb53df761f745079fa0e2bb2e) Merged-In: I22393acc260d200d2e472d276c64af005a75ab6b Change-Id: I22393acc260d200d2e472d276c64af005a75ab6b
This commit is contained in:
committed by
Cherrypicker Worker
parent
965ff77e74
commit
92938c606c
@@ -16,6 +16,10 @@
|
||||
|
||||
#define LOG_TAG "nfc_behavior_changes_test"
|
||||
|
||||
#include <aidl/Gtest.h>
|
||||
#include <aidl/Vintf.h>
|
||||
#include <aidl/android/hardware/nfc/BnNfc.h>
|
||||
#include <aidl/android/hardware/nfc/INfc.h>
|
||||
#include <android-base/logging.h>
|
||||
#include <android-base/stringprintf.h>
|
||||
#include <android/binder_process.h>
|
||||
@@ -30,6 +34,9 @@
|
||||
#include "nfa_api.h"
|
||||
#include "nfa_ee_api.h"
|
||||
|
||||
using aidl::android::hardware::nfc::INfc;
|
||||
using android::getAidlHalInstanceNames;
|
||||
using android::PrintInstanceNameToString;
|
||||
using android::base::StringPrintf;
|
||||
|
||||
static SyncEvent sNfaEnableEvent; // event for NFA_Enable()
|
||||
@@ -162,7 +169,7 @@ tNFA_STATUS static nfaObserveModeEnable(bool enable) {
|
||||
return status;
|
||||
}
|
||||
|
||||
class NfcBehaviorChanges : public testing::Test {
|
||||
class NfcBehaviorChanges : public testing::TestWithParam<std::string> {
|
||||
protected:
|
||||
void SetUp() override {
|
||||
tNFA_STATUS status = NFA_STATUS_OK;
|
||||
@@ -202,7 +209,7 @@ class NfcBehaviorChanges : public testing::Test {
|
||||
*
|
||||
* @VsrTest = GMS-VSR-3.2.8-001
|
||||
*/
|
||||
TEST_F(NfcBehaviorChanges, ObserveModeEnableDisable) {
|
||||
TEST_P(NfcBehaviorChanges, ObserveModeEnableDisable) {
|
||||
tNFA_STATUS status = nfaObserveModeEnable(true);
|
||||
ASSERT_EQ(status, NFA_STATUS_OK);
|
||||
|
||||
@@ -210,6 +217,11 @@ TEST_F(NfcBehaviorChanges, ObserveModeEnableDisable) {
|
||||
ASSERT_EQ(status, NFA_STATUS_OK);
|
||||
}
|
||||
|
||||
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(NfcBehaviorChanges);
|
||||
INSTANTIATE_TEST_SUITE_P(Nfc, NfcBehaviorChanges,
|
||||
testing::ValuesIn(::android::getAidlHalInstanceNames(INfc::descriptor)),
|
||||
::android::PrintInstanceNameToString);
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
ABinderProcess_startThreadPool();
|
||||
|
||||
Reference in New Issue
Block a user