1 /*
2 * Copyright (c) 2025 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 <gtest/gtest.h>
17
18 #include "ext/gex_flow_light_sweep_shader.h"
19
20 #include "draw/color.h"
21 #include "image/bitmap.h"
22
23 using namespace testing;
24 using namespace testing::ext;
25
26 namespace OHOS {
27 namespace GraphicsEffectEngine {
28
29 using namespace Rosen;
30
31 class GEXFlowLightSweepShaderTest : public testing::Test {
32 public:
33 static void SetUpTestCase();
34 static void TearDownTestCase();
35 void SetUp() override;
36 void TearDown() override;
37 };
38
SetUpTestCase()39 void GEXFlowLightSweepShaderTest::SetUpTestCase() {}
40
TearDownTestCase()41 void GEXFlowLightSweepShaderTest::TearDownTestCase() {}
42
SetUp()43 void GEXFlowLightSweepShaderTest::SetUp() {}
44
TearDown()45 void GEXFlowLightSweepShaderTest::TearDown() {}
46
47 /**
48 * @tc.name: CreateDynamicImpl_001
49 * @tc.desc: Verify function CreateDynamicImpl
50 * @tc.type:FUNC
51 */
52 HWTEST_F(GEXFlowLightSweepShaderTest, CreateDynamicImpl_001, TestSize.Level0)
53 {
54 std::vector<std::pair<Drawing::Color, float>> para;
55 para.push_back(std::pair(Drawing::Color::COLOR_RED, 0.0f));
56 para.push_back(std::pair(Drawing::Color::COLOR_GREEN, 0.5f));
57 auto shader = GEXFlowLightSweepShader::CreateDynamicImpl(para);
58
59 ASSERT_EQ(shader, nullptr);
60 }
61
62 /**
63 * @tc.name: GetDescription_001
64 * @tc.desc: Verify function GetDescription
65 * @tc.type:FUNC
66 */
67 HWTEST_F(GEXFlowLightSweepShaderTest, GetDescription_001, TestSize.Level3)
68 {
69 auto shader = std::make_shared<GEXFlowLightSweepShader>();
70 ASSERT_TRUE(shader != nullptr);
71
72 std::string expectStr = "GEXFlowLightSweepShader";
73 EXPECT_EQ(shader->GetDescription(), expectStr);
74 }
75
76 } // namespace GraphicsEffectEngine
77 } // namespace OHOS
78