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

Commit 749ff90c authored by Jimmy Chen's avatar Jimmy Chen Committed by android-build-merger
Browse files

Merge "p2p: skip MAC randomization vts test if not supported" into qt-dev am:...

Merge "p2p: skip MAC randomization vts test if not supported" into qt-dev am: 33723f56 am: d49f3424
am: fb9b8834

Change-Id: I634281e0ad0b288d37e1dffabb4e1e80300bcae1
parents b6b66db6 fb9b8834
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -127,25 +127,33 @@ TEST_F(SupplicantP2pIfaceHidlTest, AddGroup_1_2_FailureInvalidFrequency) {
        });
}

bool isMacRandomizationSupported(const SupplicantStatus& status) {
    return status.code != SupplicantStatusCode::FAILURE_ARGS_INVALID;
}

/*
 * Verify that setMacRandomization successes.
 */
TEST_F(SupplicantP2pIfaceHidlTest, EnableMacRandomization) {
    p2p_iface_->setMacRandomization(true, [](const SupplicantStatus& status) {
        if (!isMacRandomizationSupported(status)) return;
        EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
    });

    // enable twice
    p2p_iface_->setMacRandomization(true, [](const SupplicantStatus& status) {
        if (!isMacRandomizationSupported(status)) return;
        EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
    });

    p2p_iface_->setMacRandomization(false, [](const SupplicantStatus& status) {
        if (!isMacRandomizationSupported(status)) return;
        EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
    });

    // disable twice
    p2p_iface_->setMacRandomization(false, [](const SupplicantStatus& status) {
        if (!isMacRandomizationSupported(status)) return;
        EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
    });
}