1 /* 2 * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. 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 <hwext/gtest-ext.h> 17 #include <hwext/gtest-tag.h> 18 19 #include "hitrace_ops.h" 20 21 namespace { 22 using FTRACE_NS::HitraceOps; 23 using testing::ext::TestSize; 24 25 class HitraceOpsTest : public ::testing::Test { 26 protected: SetUp()27 void SetUp() override {} TearDown()28 void TearDown() override {} 29 }; 30 31 /* 32 * @tc.name: PrepareListCategoriesCmd 33 * @tc.desc: test HitraceOps::PrepareListCategoriesCmd with normal case. 34 * @tc.type: FUNC 35 */ 36 HWTEST_F(HitraceOpsTest, PrepareListCategoriesCmd, TestSize.Level1) 37 { 38 std::unique_ptr<HitraceOps> hitraceOps = std::make_unique<HitraceOps>(); 39 EXPECT_TRUE(hitraceOps->PrepareListCategoriesCmd()); 40 } 41 42 /* 43 * @tc.name: PrepareEnableCategoriesCmd 44 * @tc.desc: test HitraceOps::PrepareEnableCategoriesCmd with normal case. 45 * @tc.type: FUNC 46 */ 47 HWTEST_F(HitraceOpsTest, PrepareEnableCategoriesCmd, TestSize.Level1) 48 { 49 std::unique_ptr<HitraceOps> hitraceOps = std::make_unique<HitraceOps>(); 50 EXPECT_TRUE(hitraceOps->PrepareEnableCategoriesCmd()); 51 } 52 53 /* 54 * @tc.name: PrepareDisableCategoriesCmd 55 * @tc.desc: test HitraceOps::PrepareDisableCategoriesCmd with normal case. 56 * @tc.type: FUNC 57 */ 58 HWTEST_F(HitraceOpsTest, PrepareDisableCategoriesCmd, TestSize.Level1) 59 { 60 std::unique_ptr<HitraceOps> hitraceOps = std::make_unique<HitraceOps>(); 61 EXPECT_TRUE(hitraceOps->PrepareDisableCategoriesCmd()); 62 } 63 } // namespace