1 /*
2  * Copyright (c) 2022 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 "filter_factory_unittest.h"
17 #include "filter_factory.h"
18 
19 using namespace testing;
20 using namespace testing::ext;
21 
22 namespace OHOS {
23 namespace Rosen {
24 /**
25  * @tc.name: GetFilter001
26  * @tc.desc: Get the corresponding Filter according to the input string
27  * @tc.type: FUNC
28  * @tc.require:
29  * @tc.author:
30  */
31 HWTEST_F(FilterFactoryUnittest, GetFilter001, TestSize.Level1)
32 {
33     GTEST_LOG_(INFO) << "FilterFactoryUnittest GetFilter001 start";
34     /**
35      * @tc.steps: step1. Create a FilterFactory instance
36      */
37 
38     FilterFactory filterFactory;
39     /**
40      * @tc.steps: step2. Call GetFilter to get a Filter pointer
41      */
42     auto input = filterFactory.GetFilter("Input");
43     bool testResult = input != nullptr;
44     EXPECT_TRUE(testResult);
45 }
46 
47 /**
48  * @tc.name: GetFilter002
49  * @tc.desc: Get the corresponding Filter according to the input string
50  * @tc.type: FUNC
51  * @tc.require:
52  * @tc.author:
53  */
54 HWTEST_F(FilterFactoryUnittest, GetFilter002, TestSize.Level1)
55 {
56     GTEST_LOG_(INFO) << "FilterFactoryUnittest GetFilter002 start";
57     /**
58      * @tc.steps: step1. Create a FilterFactory instance
59      */
60 
61     FilterFactory filterFactory;
62     /**
63      * @tc.steps: step2. Call GetFilter to get a Filter pointer
64      */
65     auto output = filterFactory.GetFilter("Output");
66     bool testResult = output != nullptr;
67     EXPECT_TRUE(testResult);
68 }
69 
70 /**
71  * @tc.name: GetFilter003
72  * @tc.desc: Get the corresponding Filter according to the input string
73  * @tc.type: FUNC
74  * @tc.require:
75  * @tc.author:
76  */
77 HWTEST_F(FilterFactoryUnittest, GetFilter003, TestSize.Level1)
78 {
79     GTEST_LOG_(INFO) << "FilterFactoryUnittest GetFilter003 start";
80     /**
81      * @tc.steps: step1. Create a FilterFactory instance
82      */
83 
84     FilterFactory filterFactory;
85     /**
86      * @tc.steps: step2. Call GetFilter to get a Filter pointer
87      */
88     auto gaussianBlur = filterFactory.GetFilter("GaussianBlur");
89     bool testResult = gaussianBlur != nullptr;
90     EXPECT_TRUE(testResult);
91 }
92 } // namespace Rosen
93 } // namespace OHOS
94