1 /*
2 * Copyright (C) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16 #include "wifi_hal_wpa_common_test.h"
17 #include "securec.h"
18 #include "wifi_log.h"
19 #include "wifi_common_hal.h"
20 #include "mock_wpa_ctrl.h"
21
22 #undef LOG_TAG
23 #define LOG_TAG "WifiHalWpaCommonTest"
24
25 using namespace testing::ext;
26
27 namespace OHOS {
28 namespace Wifi {
SetUpTestCase()29 void WifiHalWpaCommonTest::SetUpTestCase()
30 {
31 }
32
TearDownTestCase()33 void WifiHalWpaCommonTest::TearDownTestCase()
34 {
35 }
36
37 HWTEST_F(WifiHalWpaCommonTest, SendComCmdTest, TestSize.Level1)
38 {
39 LOGE("enter SendComCmdTest");
40 const char* cmd = nullptr;
41 EXPECT_EQ(-1, SendComCmd(cmd));
42
43 const char* cmd1 = "nullptr";
44 EXPECT_EQ(-1, SendComCmd(cmd1));
45 }
46
47 HWTEST_F(WifiHalWpaCommonTest, HalCallbackNotifyTest, TestSize.Level1)
48 {
49 LOGE("enter HalCallbackNotifyTest");
50 const char* event = nullptr;
51 EXPECT_EQ(-1, HalCallbackNotify(event));
52
53 const char* event1 = "nullptr";
54 EXPECT_EQ(0, HalCallbackNotify(event1));
55 }
56 } // namespace Wifi
57 } // namespace OHOS