1 /* 2 * Copyright (c) 2025 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 <cstring> 17 #include <securec.h> 18 #include <ctime> 19 #include <linux/netlink.h> 20 #include <linux/rtnetlink.h> 21 22 #include "gtest/gtest.h" 23 #include "lnn_linkwatch.h" 24 #include "lnn_log.h" 25 #include "softbus_adapter_errcode.h" 26 #include "softbus_adapter_socket.h" 27 #include "softbus_def.h" 28 #include "softbus_error_code.h" 29 30 using namespace std; 31 using namespace testing::ext; 32 33 namespace OHOS { 34 class LnnLinkWatchTest : public testing::Test { 35 public: 36 static void SetUpTestCase(); 37 static void TearDownTestCase(); 38 void SetUp(); 39 void TearDown(); 40 }; 41 SetUpTestCase()42void LnnLinkWatchTest::SetUpTestCase() { } 43 TearDownTestCase()44void LnnLinkWatchTest::TearDownTestCase() { } 45 SetUp()46void LnnLinkWatchTest::SetUp() { } 47 TearDown()48void LnnLinkWatchTest::TearDown() { } 49 50 /** 51 * @tc.name: Add_Attr_001 52 * @tc.desc: Verify the LnnIsLinkReady function return value equal false. 53 * @tc.type: FUNC 54 * @tc.require: 1 55 */ 56 HWTEST_F(LnnLinkWatchTest, LnnIsLinkReady_001, TestSize.Level1) 57 { 58 char *iface = nullptr; 59 bool ret = LnnIsLinkReady(iface); 60 EXPECT_EQ(ret, false); 61 } 62 } // namespace OHOS