From c4dccfb4a84242b0ba0b1ec8aa2fd1c947a0e971 Mon Sep 17 00:00:00 2001 From: wangpggg Date: Thu, 18 Jan 2024 15:22:04 +0800 Subject: [PATCH] tdd testcase Adapt Signed-off-by: c459517356 --- test/unittest/phone/qos_interface_test.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/unittest/phone/qos_interface_test.cpp b/test/unittest/phone/qos_interface_test.cpp index e45def5..4dfa1d3 100644 --- a/test/unittest/phone/qos_interface_test.cpp +++ b/test/unittest/phone/qos_interface_test.cpp @@ -13,6 +13,9 @@ * limitations under the License. */ +#include +#include + #include "gtest/gtest.h" #include "../include/qos_interface.h" @@ -31,8 +34,17 @@ public: static void TearDownTestCase(); void SetUp(); void TearDown(); + bool IsLinuxOs(); }; +bool QosInterfaceTest::IsLinuxOs() +{ + struct utsname nameData; + uname(&nameData); + int cmpNum = 5; + return strncmp(nameData.sysname, "Linux", cmpNum) == 0 ? true : false; +} + void QosInterfaceTest::SetUpTestCase() { } @@ -155,6 +167,9 @@ HWTEST_F(QosInterfaceTest, AuthGetTest, TestSize.Level1) unsigned int status1 = 0; unsigned int *status = &status1; int ret = AuthGet(pid); + if (!IsLinuxOs()) { + return; + } EXPECT_GE(ret, 0); pid = -1; ret = AuthGet(pid); -- Gitee