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_io_service_if.h"
24 #include "hdf_uhdf_test.h"
25 #include "hdf_wifi_test.h"
26
27 using namespace testing::ext;
28
29 namespace NetBuffTest {
30 class WiFiNetBuffTest : public testing::Test {
31 public:
32 static void SetUpTestCase();
33 static void TearDownTestCase();
34 void SetUp();
35 void TearDown();
36 };
37
SetUpTestCase()38 void WiFiNetBuffTest::SetUpTestCase()
39 {
40 HdfTestOpenService();
41 }
42
TearDownTestCase()43 void WiFiNetBuffTest::TearDownTestCase()
44 {
45 HdfTestCloseService();
46 }
47
SetUp()48 void WiFiNetBuffTest::SetUp() {}
49
TearDown()50 void WiFiNetBuffTest::TearDown() {}
51
52 /**
53 * @tc.name: WiFiNetBuff001
54 * @tc.desc: netbuf function test
55 * @tc.type: FUNC
56 */
57 HWTEST_F(WiFiNetBuffTest, SUB_WLAN_NET_BUFF_0001, Function | MediumTest | Level1)
58 {
59 struct HdfTestMsg msg = {TEST_WIFI_TYPE, WIFI_NET_BUF_TEST, -1};
60 EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
61 }
62
63 /**
64 * @tc.name: WiFiNetBuffQueue001
65 * @tc.desc: netbuf queue function test
66 * @tc.type: FUNC
67 */
68 HWTEST_F(WiFiNetBuffTest, SUB_WLAN_NET_BUFF_Queue_0001, Function | MediumTest | Level1)
69 {
70 struct HdfTestMsg msg = {TEST_WIFI_TYPE, WIFI_NET_BUF_QUEUE_TEST, -1};
71 EXPECT_EQ(0, HdfTestSendMsgToService(&msg));
72 }
73 };
74