1 /* 2 * Copyright (c) 2023 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 <cstdlib> 17 #include <cstring> 18 #include <fcntl.h> 19 #include <gtest/gtest.h> 20 #include <unistd.h> 21 #include "cpp/qos_convert.h" 22 #include "eu/qos_interface.h" 23 24 using namespace testing; 25 using namespace testing::ext; 26 using namespace ffrt; 27 28 class QosConvertTest : public testing::Test { 29 protected: SetUpTestCase()30 static void SetUpTestCase() 31 { 32 } 33 TearDownTestCase()34 static void TearDownTestCase() 35 { 36 } 37 SetUp()38 virtual void SetUp() 39 { 40 } 41 TearDown()42 virtual void TearDown() 43 { 44 } 45 }; 46 47 HWTEST_F(QosConvertTest, GetStaticQos, TestSize.Level1) 48 { 49 qos myqos = qos_default; 50 int ret = GetStaticQos(myqos); 51 EXPECT_EQ(ret, -1); 52 EXPECT_EQ(myqos, qos_default); 53 } 54 55 HWTEST_F(QosConvertTest, GetDynamicQos, TestSize.Level1) 56 { 57 qos myqos = qos_default; 58 int ret = GetDynamicQos(myqos); 59 EXPECT_EQ(ret, -1); 60 EXPECT_EQ(myqos, qos_default); 61 }