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 #include "common.h" 24 25 using namespace testing; 26 #ifdef HWTEST_TESTING_EXT_ENABLE 27 using namespace testing::ext; 28 #endif 29 using namespace ffrt; 30 31 class QosConvertTest : public testing::Test { 32 protected: SetUpTestCase()33 static void SetUpTestCase() 34 { 35 } 36 TearDownTestCase()37 static void TearDownTestCase() 38 { 39 } 40 SetUp()41 virtual void SetUp() 42 { 43 } 44 TearDown()45 virtual void TearDown() 46 { 47 } 48 }; 49 50 HWTEST_F(QosConvertTest, GetStaticQos, TestSize.Level1) 51 { 52 qos myqos = qos_default; 53 int ret = GetStaticQos(myqos); 54 EXPECT_EQ(ret, -1); 55 EXPECT_EQ(myqos, qos_default); 56 } 57 58 HWTEST_F(QosConvertTest, GetDynamicQos, TestSize.Level1) 59 { 60 qos myqos = qos_default; 61 int ret = GetDynamicQos(myqos); 62 EXPECT_EQ(ret, -1); 63 EXPECT_EQ(myqos, qos_default); 64 }