1 /*
2  * Copyright (c) 2023 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 #include "animation/rs_render_path_animation.h"
18 #include "modifier/rs_render_property.h"
19 #include "render/rs_path.h"
20 
21 using namespace testing;
22 using namespace testing::ext;
23 
24 namespace OHOS::Rosen {
25 class RSRenderPathAnimationTest : public testing::Test {
26 public:
27     static void SetUpTestCase();
28     static void TearDownTestCase();
29     void SetUp() override;
30     void TearDown() override;
31 };
32 
SetUpTestCase()33 void RSRenderPathAnimationTest::SetUpTestCase() {}
TearDownTestCase()34 void RSRenderPathAnimationTest::TearDownTestCase() {}
SetUp()35 void RSRenderPathAnimationTest::SetUp() {}
TearDown()36 void RSRenderPathAnimationTest::TearDown() {}
37 
38 /**
39  * @tc.name: DumpAnimationTypeTest
40  * @tc.desc: test results of DumpAnimationType
41  * @tc.type: FUNC
42  */
HWTEST_F(RSRenderPathAnimationTest,DumpAnimationTypeTest,Level1)43 HWTEST_F(RSRenderPathAnimationTest, DumpAnimationTypeTest, Level1)
44 {
45     auto originPosition = std::make_shared<RSRenderPropertyBase>();
46     auto startPosition = std::make_shared<RSRenderPropertyBase>();
47     auto endPosition = std::make_shared<RSRenderPropertyBase>();
48     auto animationPath = std::make_shared<RSPath>();
49     std::string out = "Out";
50     RSRenderPathAnimation rsRenderPathAnimation(
51         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
52     rsRenderPathAnimation.DumpAnimationType(out);
53     EXPECT_TRUE(true);
54 }
55 
56 /**
57  * @tc.name: SetInterpolatorTest
58  * @tc.desc: test results of SetInterpolator
59  * @tc.type: FUNC
60  */
HWTEST_F(RSRenderPathAnimationTest,SetInterpolatorTest,Level1)61 HWTEST_F(RSRenderPathAnimationTest, SetInterpolatorTest, Level1)
62 {
63     auto originPosition = std::make_shared<RSRenderPropertyBase>();
64     auto startPosition = std::make_shared<RSRenderPropertyBase>();
65     auto endPosition = std::make_shared<RSRenderPropertyBase>();
66     auto animationPath = std::make_shared<RSPath>();
67     float t = 1.0f;
68     RSRenderPathAnimation rsRenderPathAnimation(
69         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
70     rsRenderPathAnimation.SetInterpolator(nullptr);
71     ASSERT_NE(t, 0);
72 }
73 
74 /**
75  * @tc.name: GetInterpolatorTest
76  * @tc.desc: test results of GetInterpolator
77  * @tc.type: FUNC
78  */
HWTEST_F(RSRenderPathAnimationTest,GetInterpolatorTest,Level1)79 HWTEST_F(RSRenderPathAnimationTest, GetInterpolatorTest, Level1)
80 {
81     auto originPosition = std::make_shared<RSRenderPropertyBase>();
82     auto startPosition = std::make_shared<RSRenderPropertyBase>();
83     auto endPosition = std::make_shared<RSRenderPropertyBase>();
84     auto animationPath = std::make_shared<RSPath>();
85     std::shared_ptr<RSInterpolator> res;
86     RSRenderPathAnimation rsRenderPathAnimation(
87         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
88     res = rsRenderPathAnimation.GetInterpolator();
89     ASSERT_EQ(res, RSInterpolator::DEFAULT);
90 }
91 
92 /**
93  * @tc.name: SetRotationModeTest
94  * @tc.desc: test results of SetRotationMode
95  * @tc.type: FUNC
96  */
HWTEST_F(RSRenderPathAnimationTest,SetRotationModeTest,Level1)97 HWTEST_F(RSRenderPathAnimationTest, SetRotationModeTest, Level1)
98 {
99     auto originPosition = std::make_shared<RSRenderPropertyBase>();
100     auto startPosition = std::make_shared<RSRenderPropertyBase>();
101     auto endPosition = std::make_shared<RSRenderPropertyBase>();
102     auto animationPath = std::make_shared<RSPath>();
103     float t = 1.0f;
104     RSRenderPathAnimation rsRenderPathAnimation(
105         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
106     RotationMode rotationMode = RotationMode::ROTATE_NONE;
107     rsRenderPathAnimation.SetRotationMode(rotationMode);
108     ASSERT_NE(t, 0);
109 }
110 
111 /**
112  * @tc.name: GetRotationModeTest
113  * @tc.desc: test results of GetRotationMode
114  * @tc.type: FUNC
115  */
HWTEST_F(RSRenderPathAnimationTest,GetRotationModeTest,Level1)116 HWTEST_F(RSRenderPathAnimationTest, GetRotationModeTest, Level1)
117 {
118     auto originPosition = std::make_shared<RSRenderPropertyBase>();
119     auto startPosition = std::make_shared<RSRenderPropertyBase>();
120     auto endPosition = std::make_shared<RSRenderPropertyBase>();
121     auto animationPath = std::make_shared<RSPath>();
122     RotationMode rotation;
123     RSRenderPathAnimation rsRenderPathAnimation(
124         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
125     rotation = rsRenderPathAnimation.GetRotationMode();
126     ASSERT_EQ(rotation, RotationMode::ROTATE_NONE);
127 }
128 
129 /**
130  * @tc.name: SetBeginFractionTest
131  * @tc.desc: test results of SetBeginFraction
132  * @tc.type: FUNC
133  */
HWTEST_F(RSRenderPathAnimationTest,SetBeginFractionTest,Level1)134 HWTEST_F(RSRenderPathAnimationTest, SetBeginFractionTest, Level1)
135 {
136     auto originPosition = std::make_shared<RSRenderPropertyBase>();
137     auto startPosition = std::make_shared<RSRenderPropertyBase>();
138     auto endPosition = std::make_shared<RSRenderPropertyBase>();
139     auto animationPath = std::make_shared<RSPath>();
140     RSRenderPathAnimation rsRenderPathAnimation(
141         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
142     float fraction = 1.0f;
143     rsRenderPathAnimation.SetBeginFraction(fraction);
144     ASSERT_NE(fraction, 0);
145 }
146 
147 /**
148  * @tc.name: GetBeginFractionTest
149  * @tc.desc: test results of GetBeginFraction
150  * @tc.type: FUNC
151  */
HWTEST_F(RSRenderPathAnimationTest,GetBeginFractionTest,Level1)152 HWTEST_F(RSRenderPathAnimationTest, GetBeginFractionTest, Level1)
153 {
154     auto originPosition = std::make_shared<RSRenderPropertyBase>();
155     auto startPosition = std::make_shared<RSRenderPropertyBase>();
156     auto endPosition = std::make_shared<RSRenderPropertyBase>();
157     auto animationPath = std::make_shared<RSPath>();
158     RSRenderPathAnimation rsRenderPathAnimation(
159         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
160     float res = rsRenderPathAnimation.GetBeginFraction();
161     ASSERT_EQ(res, res);
162 }
163 
164 /**
165  * @tc.name: SetEndFractionTest
166  * @tc.desc: test results of SetEndFraction
167  * @tc.type: FUNC
168  */
HWTEST_F(RSRenderPathAnimationTest,SetEndFractionTest,Level1)169 HWTEST_F(RSRenderPathAnimationTest, SetEndFractionTest, Level1)
170 {
171     auto originPosition = std::make_shared<RSRenderPropertyBase>();
172     auto startPosition = std::make_shared<RSRenderPropertyBase>();
173     auto endPosition = std::make_shared<RSRenderPropertyBase>();
174     auto animationPath = std::make_shared<RSPath>();
175     RSRenderPathAnimation rsRenderPathAnimation(
176         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
177     float fraction = 1.0f;
178     rsRenderPathAnimation.SetEndFraction(fraction);
179     ASSERT_NE(fraction, 0);
180 }
181 
182 /**
183  * @tc.name: GetEndFractionTest
184  * @tc.desc: test results of GetEndFraction
185  * @tc.type: FUNC
186  */
HWTEST_F(RSRenderPathAnimationTest,GetEndFractionTest,Level1)187 HWTEST_F(RSRenderPathAnimationTest, GetEndFractionTest, Level1)
188 {
189     auto originPosition = std::make_shared<RSRenderPropertyBase>();
190     auto startPosition = std::make_shared<RSRenderPropertyBase>();
191     auto endPosition = std::make_shared<RSRenderPropertyBase>();
192     auto animationPath = std::make_shared<RSPath>();
193     RSRenderPathAnimation rsRenderPathAnimation(
194         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
195     float res = rsRenderPathAnimation.GetEndFraction();
196     ASSERT_NE(res, 0);
197 }
198 
199 /**
200  * @tc.name: SetIsNeedPathTest
201  * @tc.desc: test results of SetIsNeedPath
202  * @tc.type: FUNC
203  */
HWTEST_F(RSRenderPathAnimationTest,SetIsNeedPathTest,Level1)204 HWTEST_F(RSRenderPathAnimationTest, SetIsNeedPathTest, Level1)
205 {
206     auto originPosition = std::make_shared<RSRenderPropertyBase>();
207     auto startPosition = std::make_shared<RSRenderPropertyBase>();
208     auto endPosition = std::make_shared<RSRenderPropertyBase>();
209     auto animationPath = std::make_shared<RSPath>();
210     RSRenderPathAnimation rsRenderPathAnimation(
211         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
212     bool isNeedPath = true;
213     rsRenderPathAnimation.SetIsNeedPath(isNeedPath);
214     ASSERT_NE(isNeedPath, false);
215 
216 }
217 
218 /**
219  * @tc.name: SetPathNeedAddOriginTest
220  * @tc.desc: test results of SetPathNeedAddOrigin
221  * @tc.type: FUNC
222  */
HWTEST_F(RSRenderPathAnimationTest,SetPathNeedAddOriginTest,Level1)223 HWTEST_F(RSRenderPathAnimationTest, SetPathNeedAddOriginTest, Level1)
224 {
225     auto originPosition = std::make_shared<RSRenderPropertyBase>();
226     auto startPosition = std::make_shared<RSRenderPropertyBase>();
227     auto endPosition = std::make_shared<RSRenderPropertyBase>();
228     auto animationPath = std::make_shared<RSPath>();
229     RSRenderPathAnimation rsRenderPathAnimation(
230         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
231     bool needAddOrigin = true;
232     rsRenderPathAnimation.SetPathNeedAddOrigin(needAddOrigin);
233     ASSERT_NE(needAddOrigin, false);
234 }
235 
236 /**
237  * @tc.name: SetRotationIdTest
238  * @tc.desc: test results of SetRotationId
239  * @tc.type: FUNC
240  */
HWTEST_F(RSRenderPathAnimationTest,SetRotationIdTest,Level1)241 HWTEST_F(RSRenderPathAnimationTest, SetRotationIdTest, Level1)
242 {
243     auto originPosition = std::make_shared<RSRenderPropertyBase>();
244     auto startPosition = std::make_shared<RSRenderPropertyBase>();
245     auto endPosition = std::make_shared<RSRenderPropertyBase>();
246     auto animationPath = std::make_shared<RSPath>();
247     RSRenderPathAnimation rsRenderPathAnimation(
248         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
249     PropertyId rotationId_ = 0;
250     rsRenderPathAnimation.SetRotationId(rotationId_);
251     ASSERT_NE(rotationId_, 1);
252 }
253 
254 /**
255  * @tc.name: MarshallingTest
256  * @tc.desc: test results of Marshalling
257  * @tc.type: FUNC
258  */
HWTEST_F(RSRenderPathAnimationTest,MarshallingTest,Level1)259 HWTEST_F(RSRenderPathAnimationTest, MarshallingTest, Level1)
260 {
261     auto originPosition = std::make_shared<RSRenderPropertyBase>();
262     auto startPosition = std::make_shared<RSRenderPropertyBase>();
263     auto endPosition = std::make_shared<RSRenderPropertyBase>();
264     auto animationPath = std::make_shared<RSPath>();
265     RSRenderPathAnimation rsRenderPathAnimation(
266         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
267     Parcel parcel;
268     bool res = rsRenderPathAnimation.Marshalling(parcel);
269     ASSERT_NE(res, true);
270 }
271 
272 /**
273  * @tc.name: UnmarshallingTest
274  * @tc.desc: test results of Unmarshalling
275  * @tc.type: FUNC
276  */
HWTEST_F(RSRenderPathAnimationTest,UnmarshallingTest,Level1)277 HWTEST_F(RSRenderPathAnimationTest, UnmarshallingTest, Level1)
278 {
279     auto originPosition = std::make_shared<RSRenderPropertyBase>();
280     auto startPosition = std::make_shared<RSRenderPropertyBase>();
281     auto endPosition = std::make_shared<RSRenderPropertyBase>();
282     auto animationPath = std::make_shared<RSPath>();
283     RSRenderPathAnimation rsRenderPathAnimation(
284         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
285     Parcel parcel;
286     RSRenderPathAnimation* render;
287     render = rsRenderPathAnimation.Unmarshalling(parcel);
288     ASSERT_EQ(render, nullptr);
289 }
290 
291 /**
292  * @tc.name: ParseParamTest
293  * @tc.desc: test results of ParseParam
294  * @tc.type: FUNC
295  */
HWTEST_F(RSRenderPathAnimationTest,ParseParamTest,Level1)296 HWTEST_F(RSRenderPathAnimationTest, ParseParamTest, Level1)
297 {
298     auto originPosition = std::make_shared<RSRenderPropertyBase>();
299     auto startPosition = std::make_shared<RSRenderPropertyBase>();
300     auto endPosition = std::make_shared<RSRenderPropertyBase>();
301     auto animationPath = std::make_shared<RSPath>();
302     RSRenderPathAnimation rsRenderPathAnimation(
303         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
304     Parcel parcel;
305     bool res = rsRenderPathAnimation.ParseParam(parcel);
306     ASSERT_EQ(res, false);
307 }
308 
309 /**
310  * @tc.name: OnRemoveOnCompletionTest
311  * @tc.desc: test results of OnRemoveOnCompletion
312  * @tc.type: FUNC
313  */
HWTEST_F(RSRenderPathAnimationTest,OnRemoveOnCompletionTest,Level1)314 HWTEST_F(RSRenderPathAnimationTest, OnRemoveOnCompletionTest, Level1)
315 {
316     auto originPosition = std::make_shared<RSRenderPropertyBase>();
317     auto startPosition = std::make_shared<RSRenderPropertyBase>();
318     auto endPosition = std::make_shared<RSRenderPropertyBase>();
319     auto animationPath = std::make_shared<RSPath>();
320     RSRenderPathAnimation rsRenderPathAnimation(
321         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
322     rsRenderPathAnimation.OnRemoveOnCompletion();
323     EXPECT_EQ(rsRenderPathAnimation.isNeedPath_, true);
324 }
325 
326 /**
327  * @tc.name: OnAttachTest
328  * @tc.desc: test results of OnAttach
329  * @tc.type: FUNC
330  */
HWTEST_F(RSRenderPathAnimationTest,OnAttachTest,Level1)331 HWTEST_F(RSRenderPathAnimationTest, OnAttachTest, Level1)
332 {
333     auto originPosition = std::make_shared<RSRenderPropertyBase>();
334     auto startPosition = std::make_shared<RSRenderPropertyBase>();
335     auto endPosition = std::make_shared<RSRenderPropertyBase>();
336     auto animationPath = std::make_shared<RSPath>();
337     RSRenderPathAnimation rsRenderPathAnimation(
338         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
339     rsRenderPathAnimation.OnAttach();
340     EXPECT_EQ(rsRenderPathAnimation.isNeedPath_, true);
341 }
342 
343 /**
344  * @tc.name: OnDetachTest
345  * @tc.desc: test results of OnDetach
346  * @tc.type: FUNC
347  */
HWTEST_F(RSRenderPathAnimationTest,OnDetachTest,Level1)348 HWTEST_F(RSRenderPathAnimationTest, OnDetachTest, Level1)
349 {
350     auto originPosition = std::make_shared<RSRenderPropertyBase>();
351     auto startPosition = std::make_shared<RSRenderPropertyBase>();
352     auto endPosition = std::make_shared<RSRenderPropertyBase>();
353     auto animationPath = std::make_shared<RSPath>();
354     RSRenderPathAnimation rsRenderPathAnimation(
355         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
356     rsRenderPathAnimation.OnDetach();
357     EXPECT_EQ(rsRenderPathAnimation.isNeedPath_, true);
358 }
359 
360 /**
361  * @tc.name: SetPathValueTest001
362  * @tc.desc: test results of SetPathValue
363  * @tc.type: FUNC
364  */
HWTEST_F(RSRenderPathAnimationTest,SetPathValueTest001,Level1)365 HWTEST_F(RSRenderPathAnimationTest, SetPathValueTest001, Level1)
366 {
367     auto originPosition = std::make_shared<RSRenderPropertyBase>();
368     auto startPosition = std::make_shared<RSRenderPropertyBase>();
369     auto endPosition = std::make_shared<RSRenderPropertyBase>();
370     auto animationPath = std::make_shared<RSPath>();
371     RSRenderPathAnimation rsRenderPathAnimation(
372         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
373     Vector2f value;
374     float tangent = 0.f;
375     rsRenderPathAnimation.SetPathValue(value, tangent);
376     EXPECT_EQ(tangent, 0.f);
377 }
378 
379 /**
380  * @tc.name: SetPathValueTest002
381  * @tc.desc: test results of SetPathValue
382  * @tc.type: FUNC
383  */
HWTEST_F(RSRenderPathAnimationTest,SetPathValueTest002,Level1)384 HWTEST_F(RSRenderPathAnimationTest, SetPathValueTest002, Level1)
385 {
386     auto originPosition = std::make_shared<RSRenderPropertyBase>();
387     auto startPosition = std::make_shared<RSRenderPropertyBase>();
388     auto endPosition = std::make_shared<RSRenderPropertyBase>();
389     auto animationPath = std::make_shared<RSPath>();
390     RSRenderPathAnimation rsRenderPathAnimation(
391         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
392     Vector4f value;
393     float tangent = 0.f;
394     rsRenderPathAnimation.SetPathValue(value, tangent);
395     EXPECT_EQ(tangent, 0.f);
396 }
397 
398 /**
399  * @tc.name: SetRotationValueTest
400  * @tc.desc: test results of SetRotationValue
401  * @tc.type: FUNC
402  */
HWTEST_F(RSRenderPathAnimationTest,SetRotationValueTest,Level1)403 HWTEST_F(RSRenderPathAnimationTest, SetRotationValueTest, Level1)
404 {
405     auto originPosition = std::make_shared<RSRenderPropertyBase>();
406     auto startPosition = std::make_shared<RSRenderPropertyBase>();
407     auto endPosition = std::make_shared<RSRenderPropertyBase>();
408     auto animationPath = std::make_shared<RSPath>();
409     RSRenderPathAnimation animation(
410         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
411     float tangent = 0.f;
412     animation.SetRotationValue(tangent);
413 
414     animation.SetRotationMode(RotationMode::ROTATE_AUTO);
415     animation.SetRotationValue(tangent);
416     EXPECT_EQ(animation.GetRotationMode(), RotationMode::ROTATE_AUTO);
417 
418     animation.SetRotationMode(RotationMode::ROTATE_AUTO_REVERSE);
419     animation.SetRotationValue(tangent);
420     EXPECT_EQ(animation.GetRotationMode(), RotationMode::ROTATE_AUTO_REVERSE);
421 
422     animation.SetRotationMode(RotationMode::ROTATE_NONE);
423     animation.SetRotationValue(tangent);
424     EXPECT_EQ(animation.GetRotationMode(), RotationMode::ROTATE_NONE);
425 }
426 
427 /**
428  * @tc.name: SetRotationTest
429  * @tc.desc: test results of SetRotation
430  * @tc.type: FUNC
431  */
HWTEST_F(RSRenderPathAnimationTest,SetRotationTest,Level1)432 HWTEST_F(RSRenderPathAnimationTest, SetRotationTest, Level1)
433 {
434     auto originPosition = std::make_shared<RSRenderPropertyBase>();
435     auto startPosition = std::make_shared<RSRenderPropertyBase>();
436     auto endPosition = std::make_shared<RSRenderPropertyBase>();
437     auto animationPath = std::make_shared<RSPath>();
438     RSRenderPathAnimation rsRenderPathAnimation(
439         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
440     float tangent = 0.f;
441     rsRenderPathAnimation.SetRotation(tangent);
442     EXPECT_EQ(tangent, 0.f);
443 }
444 
445 /**
446  * @tc.name: GetPosTanValueTest
447  * @tc.desc: test results of GetPosTanValue
448  * @tc.type: FUNC
449  */
HWTEST_F(RSRenderPathAnimationTest,GetPosTanValueTest,Level1)450 HWTEST_F(RSRenderPathAnimationTest, GetPosTanValueTest, Level1)
451 {
452     auto originPosition = std::make_shared<RSRenderPropertyBase>();
453     auto startPosition = std::make_shared<RSRenderPropertyBase>();
454     auto endPosition = std::make_shared<RSRenderPropertyBase>();
455     auto animationPath = std::make_shared<RSPath>();
456     RSRenderPathAnimation rsRenderPathAnimation(
457         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
458     float fraction = 0.f;
459     Vector2f position;
460     float tangent = 0.f;
461     rsRenderPathAnimation.GetPosTanValue(fraction, position, tangent);
462     EXPECT_EQ(tangent, 0.f);
463 }
464 
465 /**
466  * @tc.name: UpdateVector2fPathValueTest
467  * @tc.desc: test results of UpdateVector2fPathValue
468  * @tc.type: FUNC
469  */
HWTEST_F(RSRenderPathAnimationTest,UpdateVector2fPathValueTest,Level1)470 HWTEST_F(RSRenderPathAnimationTest, UpdateVector2fPathValueTest, Level1)
471 {
472     auto originPosition = std::make_shared<RSRenderPropertyBase>();
473     auto startPosition = std::make_shared<RSRenderPropertyBase>();
474     auto endPosition = std::make_shared<RSRenderPropertyBase>();
475     auto animationPath = std::make_shared<RSPath>();
476     RSRenderPathAnimation rsRenderPathAnimation(
477         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
478     Vector2f value;
479     rsRenderPathAnimation.SetPathNeedAddOrigin(true);
480     rsRenderPathAnimation.UpdateVector2fPathValue(value);
481     EXPECT_EQ(rsRenderPathAnimation.needAddOrigin_, true);
482 }
483 
484 /**
485  * @tc.name: UpdateVector4fPathValueTest
486  * @tc.desc: test results of UpdateVector4fPathValue
487  * @tc.type: FUNC
488  */
HWTEST_F(RSRenderPathAnimationTest,UpdateVector4fPathValueTest,Level1)489 HWTEST_F(RSRenderPathAnimationTest, UpdateVector4fPathValueTest, Level1)
490 {
491     auto originPosition = std::make_shared<RSRenderPropertyBase>();
492     auto startPosition = std::make_shared<RSRenderPropertyBase>();
493     auto endPosition = std::make_shared<RSRenderPropertyBase>();
494     auto animationPath = std::make_shared<RSPath>();
495     RSRenderPathAnimation rsRenderPathAnimation(
496         0, 0, originPosition, startPosition, endPosition, 0.f, animationPath);
497     Vector4f value;
498     Vector2f position;
499     rsRenderPathAnimation.SetPathNeedAddOrigin(true);
500     rsRenderPathAnimation.UpdateVector4fPathValue(value, position);
501     EXPECT_EQ(rsRenderPathAnimation.needAddOrigin_, true);
502 }
503 }
504