1 /* 2 * Copyright (C) 2024 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 #ifndef PIPELINE_UNITTEST_H 16 #define PIPELINE_UNITTEST_H 17 #include <gtest/gtest.h> 18 #include "pipeline/pipeline.h" 19 #include "filter/filter.h" 20 namespace OHOS { 21 namespace Media { 22 namespace PiplineFuncUT { 23 class TestFilter : public Pipeline::Filter { 24 public: TestFilter(std::string name,Pipeline::FilterType type)25 TestFilter(std::string name, Pipeline::FilterType type): Pipeline::Filter(std::move(name), type) {}; 26 ~TestFilter() override = default; 27 }; 28 class PiplineUnitTest : public testing::Test { 29 public: 30 static void SetUpTestCase(void); 31 32 static void TearDownTestCase(void); 33 34 void SetUp(void); 35 36 void TearDown(void); 37 private: 38 std::shared_ptr<Pipeline::Pipeline> pipeline_; 39 std::shared_ptr<TestFilter> filterOne_; 40 std::shared_ptr<TestFilter> filterTwo_; 41 std::string testId; 42 }; 43 } // namespace PiplineFuncUT 44 } // namespace Media 45 } // namespace OHOS 46 #endif // PIPELINE_UNITTEST_H