1094332d3Sopenharmony_ci/* 2094332d3Sopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 3094332d3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4094332d3Sopenharmony_ci * you may not use this file except in compliance with the License. 5094332d3Sopenharmony_ci * You may obtain a copy of the License at 6094332d3Sopenharmony_ci * 7094332d3Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8094332d3Sopenharmony_ci * 9094332d3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10094332d3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11094332d3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12094332d3Sopenharmony_ci * See the License for the specific language governing permissions and 13094332d3Sopenharmony_ci * limitations under the License. 14094332d3Sopenharmony_ci */ 15094332d3Sopenharmony_ci 16094332d3Sopenharmony_ci#include <cstdint> 17094332d3Sopenharmony_ci#include <cstdio> 18094332d3Sopenharmony_ci#include <cstdlib> 19094332d3Sopenharmony_ci#include <fcntl.h> 20094332d3Sopenharmony_ci#include <gtest/gtest.h> 21094332d3Sopenharmony_ci#include <string> 22094332d3Sopenharmony_ci#include <unistd.h> 23094332d3Sopenharmony_ci#include "hdf_io_service_if.h" 24094332d3Sopenharmony_ci#include "hdf_uhdf_test.h" 25094332d3Sopenharmony_ci#include "hdf_wifi_test.h" 26094332d3Sopenharmony_ci 27094332d3Sopenharmony_ciusing namespace testing::ext; 28094332d3Sopenharmony_ci 29094332d3Sopenharmony_cinamespace NetBuffTest { 30094332d3Sopenharmony_ciclass WiFiNetBuffTest : public testing::Test { 31094332d3Sopenharmony_cipublic: 32094332d3Sopenharmony_ci static void SetUpTestCase(); 33094332d3Sopenharmony_ci static void TearDownTestCase(); 34094332d3Sopenharmony_ci void SetUp(); 35094332d3Sopenharmony_ci void TearDown(); 36094332d3Sopenharmony_ci}; 37094332d3Sopenharmony_ci 38094332d3Sopenharmony_civoid WiFiNetBuffTest::SetUpTestCase() 39094332d3Sopenharmony_ci{ 40094332d3Sopenharmony_ci HdfTestOpenService(); 41094332d3Sopenharmony_ci} 42094332d3Sopenharmony_ci 43094332d3Sopenharmony_civoid WiFiNetBuffTest::TearDownTestCase() 44094332d3Sopenharmony_ci{ 45094332d3Sopenharmony_ci HdfTestCloseService(); 46094332d3Sopenharmony_ci} 47094332d3Sopenharmony_ci 48094332d3Sopenharmony_civoid WiFiNetBuffTest::SetUp() {} 49094332d3Sopenharmony_ci 50094332d3Sopenharmony_civoid WiFiNetBuffTest::TearDown() {} 51094332d3Sopenharmony_ci 52094332d3Sopenharmony_ci/** 53094332d3Sopenharmony_ci * @tc.name: WiFiNetBuff001 54094332d3Sopenharmony_ci * @tc.desc: netbuf function test 55094332d3Sopenharmony_ci * @tc.type: FUNC 56094332d3Sopenharmony_ci * @tc.require: AR000F869I 57094332d3Sopenharmony_ci */ 58094332d3Sopenharmony_ciHWTEST_F(WiFiNetBuffTest, WiFiNetBuff001, TestSize.Level1) 59094332d3Sopenharmony_ci{ 60094332d3Sopenharmony_ci struct HdfTestMsg msg = {TEST_WIFI_TYPE, WIFI_NET_BUF_TEST, -1}; 61094332d3Sopenharmony_ci EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); 62094332d3Sopenharmony_ci} 63094332d3Sopenharmony_ci 64094332d3Sopenharmony_ci/** 65094332d3Sopenharmony_ci * @tc.name: WiFiNetBuffQueue001 66094332d3Sopenharmony_ci * @tc.desc: netbuf queue function test 67094332d3Sopenharmony_ci * @tc.type: FUNC 68094332d3Sopenharmony_ci * @tc.require: AR000F869I 69094332d3Sopenharmony_ci */ 70094332d3Sopenharmony_ciHWTEST_F(WiFiNetBuffTest, WiFiNetBuffQueue001, TestSize.Level1) 71094332d3Sopenharmony_ci{ 72094332d3Sopenharmony_ci struct HdfTestMsg msg = {TEST_WIFI_TYPE, WIFI_NET_BUF_QUEUE_TEST, -1}; 73094332d3Sopenharmony_ci EXPECT_EQ(0, HdfTestSendMsgToService(&msg)); 74094332d3Sopenharmony_ci} 75094332d3Sopenharmony_ci}; 76