native c tdd添加用例

Signed-off-by: CodeAdo <baliguan163@163.com>
This commit is contained in:
CodeAdo 2023-08-04 09:26:32 +08:00
parent 8b85be4336
commit 3f54e3abfc
2 changed files with 36 additions and 1 deletions

View File

@ -287,7 +287,7 @@ WifiErrorCode IsBandTypeSupported(int bandType, bool *supported);
* @param result - get result vector of int
* @return ErrCode - operation result
*/
WifiErrorCode Get5GHzChannelList(int *result);
WifiErrorCode Get5GHzChannelList(int *result, int *size);
/**
* @brief Registers a callback for a specified Wi-Fi event.

View File

@ -43,6 +43,7 @@ constexpr int RSSI = 2;
constexpr int TYPE_OPEN = 0;
constexpr unsigned char BSSID[WIFI_MAC_LEN] = "test1";
constexpr int BAND = 2;
constexpr int ZERO = 0;
class WifiCDeviceTest : public testing::Test {
public:
@ -336,6 +337,25 @@ public:
int band = BAND;
EXPECT_EQ(GetSignalLevel(rssi, band), -1);
}
void SetLowLatencyModeTest()
{
EXPECT_TRUE(SetLowLatencyMode(true) == WIFI_SUCCESS);
EXPECT_TRUE(SetLowLatencyMode(false) == WIFI_SUCCESS);
}
void IsBandTypeSupportedTest()
{
bool supported = false;
EXPECT_TRUE(IsBandTypeSupported(BAND, &supported) != WIFI_SUCCESS);
}
void Get5GHzChannelListTest()
{
int result = ZERO;
int size = ZERO;
EXPECT_TRUE(Get5GHzChannelList(&result, &size) != WIFI_SUCCESS);
}
};
HWTEST_F(WifiCDeviceTest, EnableWifiSuccess, TestSize.Level1)
@ -452,5 +472,20 @@ HWTEST_F(WifiCDeviceTest, GetSignalLevelSuccess, TestSize.Level1)
{
GetSignalLevelSuccess();
}
HWTEST_F(WifiCDeviceTest, SetLowLatencyModeTest, TestSize.Level1)
{
SetLowLatencyModeTest();
}
HWTEST_F(WifiCDeviceTest, IsBandTypeSupportedTest, TestSize.Level1)
{
IsBandTypeSupportedTest();
}
HWTEST_F(WifiCDeviceTest, Get5GHzChannelListTest, TestSize.Level1)
{
Get5GHzChannelListTest();
}
} // namespace Wifi
} // namespace OHOS