1/*
2 * Copyright (c) 2021 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 <cstdint>
17#include <cstdio>
18#include <cstdlib>
19#include <fcntl.h>
20#include <gtest/gtest.h>
21#include <string>
22#include <unistd.h>
23#include "hdf_uhdf_test.h"
24#include "hdf_io_service_if.h"
25#include "hdf_wifi_test.h"
26
27using namespace testing::ext;
28
29namespace ModuleTest {
30class WiFiModuleTest : public testing::Test {
31public:
32    static void SetUpTestCase();
33    static void TearDownTestCase();
34    void SetUp();
35    void TearDown();
36};
37
38void WiFiModuleTest::SetUpTestCase()
39{
40    HdfTestOpenService();
41}
42
43void WiFiModuleTest::TearDownTestCase()
44{
45    HdfTestCloseService();
46}
47
48void WiFiModuleTest::SetUp() {}
49
50void WiFiModuleTest::TearDown() {}
51
52/**
53  * @tc.name: WiFiModuleCreate001
54  * @tc.desc: wifi create module function test
55  * @tc.type: FUNC
56  * @tc.require: SR000F869D
57  */
58HWTEST_F(WiFiModuleTest, WiFiModuleCreate001, TestSize.Level1)
59{
60    struct HdfTestMsg msg = {TEST_WIFI_TYPE, WIFI_MODULE_CREATE_MODULE, -1};
61    EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
62}
63
64/**
65  * @tc.name: WiFiModuleAddFeature001
66  * @tc.desc: wifi module add feature function test
67  * @tc.type: FUNC
68  * @tc.require: AR000F869K
69  */
70HWTEST_F(WiFiModuleTest, WiFiModuleAddFeature001, TestSize.Level1)
71{
72    struct HdfTestMsg msg = {TEST_WIFI_TYPE, WIFI_MODULE_ADD_FEATURE, -1};
73    EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
74}
75
76/**
77  * @tc.name: WiFiModuleDeleteFeature001
78  * @tc.desc: wifi module delete feature function test
79  * @tc.type: FUNC
80  * @tc.require: AR000F869K
81  */
82HWTEST_F(WiFiModuleTest, WiFiModuleDeleteFeature001, TestSize.Level1)
83{
84    struct HdfTestMsg msg = {TEST_WIFI_TYPE, WIFI_MODULE_DELETE_FEATURE, -1};
85    EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
86}
87
88/**
89  * @tc.name: WiFiModuleDelete001
90  * @tc.desc: wifi delete module function test
91  * @tc.type: FUNC
92  * @tc.require: AR000F869K
93  */
94HWTEST_F(WiFiModuleTest, WiFiModuleDelete001, TestSize.Level1)
95{
96    struct HdfTestMsg msg = {TEST_WIFI_TYPE, WIFI_MODULE_DELETE_MODULE, -1};
97    EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
98}
99};
100