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 "gtest/gtest.h"
17
18 #include "draw/path.h"
19
20 using namespace testing;
21 using namespace testing::ext;
22
23 namespace OHOS {
24 namespace Rosen {
25 namespace Drawing {
26 class PathTest : public testing::Test {
27 public:
28 static void SetUpTestCase();
29 static void TearDownTestCase();
30 void SetUp() override;
31 void TearDown() override;
32 };
33
SetUpTestCase()34 void PathTest::SetUpTestCase() {}
TearDownTestCase()35 void PathTest::TearDownTestCase() {}
SetUp()36 void PathTest::SetUp() {}
TearDown()37 void PathTest::TearDown() {}
38
39 /**
40 * @tc.name: CreateAndDestroy001
41 * @tc.desc:
42 * @tc.type: FUNC
43 * @tc.require: AR000GGNV3
44 * @tc.author:
45 */
46 HWTEST_F(PathTest, CreateAndDestroy001, TestSize.Level1)
47 {
48 auto path = std::make_unique<Path>();
49 ASSERT_TRUE(path != nullptr);
50 }
51
52 /**
53 * @tc.name: MoveTo001
54 * @tc.desc:
55 * @tc.type: FUNC
56 * @tc.require: AR000GGNV3
57 * @tc.author:
58 */
59 HWTEST_F(PathTest, MoveTo001, TestSize.Level1)
60 {
61 auto path = std::make_unique<Path>();
62 ASSERT_TRUE(path != nullptr);
63 path->MoveTo(5.0f, 4.5f);
64 }
65
66 /**
67 * @tc.name: MoveTo002
68 * @tc.desc:
69 * @tc.type: FUNC
70 * @tc.require: AR000GGNV3
71 * @tc.author:
72 */
73 HWTEST_F(PathTest, MoveTo002, TestSize.Level1)
74 {
75 auto path = std::make_unique<Path>();
76 ASSERT_TRUE(path != nullptr);
77 path->MoveTo(4.5f, 5.0f);
78 }
79
80 /**
81 * @tc.name: LineTo001
82 * @tc.desc:
83 * @tc.type: FUNC
84 * @tc.require: AR000GGNV3
85 * @tc.author:
86 */
87 HWTEST_F(PathTest, LineTo001, TestSize.Level1)
88 {
89 auto path = std::make_unique<Path>();
90 ASSERT_TRUE(path != nullptr);
91 path->LineTo(4.5f, 5.0f);
92 }
93
94 /**
95 * @tc.name: LineTo002
96 * @tc.desc:
97 * @tc.type: FUNC
98 * @tc.require: AR000GGNV3
99 * @tc.author:
100 */
101 HWTEST_F(PathTest, LineTo002, TestSize.Level1)
102 {
103 auto path = std::make_unique<Path>();
104 ASSERT_TRUE(path != nullptr);
105 path->LineTo(1.0f, 3.0f);
106 }
107
108 /**
109 * @tc.name: ArcTo001
110 * @tc.desc:
111 * @tc.type: FUNC
112 * @tc.require: AR000GGNV3
113 * @tc.author:
114 */
115 HWTEST_F(PathTest, ArcTo001, TestSize.Level1)
116 {
117 auto path = std::make_unique<Path>();
118 ASSERT_TRUE(path != nullptr);
119 path->ArcTo(1.0f, 3.0f, 2.2f, 2.3f, 0.0f, 5.0f);
120 }
121
122 /**
123 * @tc.name: ArcTo002
124 * @tc.desc:
125 * @tc.type: FUNC
126 * @tc.require: AR000GGNV3
127 * @tc.author:
128 */
129 HWTEST_F(PathTest, ArcTo002, TestSize.Level1)
130 {
131 auto path = std::make_unique<Path>();
132 ASSERT_TRUE(path != nullptr);
133 path->ArcTo(1.0f, 3.0f, 2.5f, 2.4f, 1.0f, 3.0f);
134 }
135
136 /**
137 * @tc.name: ArcToWith6001
138 * @tc.desc:
139 * @tc.type: FUNC
140 * @tc.require: AR000GGNV3
141 * @tc.author:
142 */
143 HWTEST_F(PathTest, ArcToWith6001, TestSize.Level1)
144 {
145 auto path = std::make_unique<Path>();
146 ASSERT_TRUE(path != nullptr);
147 Point point1;
148 Point point2;
149 path->ArcTo(point1, point2, 2.5f, 2.4f);
150 }
151
152 /**
153 * @tc.name: ArcToWith6002
154 * @tc.desc:
155 * @tc.type: FUNC
156 * @tc.require: AR000GGNV3
157 * @tc.author:
158 */
159 HWTEST_F(PathTest, ArcToWith6002, TestSize.Level1)
160 {
161 auto path = std::make_unique<Path>();
162 ASSERT_TRUE(path != nullptr);
163 Point point1;
164 Point point2;
165 path->ArcTo(point1, point2, 2.5f, 2.0f);
166 }
167
168 /**
169 * @tc.name: CubicTo001
170 * @tc.desc:
171 * @tc.type: FUNC
172 * @tc.require: AR000GGNV3
173 * @tc.author:
174 */
175 HWTEST_F(PathTest, CubicTo001, TestSize.Level1)
176 {
177 auto path = std::make_unique<Path>();
178 ASSERT_TRUE(path != nullptr);
179 path->CubicTo(1.0f, 2.3f, 2.5f, 2.0f, 3.5f, 3.0f);
180 }
181
182 /**
183 * @tc.name: CubicTo002
184 * @tc.desc:
185 * @tc.type: FUNC
186 * @tc.require: AR000GGNV3
187 * @tc.author:
188 */
189 HWTEST_F(PathTest, CubicTo002, TestSize.Level1)
190 {
191 auto path = std::make_unique<Path>();
192 ASSERT_TRUE(path != nullptr);
193 path->CubicTo(1.0f, 2.3f, 1.4f, 2.0f, 1.5f, 3.0f);
194 }
195
196 /**
197 * @tc.name: CubicTo2001
198 * @tc.desc:
199 * @tc.type: FUNC
200 * @tc.require: AR000GGNV3
201 * @tc.author:
202 */
203 HWTEST_F(PathTest, CubicTo2001, TestSize.Level1)
204 {
205 auto path = std::make_unique<Path>();
206 ASSERT_TRUE(path != nullptr);
207 Point point1;
208 Point point2;
209 Point endPoint(2.3f, 1.5f);
210 path->CubicTo(point1, point2, endPoint);
211 }
212
213 /**
214 * @tc.name: CubicTo2002
215 * @tc.desc:
216 * @tc.type: FUNC
217 * @tc.require: AR000GGNV3
218 * @tc.author:
219 */
220 HWTEST_F(PathTest, CubicTo2002, TestSize.Level1)
221 {
222 auto path = std::make_unique<Path>();
223 ASSERT_TRUE(path != nullptr);
224 Point point1(1.2f, 0.0f);
225 Point point2(1.3f, 1.0f);
226 Point endPoint(2.3f, 1.5f);
227 path->CubicTo(point1, point2, endPoint);
228 }
229
230 /**
231 * @tc.name: QuadTo2001
232 * @tc.desc:
233 * @tc.type: FUNC
234 * @tc.require: AR000GGNV3
235 * @tc.author:
236 */
237 HWTEST_F(PathTest, QuadTo2001, TestSize.Level1)
238 {
239 auto path = std::make_unique<Path>();
240 ASSERT_TRUE(path != nullptr);
241 Point point1(1.2f, 0.0f);
242 Point endPoint(2.3f, 1.5f);
243 path->QuadTo(point1, endPoint);
244 }
245
246 /**
247 * @tc.name: QuadTo2002
248 * @tc.desc:
249 * @tc.type: FUNC
250 * @tc.require: AR000GGNV3
251 * @tc.author:
252 */
253 HWTEST_F(PathTest, QuadTo2002, TestSize.Level1)
254 {
255 auto path = std::make_unique<Path>();
256 ASSERT_TRUE(path != nullptr);
257 Point point1(0.5f, 0.3f);
258 Point endPoint(3.5f, 3.3f);
259 path->QuadTo(point1, endPoint);
260 }
261
262 /**
263 * @tc.name: QuadTo4001
264 * @tc.desc:
265 * @tc.type: FUNC
266 * @tc.require: AR000GGNV3
267 * @tc.author:
268 */
269 HWTEST_F(PathTest, QuadTo4001, TestSize.Level1)
270 {
271 auto path = std::make_unique<Path>();
272 ASSERT_TRUE(path != nullptr);
273 path->QuadTo(1.0f, 1.5f, 3.3f, 4.5f);
274 }
275
276 /**
277 * @tc.name: QuadTo4002
278 * @tc.desc:
279 * @tc.type: FUNC
280 * @tc.require: AR000GGNV3
281 * @tc.author:
282 */
283 HWTEST_F(PathTest, QuadTo4002, TestSize.Level1)
284 {
285 auto path = std::make_unique<Path>();
286 ASSERT_TRUE(path != nullptr);
287 path->QuadTo(1.0f, 1.2f, 3.0f, 4.0f);
288 }
289
290 /**
291 * @tc.name: AddRect2001
292 * @tc.desc:
293 * @tc.type: FUNC
294 * @tc.require: AR000GGNV3
295 * @tc.author:
296 */
297 HWTEST_F(PathTest, AddRect2001, TestSize.Level1)
298 {
299 auto path = std::make_unique<Path>();
300 ASSERT_TRUE(path != nullptr);
301 Rect rect;
302 path->AddRect(rect);
303 }
304
305 /**
306 * @tc.name: AddRect2002
307 * @tc.desc:
308 * @tc.type: FUNC
309 * @tc.require: AR000GGNV3
310 * @tc.author:
311 */
312 HWTEST_F(PathTest, AddRect2002, TestSize.Level1)
313 {
314 auto path = std::make_unique<Path>();
315 ASSERT_TRUE(path != nullptr);
316 Rect rect;
317 path->AddRect(rect, PathDirection::CCW_DIRECTION);
318 }
319
320 /**
321 * @tc.name: AddRect5001
322 * @tc.desc:
323 * @tc.type: FUNC
324 * @tc.require: AR000GGNV3
325 * @tc.author:
326 */
327 HWTEST_F(PathTest, AddRect5001, TestSize.Level1)
328 {
329 auto path = std::make_unique<Path>();
330 ASSERT_TRUE(path != nullptr);
331 path->AddRect(1.0f, 4.0f, 3.0f, 2.0f, PathDirection::CCW_DIRECTION);
332 }
333
334 /**
335 * @tc.name: AddRect5002
336 * @tc.desc:
337 * @tc.type: FUNC
338 * @tc.require: AR000GGNV3
339 * @tc.author:
340 */
341 HWTEST_F(PathTest, AddRect5002, TestSize.Level1)
342 {
343 auto path = std::make_unique<Path>();
344 ASSERT_TRUE(path != nullptr);
345 path->AddRect(1.0f, 4.0f, 3.0f, 2.0f);
346 }
347
348 /**
349 * @tc.name: AddOval001
350 * @tc.desc:
351 * @tc.type: FUNC
352 * @tc.require: AR000GGNV3
353 * @tc.author:
354 */
355 HWTEST_F(PathTest, AddOval001, TestSize.Level1)
356 {
357 auto path = std::make_unique<Path>();
358 ASSERT_TRUE(path != nullptr);
359 Rect oval;
360 path->AddOval(oval, PathDirection::CCW_DIRECTION);
361 }
362
363 /**
364 * @tc.name: AddOval002
365 * @tc.desc:
366 * @tc.type: FUNC
367 * @tc.require: AR000GGNV3
368 * @tc.author:
369 */
370 HWTEST_F(PathTest, AddOval002, TestSize.Level1)
371 {
372 auto path = std::make_unique<Path>();
373 ASSERT_TRUE(path != nullptr);
374 Rect oval;
375 path->AddOval(oval);
376 }
377
378 /**
379 * @tc.name: AddArc001
380 * @tc.desc:
381 * @tc.type: FUNC
382 * @tc.require: AR000GGNV3
383 * @tc.author:
384 */
385 HWTEST_F(PathTest, AddArc001, TestSize.Level1)
386 {
387 auto path = std::make_unique<Path>();
388 ASSERT_TRUE(path != nullptr);
389 Rect rect;
390 path->AddArc(rect, 1.0f, 2.0f);
391 }
392
393 /**
394 * @tc.name: AddArc002
395 * @tc.desc:
396 * @tc.type: FUNC
397 * @tc.require: AR000GGNV3
398 * @tc.author:
399 */
400 HWTEST_F(PathTest, AddArc002, TestSize.Level1)
401 {
402 auto path = std::make_unique<Path>();
403 ASSERT_TRUE(path != nullptr);
404 Rect rect;
405 path->AddArc(rect, 2.0f, 1.0f);
406 }
407
408 /**
409 * @tc.name: AddPoly001
410 * @tc.desc:
411 * @tc.type: FUNC
412 * @tc.require: AR000GGNV3
413 * @tc.author:
414 */
415 HWTEST_F(PathTest, AddPoly001, TestSize.Level1)
416 {
417 auto path = std::make_unique<Path>();
418 ASSERT_TRUE(path != nullptr);
419 std::vector<Point> points;
420 Point point1;
421 points.push_back(point1);
422 int size = points.size();
423 path->AddPoly(points, size, false);
424 }
425
426 /**
427 * @tc.name: AddPoly002
428 * @tc.desc:
429 * @tc.type: FUNC
430 * @tc.require: AR000GGNV3
431 * @tc.author:
432 */
433 HWTEST_F(PathTest, AddPoly002, TestSize.Level1)
434 {
435 auto path = std::make_unique<Path>();
436 ASSERT_TRUE(path != nullptr);
437 std::vector<Point> points;
438 Point point1;
439 Point point2;
440 points.push_back(point1);
441 points.push_back(point2);
442 int size = points.size();
443 path->AddPoly(points, size, true);
444 }
445
446 /**
447 * @tc.name: AddCircle001
448 * @tc.desc:
449 * @tc.type: FUNC
450 * @tc.require: AR000GGNV3
451 * @tc.author:
452 */
453 HWTEST_F(PathTest, AddCircle001, TestSize.Level1)
454 {
455 auto path = std::make_unique<Path>();
456 ASSERT_TRUE(path != nullptr);
457 path->AddCircle(1.0f, 0.5f, 0.5f);
458 }
459
460 /**
461 * @tc.name: AddCircle002
462 * @tc.desc:
463 * @tc.type: FUNC
464 * @tc.require: AR000GGNV3
465 * @tc.author:
466 */
467 HWTEST_F(PathTest, AddCircle002, TestSize.Level1)
468 {
469 auto path = std::make_unique<Path>();
470 ASSERT_TRUE(path != nullptr);
471 path->AddCircle(1.0f, 0.5f, 0.5f, PathDirection::CCW_DIRECTION);
472 }
473
474 /**
475 * @tc.name: AddRoundRect001
476 * @tc.desc:
477 * @tc.type: FUNC
478 * @tc.require: AR000GGNV3
479 * @tc.author:
480 */
481 HWTEST_F(PathTest, AddRoundRect001, TestSize.Level1)
482 {
483 auto path = std::make_unique<Path>();
484 ASSERT_TRUE(path != nullptr);
485 Rect rect;
486 path->AddRoundRect(rect, 0.5f, 0.5f, PathDirection::CCW_DIRECTION);
487 }
488
489 /**
490 * @tc.name: AddRoundRect002
491 * @tc.desc:
492 * @tc.type: FUNC
493 * @tc.require: AR000GGNV3
494 * @tc.author:
495 */
496 HWTEST_F(PathTest, AddRoundRect002, TestSize.Level1)
497 {
498 auto path = std::make_unique<Path>();
499 ASSERT_TRUE(path != nullptr);
500 Rect rect;
501 path->AddRoundRect(rect, 0.5f, 0.5f);
502 }
503
504 /**
505 * @tc.name: AddPath3001
506 * @tc.desc:
507 * @tc.type: FUNC
508 * @tc.require: AR000GGNV3
509 * @tc.author:
510 */
511 HWTEST_F(PathTest, AddPath3001, TestSize.Level1)
512 {
513 auto path = std::make_unique<Path>();
514 ASSERT_TRUE(path != nullptr);
515 Path sourcePath;
516 path->AddPath(sourcePath, 0.5f, 0.5f);
517 }
518
519 /**
520 * @tc.name: AddPath3002
521 * @tc.desc:
522 * @tc.type: FUNC
523 * @tc.require: AR000GGNV3
524 * @tc.author:
525 */
526 HWTEST_F(PathTest, AddPath3002, TestSize.Level1)
527 {
528 auto path = std::make_unique<Path>();
529 ASSERT_TRUE(path != nullptr);
530 Path sourcePath;
531 path->AddPath(sourcePath, 1.0f, 1.0f);
532 }
533
534 /**
535 * @tc.name: AddPath1001
536 * @tc.desc:
537 * @tc.type: FUNC
538 * @tc.require: AR000GGNV3
539 * @tc.author:
540 */
541 HWTEST_F(PathTest, AddPath1001, TestSize.Level1)
542 {
543 auto path = std::make_unique<Path>();
544 ASSERT_TRUE(path != nullptr);
545 Path sourcePath;
546 path->AddPath(sourcePath);
547 }
548
549 /**
550 * @tc.name: AddPath2001
551 * @tc.desc:
552 * @tc.type: FUNC
553 * @tc.require: AR000GGNV3
554 * @tc.author:
555 */
556 HWTEST_F(PathTest, AddPath2001, TestSize.Level1)
557 {
558 auto path = std::make_unique<Path>();
559 ASSERT_TRUE(path != nullptr);
560 Path path1;
561 Matrix matrix;
562 path->AddPath(path1, matrix);
563 }
564
565 /**
566 * @tc.name: AddPath2002
567 * @tc.desc:
568 * @tc.type: FUNC
569 * @tc.require: AR000GGNV3
570 * @tc.author:
571 */
572 HWTEST_F(PathTest, AddPath2002, TestSize.Level1)
573 {
574 auto path = std::make_unique<Path>();
575 ASSERT_TRUE(path != nullptr);
576 Path path1;
577 Matrix matrix;
578 path->AddPath(path1, matrix);
579 }
580
581 /**
582 * @tc.name: GetBounds001
583 * @tc.desc:
584 * @tc.type: FUNC
585 * @tc.require: AR000GGNV3
586 * @tc.author:
587 */
588 HWTEST_F(PathTest, GetBounds001, TestSize.Level1)
589 {
590 auto path = std::make_unique<Path>();
591 ASSERT_TRUE(path != nullptr);
592 auto rect = path->GetBounds();
593 }
594
595 /**
596 * @tc.name: SetFillStyle001
597 * @tc.desc:
598 * @tc.type: FUNC
599 * @tc.require: AR000GGNV3
600 * @tc.author:
601 */
602 HWTEST_F(PathTest, SetFillStyle001, TestSize.Level1)
603 {
604 auto path = std::make_unique<Path>();
605 ASSERT_TRUE(path != nullptr);
606 path->SetFillStyle(PathFillType::WINDING);
607 }
608
609 /**
610 * @tc.name: SetFillStyle002
611 * @tc.desc:
612 * @tc.type: FUNC
613 * @tc.require: AR000GGNV3
614 * @tc.author:
615 */
616 HWTEST_F(PathTest, SetFillStyle002, TestSize.Level1)
617 {
618 auto path = std::make_unique<Path>();
619 ASSERT_TRUE(path != nullptr);
620 path->SetFillStyle(PathFillType::INVERSE_WINDING);
621 }
622
623 /**
624 * @tc.name: Interpolate001
625 * @tc.desc:
626 * @tc.type: FUNC
627 * @tc.require: AR000GGNV3
628 * @tc.author:
629 */
630 HWTEST_F(PathTest, Interpolate001, TestSize.Level1)
631 {
632 auto path = std::make_unique<Path>();
633 ASSERT_TRUE(path != nullptr);
634 Path ending;
635 Path out;
636 path->Interpolate(ending, 0.5f, out);
637 }
638
639 /**
640 * @tc.name: Interpolate002
641 * @tc.desc:
642 * @tc.type: FUNC
643 * @tc.require: AR000GGNV3
644 * @tc.author:
645 */
646 HWTEST_F(PathTest, Interpolate002, TestSize.Level1)
647 {
648 auto path = std::make_unique<Path>();
649 ASSERT_TRUE(path != nullptr);
650 Path ending;
651 Path out;
652 path->Interpolate(ending, 0.2f, out);
653 }
654
655 /**
656 * @tc.name: Transform001
657 * @tc.desc:
658 * @tc.type: FUNC
659 * @tc.require: AR000GGNV3
660 * @tc.author:
661 */
662 HWTEST_F(PathTest, Transform001, TestSize.Level1)
663 {
664 auto path = std::make_unique<Path>();
665 ASSERT_TRUE(path != nullptr);
666 Matrix matrix;
667 path->Transform(matrix);
668 }
669
670 /**
671 * @tc.name: Offset001
672 * @tc.desc:
673 * @tc.type: FUNC
674 * @tc.require: AR000GGNV3
675 * @tc.author:
676 */
677 HWTEST_F(PathTest, Offset001, TestSize.Level1)
678 {
679 auto path = std::make_unique<Path>();
680 ASSERT_TRUE(path != nullptr);
681 path->Offset(1.0f, 2.3f);
682 }
683
684 /**
685 * @tc.name: Offset002
686 * @tc.desc:
687 * @tc.type: FUNC
688 * @tc.require: AR000GGNV3
689 * @tc.author:
690 */
691 HWTEST_F(PathTest, Offset002, TestSize.Level1)
692 {
693 auto path = std::make_unique<Path>();
694 ASSERT_TRUE(path != nullptr);
695 path->Offset(2.3f, 1.0f);
696 }
697
698 /**
699 * @tc.name: Op001
700 * @tc.desc:
701 * @tc.type: FUNC
702 * @tc.require: AR000GGNV3
703 * @tc.author:
704 */
705 HWTEST_F(PathTest, Op001, TestSize.Level1)
706 {
707 auto path = std::make_unique<Path>();
708 ASSERT_TRUE(path != nullptr);
709 Path path1;
710 Path path2;
711 path->Op(path1, path2, PathOp::INTERSECT);
712 }
713
714 /**
715 * @tc.name: Op002
716 * @tc.desc:
717 * @tc.type: FUNC
718 * @tc.require: AR000GGNV3
719 * @tc.author:
720 */
721 HWTEST_F(PathTest, Op002, TestSize.Level1)
722 {
723 auto path = std::make_unique<Path>();
724 ASSERT_TRUE(path != nullptr);
725 Path path1;
726 Path path2;
727 path->Op(path1, path2, PathOp::UNION);
728 }
729
730 /**
731 * @tc.name: Reset001
732 * @tc.desc:
733 * @tc.type: FUNC
734 * @tc.require: AR000GGNV3
735 * @tc.author:
736 */
737 HWTEST_F(PathTest, Reset001, TestSize.Level1)
738 {
739 auto path = std::make_unique<Path>();
740 ASSERT_TRUE(path != nullptr);
741 path->Reset();
742 }
743
744 /**
745 * @tc.name: Close001
746 * @tc.desc:
747 * @tc.type: FUNC
748 * @tc.require: AR000GGNV3
749 * @tc.author:
750 */
751 HWTEST_F(PathTest, Close001, TestSize.Level1)
752 {
753 auto path = std::make_unique<Path>();
754 ASSERT_TRUE(path != nullptr);
755 path->Close();
756 }
757
758 /**
759 * @tc.name: CopyConstruction001
760 * @tc.desc: Bounds should be same by using copy construction
761 * @tc.type: FUNC
762 * @tc.require: issuelI6M9U9
763 */
764 HWTEST_F(PathTest, CopyConstruction001, TestSize.Level1)
765 {
766 Path path1;
767 path1.MoveTo(1.0f, 2.0f);
768 path1.LineTo(3.0f, 4.0f);
769 Path path2 = path1;
770 ASSERT_TRUE(path1.GetBounds() == path2.GetBounds());
771 }
772
773 /**
774 * @tc.name: CopyConstruction002
775 * @tc.desc: Deep clone by the copy construction should not modify the original object
776 * @tc.type: FUNC
777 * @tc.require: issuelI6M9U9
778 */
779 HWTEST_F(PathTest, CopyConstruction002, TestSize.Level1)
780 {
781 Path path1;
782 path1.MoveTo(1.0f, 2.0f);
783 path1.LineTo(3.0f, 4.0f);
784 Path path2 = path1;
785 path2.LineTo(10.0f, 10.0f);
786 ASSERT_TRUE(path1.GetBounds() != path2.GetBounds());
787 }
788
789 /**
790 * @tc.name: Assignment001
791 * @tc.desc: Bounds should be same by using assignment method
792 * @tc.type: FUNC
793 * @tc.require: issuelI6M9U9
794 */
795 HWTEST_F(PathTest, Assignment001, TestSize.Level1)
796 {
797 Path path1;
798 path1.MoveTo(1.0f, 2.0f);
799 path1.LineTo(3.0f, 4.0f);
800 Path path2;
801 path2 = path1;
802 ASSERT_TRUE(path1.GetBounds() == path2.GetBounds());
803 }
804
805 /**
806 * @tc.name: Assignment002
807 * @tc.desc: Deep clone by the assignment method should not modify the original object
808 * @tc.type: FUNC
809 * @tc.require: issuelI6M9U9
810 */
811 HWTEST_F(PathTest, Assignment002, TestSize.Level1)
812 {
813 Path path1;
814 path1.MoveTo(1.0f, 2.0f);
815 path1.LineTo(3.0f, 4.0f);
816 Path path2;
817 path2 = path1;
818 path2.LineTo(10.0f, 10.0f);
819 ASSERT_TRUE(path1.GetBounds() != path2.GetBounds());
820 }
821 } // namespace Drawing
822 } // namespace Rosen
823 } // namespace OHOS
824