mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 10:44:41 +00:00
Wifi 1.3: Fix STA getFactoryMacAddress test.
It's valid for individual bytes in a MAC address to be zero as long as they're not all zero. Bug: 132705022 Bug: 141916952 Test: m -j32 vts && vts-tradefed run vts-hal --skip-preconditions --module VtsHalWifiV1_3Target Change-Id: Ic33a3b80cce90eb4b031aca33aa66bf2a375dc16
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
#include "wifi_hidl_test_utils.h"
|
||||
|
||||
using ::android::sp;
|
||||
using ::android::hardware::hidl_array;
|
||||
using ::android::hardware::wifi::V1_0::WifiStatus;
|
||||
using ::android::hardware::wifi::V1_0::WifiStatusCode;
|
||||
using ::android::hardware::wifi::V1_3::IWifiStaIface;
|
||||
|
||||
@@ -59,14 +61,11 @@ class WifiStaIfaceHidlTest : public ::testing::VtsHalHidlTargetTestBase {
|
||||
* and return a success status code.
|
||||
*/
|
||||
TEST_F(WifiStaIfaceHidlTest, GetFactoryMacAddress) {
|
||||
const auto& status_and_mac =
|
||||
std::pair<WifiStatus, hidl_array<uint8_t, 6> > status_and_mac =
|
||||
HIDL_INVOKE(wifi_sta_iface_, getFactoryMacAddress);
|
||||
EXPECT_EQ(WifiStatusCode::SUCCESS, status_and_mac.first.code);
|
||||
const int num_elements = sizeof(status_and_mac.second) / sizeof(uint8_t);
|
||||
EXPECT_EQ(6, num_elements);
|
||||
for (int i = 0; i < num_elements; i++) {
|
||||
EXPECT_NE(0, status_and_mac.second[i]);
|
||||
}
|
||||
hidl_array<uint8_t, 6> all_zero{};
|
||||
EXPECT_NE(all_zero, status_and_mac.second);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user