1 /* 2 * Copyright (c) 2024 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 <gtest/gtest.h> 17 #include <hdf_log.h> 18 #include "../../../chip/hdi_service/wifi_vendor_hal_list.h" 19 20 using namespace testing::ext; 21 using namespace OHOS::HDI::Wlan::Chip::V1_0; 22 23 namespace WifiVendorHalListTest { 24 class WifiVendorHalListTest : public testing::Test { 25 public: SetUpTestCase()26 static void SetUpTestCase() {} TearDownTestCase()27 static void TearDownTestCase() {} SetUp()28 void SetUp() 29 { 30 std::weak_ptr<IfaceTool> ifaceTool = std::make_shared<IfaceTool>(); 31 vendorHalListTest = std::make_shared<WifiVendorHalList>(ifaceTool); 32 } TearDown()33 void TearDown() 34 { 35 vendorHalListTest.reset(); 36 } 37 GetHalsTest()38 void GetHalsTest() 39 { 40 if (vendorHalListTest == nullptr) { 41 HDF_LOGE("vendorHalListTest is null"); 42 return; 43 } 44 EXPECT_TRUE(vendorHalListTest->GetHals().size() != 0); 45 } 46 47 public: 48 std::shared_ptr<WifiVendorHalList> vendorHalListTest; 49 }; 50 51 /** 52 * @tc.name: GetHalsTest 53 * @tc.desc: GetHals 54 * @tc.type: FUNC 55 * @tc.require: 56 */ 57 HWTEST_F(WifiVendorHalListTest, GetHalsTest, TestSize.Level1) 58 { 59 HDF_LOGI("GetHalsTest started"); 60 GetHalsTest(); 61 } 62 }