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