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, Hardware
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/brush.h"
19 
20 using namespace testing;
21 using namespace testing::ext;
22 
23 namespace OHOS {
24 namespace Rosen {
25 namespace Drawing {
26 class BrushTest : 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 BrushTest::SetUpTestCase() {}
TearDownTestCase()35 void BrushTest::TearDownTestCase() {}
SetUp()36 void BrushTest::SetUp() {}
TearDown()37 void BrushTest::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(BrushTest, CreateAndDestroy001, TestSize.Level1)
47 {
48     std::unique_ptr<Brush> brush = std::make_unique<Brush>();
49     ASSERT_TRUE(nullptr != brush);
50 }
51 
52 /**
53  * @tc.name: CopyConstructor001
54  * @tc.desc:
55  * @tc.type: FUNC
56  * @tc.require: AR000GGNV3
57  * @tc.author:
58  */
59 HWTEST_F(BrushTest, CopyConstructor001, TestSize.Level1)
60 {
61     Brush oldBrush;
62     Brush newBrush = oldBrush;
63     EXPECT_TRUE(oldBrush == newBrush);
64 }
65 
66 /**
67  * @tc.name: CopyConstructor002
68  * @tc.desc:
69  * @tc.type: FUNC
70  * @tc.require: AR000GGNV3
71  * @tc.author:
72  */
73 HWTEST_F(BrushTest, CopyConstructor002, TestSize.Level1)
74 {
75     Brush brush;
76     auto brush2 = std::make_unique<Brush>(brush);
77     EXPECT_TRUE(brush2 != nullptr);
78 }
79 
80 /**
81  * @tc.name: CreateBrushWithColor001
82  * @tc.desc:
83  * @tc.type: FUNC
84  * @tc.require: AR000GGNV3
85  * @tc.author:
86  */
87 HWTEST_F(BrushTest, CreateBrushWithColor001, TestSize.Level1)
88 {
89     Color color;
90     std::unique_ptr<Brush> brush = std::make_unique<Brush>(color);
91     EXPECT_TRUE(nullptr != brush);
92 }
93 
94 /**
95  * @tc.name: CreateBrushWithShaderEffect001
96  * @tc.desc:
97  * @tc.type: FUNC
98  * @tc.require: AR000GGNV3
99  * @tc.author:
100  */
101 HWTEST_F(BrushTest, CreateBrushWithShaderEffect001, TestSize.Level1)
102 {
103     auto shaderEffect = ShaderEffect::CreateColorShader(1);
104     auto brush = std::make_unique<Brush>(shaderEffect);
105     EXPECT_TRUE(nullptr != brush);
106 }
107 
108 /**
109  * @tc.name: CreateBrushWithShaderEffect002
110  * @tc.desc:
111  * @tc.type: FUNC
112  * @tc.require: AR000GGNV3
113  * @tc.author:
114  */
115 HWTEST_F(BrushTest, CreateBrushWithShaderEffect002, TestSize.Level1)
116 {
117     auto shaderEffect2 = ShaderEffect::CreateColorShader(55);
118     auto brush = std::make_unique<Brush>(shaderEffect2);
119     EXPECT_TRUE(nullptr != brush);
120 }
121 
122 /**
123  * @tc.name: CreateBrushWithRGB001
124  * @tc.desc:
125  * @tc.type: FUNC
126  * @tc.require: AR000GGNV3
127  * @tc.author:
128  */
129 HWTEST_F(BrushTest, CreateBrushWithRGB001, TestSize.Level1)
130 {
131     auto brush = std::make_unique<Brush>(222);
132     EXPECT_TRUE(nullptr != brush);
133 }
134 
135 /**
136  * @tc.name: CreateBrushWithRGB002
137  * @tc.desc:
138  * @tc.type: FUNC
139  * @tc.require: AR000GGNV3
140  * @tc.author:
141  */
142 HWTEST_F(BrushTest, CreateBrushWithRGB002, TestSize.Level1)
143 {
144     auto brush = std::make_unique<Brush>(123);
145     EXPECT_TRUE(nullptr != brush);
146 }
147 
148 /**
149  * @tc.name: GetterAndSetterOfColor001
150  * @tc.desc:
151  * @tc.type: FUNC
152  * @tc.require: AR000GGNV3
153  * @tc.author:
154  */
155 HWTEST_F(BrushTest, GetterAndSetterOfColor001, TestSize.Level1)
156 {
157     Color color;
158     auto brush = std::make_unique<Brush>();
159     ASSERT_TRUE(brush != nullptr);
160     brush->SetColor(color);
161     auto color1 = brush->GetColor();
162     EXPECT_TRUE(color1 == color);
163 }
164 
165 /**
166  * @tc.name: GetterAndSetterOfColor002
167  * @tc.desc:
168  * @tc.type: FUNC
169  * @tc.require: AR000GGNV3
170  * @tc.author:
171  */
172 HWTEST_F(BrushTest, GetterAndSetterOfColor002, TestSize.Level1)
173 {
174     Color color;
175     auto brush = std::make_unique<Brush>();
176     ASSERT_TRUE(brush != nullptr);
177     brush->SetColor(color);
178     auto color2 = brush->GetColor();
179     EXPECT_TRUE(color2 == color);
180 }
181 
182 /**
183  * @tc.name: SetARGB001
184  * @tc.desc:
185  * @tc.type: FUNC
186  * @tc.require: AR000GGNV3
187  * @tc.author:
188  */
189 HWTEST_F(BrushTest, SetARGB001, TestSize.Level1)
190 {
191     auto brush = std::make_unique<Brush>();
192     ASSERT_TRUE(brush != nullptr);
193     brush->SetARGB(255, 255, 255, 1);
194 }
195 
196 /**
197  * @tc.name: SetARGB002
198  * @tc.desc:
199  * @tc.type: FUNC
200  * @tc.require: AR000GGNV3
201  * @tc.author:
202  */
203 HWTEST_F(BrushTest, SetARGB002, TestSize.Level1)
204 {
205     auto brush = std::make_unique<Brush>();
206     ASSERT_TRUE(brush != nullptr);
207     brush->SetARGB(0, 0, 0, 1);
208 }
209 
210 /**
211  * @tc.name: GetColor4f001
212  * @tc.desc:
213  * @tc.type: FUNC
214  * @tc.require: AR000GGNV3
215  * @tc.author:
216  */
217 HWTEST_F(BrushTest, GetColor4f001, TestSize.Level1)
218 {
219     auto brush = std::make_unique<Brush>();
220     ASSERT_TRUE(brush != nullptr);
221     auto colorSpace = std::make_shared<ColorSpace>(ColorSpace::ColorSpaceType::NO_TYPE);
222     Color4f color4f = { -1.5f, -2.5f, -3.5f, -4.5f };
223     brush->SetColor(color4f, colorSpace);
224     Color4f expectColor4f = { 0.0f, 0.0f, 0.0f, 0.0f };
225     EXPECT_TRUE(std::abs(expectColor4f.redF_ - brush->GetColor4f().redF_) < 0.01);
226     EXPECT_TRUE(std::abs(expectColor4f.greenF_ - brush->GetColor4f().greenF_) < 0.01);
227     EXPECT_TRUE(std::abs(expectColor4f.blueF_ - brush->GetColor4f().blueF_) < 0.01);
228     EXPECT_TRUE(std::abs(expectColor4f.alphaF_ - brush->GetColor4f().alphaF_) < 0.01);
229 }
230 
231 /**
232  * @tc.name: GetColor4f002
233  * @tc.desc:
234  * @tc.type: FUNC
235  * @tc.require: AR000GGNV3
236  * @tc.author:
237  */
238 HWTEST_F(BrushTest, GetColor4f002, TestSize.Level1)
239 {
240     auto brush = std::make_unique<Brush>();
241     ASSERT_TRUE(brush != nullptr);
242     auto colorSpace = std::make_shared<ColorSpace>(ColorSpace::ColorSpaceType::SRGB);
243     Color4f color4f = { 10.5f, 20.5f, 30.5f, 40.5f };
244     brush->SetColor(color4f, colorSpace);
245     Color4f expectColor4f = { 1.0f, 1.0f, 1.0f, 1.0f };
246     EXPECT_TRUE(std::abs(expectColor4f.redF_ - brush->GetColor4f().redF_) < 0.01);
247     EXPECT_TRUE(std::abs(expectColor4f.greenF_ - brush->GetColor4f().greenF_) < 0.01);
248     EXPECT_TRUE(std::abs(expectColor4f.blueF_ - brush->GetColor4f().blueF_) < 0.01);
249     EXPECT_TRUE(std::abs(expectColor4f.alphaF_ - brush->GetColor4f().alphaF_) < 0.01);
250 }
251 
252 /**
253  * @tc.name: GetColor4f003
254  * @tc.desc:
255  * @tc.type: FUNC
256  * @tc.require: AR000GGNV3
257  * @tc.author:
258  */
259 HWTEST_F(BrushTest, GetColor4f003, TestSize.Level1)
260 {
261     auto brush = std::make_unique<Brush>();
262     ASSERT_TRUE(brush != nullptr);
263     auto colorSpace = std::make_shared<ColorSpace>(ColorSpace::ColorSpaceType::SRGB);
264     Color4f color4f = { 0.2f, 0.3f, 0.4f, 0.5f };
265     brush->SetColor(color4f, colorSpace);
266     Color4f expectColor4f = { 0.2f, 0.3f, 0.4f, 0.5f };
267     EXPECT_TRUE(std::abs(expectColor4f.redF_ - brush->GetColor4f().redF_) < 0.01);
268     EXPECT_TRUE(std::abs(expectColor4f.greenF_ - brush->GetColor4f().greenF_) < 0.01);
269     EXPECT_TRUE(std::abs(expectColor4f.blueF_ - brush->GetColor4f().blueF_) < 0.01);
270     EXPECT_TRUE(std::abs(expectColor4f.alphaF_ - brush->GetColor4f().alphaF_) < 0.01);
271 }
272 
273 /**
274  * @tc.name: GetColorSpace001
275  * @tc.desc:
276  * @tc.type: FUNC
277  * @tc.require: AR000GGNV3
278  * @tc.author:
279  */
280 HWTEST_F(BrushTest, GetColorSpace001, TestSize.Level1)
281 {
282     auto brush = std::make_unique<Brush>();
283     ASSERT_TRUE(brush != nullptr);
284     auto colorSpace = std::make_shared<ColorSpace>(ColorSpace::ColorSpaceType::SRGB);
285     Color4f color4f;
286     brush->SetColor(color4f, colorSpace);
287     ASSERT_EQ(colorSpace, brush->GetColorSpace());
288 }
289 
290 /**
291  * @tc.name: GetColorSpace002
292  * @tc.desc:
293  * @tc.type: FUNC
294  * @tc.require: AR000GGNV3
295  * @tc.author:
296  */
297 HWTEST_F(BrushTest, GetColorSpace002, TestSize.Level1)
298 {
299     auto brush = std::make_unique<Brush>();
300     ASSERT_TRUE(brush != nullptr);
301     auto colorSpace = std::make_shared<ColorSpace>(ColorSpace::ColorSpaceType::REF_IMAGE);
302     Color4f color4f;
303     brush->SetColor(color4f, colorSpace);
304     ASSERT_EQ(colorSpace, brush->GetColorSpace());
305 }
306 
307 /**
308  * @tc.name: SetColorWithColor4fAndColorSpace001
309  * @tc.desc:
310  * @tc.type: FUNC
311  * @tc.require: AR000GGNV3
312  * @tc.author:
313  */
314 HWTEST_F(BrushTest, SetColorWithColor4fAndColorSpace001, TestSize.Level1)
315 {
316     auto brush = std::make_unique<Brush>();
317     ASSERT_TRUE(brush != nullptr);
318     Color4f color;
319     auto colorSpace = std::make_shared<ColorSpace>(ColorSpace::ColorSpaceType::SRGB);
320     ASSERT_TRUE(colorSpace != nullptr);
321     brush->SetColor(color, colorSpace);
322 }
323 
324 /**
325  * @tc.name: SetColorWithColor4fAndColorSpace002
326  * @tc.desc:
327  * @tc.type: FUNC
328  * @tc.require: AR000GGNV3
329  * @tc.author:
330  */
331 HWTEST_F(BrushTest, SetColorWithColor4fAndColorSpace002, TestSize.Level1)
332 {
333     auto brush = std::make_unique<Brush>();
334     ASSERT_TRUE(brush != nullptr);
335     Color4f color;
336     auto colorSpace = std::make_shared<ColorSpace>(ColorSpace::ColorSpaceType::SRGB_LINEAR);
337     ASSERT_TRUE(colorSpace != nullptr);
338     brush->SetColor(color, colorSpace);
339 }
340 
341 /**
342  * @tc.name: GetterSetterOfAlpha001
343  * @tc.desc:
344  * @tc.type: FUNC
345  * @tc.require: AR000GGNV3
346  * @tc.author:
347  */
348 HWTEST_F(BrushTest, GetterSetterOfAlpha001, TestSize.Level1)
349 {
350     auto brush = std::make_unique<Brush>();
351     ASSERT_TRUE(brush != nullptr);
352     brush->SetAlpha(1);
353     auto alpha = brush->GetAlpha();
354     EXPECT_TRUE(alpha == 1);
355 }
356 
357 /**
358  * @tc.name: GetterSetterOfAlpha002
359  * @tc.desc:
360  * @tc.type: FUNC
361  * @tc.require: AR000GGNV3
362  * @tc.author:
363  */
364 HWTEST_F(BrushTest, GetterSetterOfAlpha002, TestSize.Level1)
365 {
366     auto shaderEffect = ShaderEffect::CreateColorShader(1);
367     ASSERT_TRUE(shaderEffect != nullptr);
368     auto brush = std::make_unique<Brush>(shaderEffect);
369     ASSERT_TRUE(brush != nullptr);
370     brush->SetAlpha(220);
371     auto alpha1 = brush->GetAlpha();
372     EXPECT_TRUE(alpha1 == 220);
373 }
374 
375 /**
376  * @tc.name: SetAlphaF001
377  * @tc.desc:
378  * @tc.type: FUNC
379  * @tc.require: AR000GGNV3
380  * @tc.author:
381  */
382 HWTEST_F(BrushTest, SetAlphaF001, TestSize.Level1)
383 {
384     auto brush = std::make_unique<Brush>();
385     ASSERT_TRUE(brush != nullptr);
386     brush->SetAlphaF(5.5f);
387 }
388 
389 /**
390  * @tc.name: SetAlphaF002
391  * @tc.desc:
392  * @tc.type: FUNC
393  * @tc.require: AR000GGNV3
394  * @tc.author:
395  */
396 HWTEST_F(BrushTest, SetAlphaF002, TestSize.Level1)
397 {
398     auto brush = std::make_unique<Brush>();
399     ASSERT_TRUE(brush != nullptr);
400     brush->SetAlphaF(15.5f);
401 }
402 
403 /**
404  * @tc.name: GetterAndSetterOfBlendMode001
405  * @tc.desc:
406  * @tc.type: FUNC
407  * @tc.require: AR000GGNV3
408  * @tc.author:
409  */
410 HWTEST_F(BrushTest, GetterAndSetterOfBlendMode001, TestSize.Level1)
411 {
412     auto brush = std::make_unique<Brush>();
413     ASSERT_TRUE(brush != nullptr);
414     brush->SetBlendMode(BlendMode::PLUS);
415     auto blendMode = brush->GetBlendMode();
416     EXPECT_TRUE(blendMode == BlendMode::PLUS);
417 }
418 
419 /**
420  * @tc.name: GetterAndSetterOfBlendMode002
421  * @tc.desc:
422  * @tc.type: FUNC
423  * @tc.require: AR000GGNV3
424  * @tc.author:
425  */
426 HWTEST_F(BrushTest, GetterAndSetterOfBlendMode002, TestSize.Level1)
427 {
428     auto brush = std::make_unique<Brush>();
429     ASSERT_TRUE(brush != nullptr);
430     brush->SetBlendMode(BlendMode::SRC_IN);
431     auto blendMode = brush->GetBlendMode();
432     EXPECT_TRUE(blendMode == BlendMode::SRC_IN);
433 }
434 
435 /**
436  * @tc.name: GetterAndSetterOfFilter001
437  * @tc.desc:
438  * @tc.type: FUNC
439  * @tc.require: AR000GGNV3
440  * @tc.author:
441  */
442 HWTEST_F(BrushTest, GetterAndSetterOfFilter001, TestSize.Level1)
443 {
444     auto brush = std::make_unique<Brush>();
445     ASSERT_TRUE(brush != nullptr);
446     Filter filter;
447     brush->SetFilter(filter);
448     auto filter2 = brush->GetFilter();
449     EXPECT_TRUE(filter2 == filter);
450 }
451 
452 /**
453  * @tc.name: GetterAndSetterOfFilter002
454  * @tc.desc:
455  * @tc.type: FUNC
456  * @tc.require: AR000GGNV3
457  * @tc.author:
458  */
459 HWTEST_F(BrushTest, GetterAndSetterOfFilter002, TestSize.Level1)
460 {
461     Color color;
462     auto brush = std::make_unique<Brush>(color);
463     ASSERT_TRUE(brush != nullptr);
464     Filter filter3;
465     brush->SetFilter(filter3);
466     auto filter2 = brush->GetFilter();
467     EXPECT_TRUE(filter2 == filter3);
468 }
469 
470 /**
471  * @tc.name: GetterAndSetterOfShaderEffect001
472  * @tc.desc:
473  * @tc.type: FUNC
474  * @tc.require: AR000GGNV3
475  * @tc.author:
476  */
477 HWTEST_F(BrushTest, GetterAndSetterOfShaderEffect001, TestSize.Level1)
478 {
479     auto brush = std::make_unique<Brush>();
480     ASSERT_TRUE(brush != nullptr);
481     auto shaderEffect = ShaderEffect::CreateColorShader(1);
482     ASSERT_TRUE(shaderEffect != nullptr);
483     brush->SetShaderEffect(shaderEffect);
484     auto shaderEffect2 = brush->GetShaderEffect();
485     EXPECT_TRUE(shaderEffect2 != nullptr);
486 }
487 
488 /**
489  * @tc.name: GetterAndSetterOfShaderEffect002
490  * @tc.desc:
491  * @tc.type: FUNC
492  * @tc.require: AR000GGNV3
493  * @tc.author:
494  */
495 HWTEST_F(BrushTest, GetterAndSetterOfShaderEffect002, TestSize.Level1)
496 {
497     Color color;
498     auto brush = std::make_unique<Brush>(color);
499     ASSERT_TRUE(brush != nullptr);
500     auto shaderEffect = ShaderEffect::CreateColorShader(22);
501     ASSERT_TRUE(shaderEffect != nullptr);
502     brush->SetShaderEffect(shaderEffect);
503     auto shaderEffect3 = brush->GetShaderEffect();
504     EXPECT_TRUE(shaderEffect3 != nullptr);
505 }
506 
507 /**
508  * @tc.name: SetBlenderEnabledAndBlenderEnabled001
509  * @tc.desc:
510  * @tc.type: FUNC
511  * @tc.require: AR000GGNV3
512  * @tc.author:
513  */
514 HWTEST_F(BrushTest, SetBlenderEnabledAndBlenderEnabled001, TestSize.Level1)
515 {
516     auto brush = std::make_unique<Brush>();
517     ASSERT_TRUE(brush != nullptr);
518     brush->SetBlenderEnabled(true);
519     ASSERT_EQ(true, brush->GetBlenderEnabled());
520 }
521 
522 /**
523  * @tc.name: SetBlenderEnabledAndBlenderEnabled002
524  * @tc.desc:
525  * @tc.type: FUNC
526  * @tc.require: AR000GGNV3
527  * @tc.author:
528  */
529 HWTEST_F(BrushTest, SetBlenderEnabledAndBlenderEnabled002, TestSize.Level1)
530 {
531     auto brush = std::make_unique<Brush>();
532     ASSERT_TRUE(brush != nullptr);
533     brush->SetBlenderEnabled(false);
534     ASSERT_EQ(false, brush->GetBlenderEnabled());
535 }
536 
537 /**
538  * @tc.name: SetAntiAliasAndIsAntiAlias001
539  * @tc.desc:
540  * @tc.type: FUNC
541  * @tc.require: AR000GGNV3
542  * @tc.author:
543  */
544 HWTEST_F(BrushTest, SetAntiAliasAndIsAntiAlias001, TestSize.Level1)
545 {
546     auto brush = std::make_unique<Brush>();
547     ASSERT_TRUE(brush != nullptr);
548     brush->SetAntiAlias(true);
549     ASSERT_EQ(true, brush->IsAntiAlias());
550 }
551 
552 /**
553  * @tc.name: SetAntiAliasAndIsAntiAlias002
554  * @tc.desc:
555  * @tc.type: FUNC
556  * @tc.require: AR000GGNV3
557  * @tc.author:
558  */
559 HWTEST_F(BrushTest, SetAntiAliasAndIsAntiAlias002, TestSize.Level1)
560 {
561     auto brush = std::make_unique<Brush>();
562     ASSERT_TRUE(brush != nullptr);
563     brush->SetAntiAlias(false);
564     ASSERT_EQ(false, brush->IsAntiAlias());
565 }
566 
567 /**
568  * @tc.name: IsEquals001
569  * @tc.desc:
570  * @tc.type: FUNC
571  * @tc.require: AR000GGNV3
572  * @tc.author:
573  */
574 HWTEST_F(BrushTest, IsEquals001, TestSize.Level1)
575 {
576     auto brush = std::make_unique<Brush>();
577     ASSERT_TRUE(brush != nullptr);
578     Color color;
579     auto newBrush = std::make_unique<Brush>(color);
580     ASSERT_TRUE(newBrush != nullptr);
581     EXPECT_FALSE(brush == newBrush);
582     brush->Reset();
583 }
584 
585 /**
586  * @tc.name: IsEquals002
587  * @tc.desc:
588  * @tc.type: FUNC
589  * @tc.require: AR000GGNV3
590  * @tc.author:
591  */
592 HWTEST_F(BrushTest, IsEquals002, TestSize.Level1)
593 {
594     int rgba = 210;
595     auto brush = std::make_unique<Brush>(rgba);
596     ASSERT_TRUE(brush != nullptr);
597     ColorQuad rgba2 = 123;
598     Color color1(rgba2);
599     auto newBrush = std::make_unique<Brush>(color1);
600     ASSERT_TRUE(newBrush != nullptr);
601     EXPECT_FALSE(brush == newBrush);
602     brush->Reset();
603 }
604 
605 /**
606  * @tc.name: IsEquals003
607  * @tc.desc:
608  * @tc.type: FUNC
609  * @tc.require: AR20240104201189
610  * @tc.author:
611  */
612 HWTEST_F(BrushTest, IsEquals003, TestSize.Level1)
613 {
614     Brush brush1;
615     // 1.f 2.f  3.f and 0x12345678 is setted to compare.
616     float radius = 1.f;
617     Point point{2.f, 3.f};
618     Color color = Color(0x12345678);
619     std::shared_ptr<BlurDrawLooper> blurDrawLooper = BlurDrawLooper::CreateBlurDrawLooper(radius,
620         point.GetX(), point.GetY(), color);
621     brush1.SetLooper(blurDrawLooper);
622     Brush brush2 = brush1;
623     EXPECT_TRUE(brush1 == brush2);
624     brush2.SetLooper(nullptr);
625     EXPECT_TRUE(brush1 != brush2);
626 }
627 
628 /**
629  * @tc.name: IsNotEquals001
630  * @tc.desc:
631  * @tc.type: FUNC
632  * @tc.require: AR000GGNV3
633  * @tc.author:
634  */
635 HWTEST_F(BrushTest, IsNotEquals001, TestSize.Level1)
636 {
637     Color color(2, 4, 10, 1);
638     auto brush = std::make_shared<Brush>(color);
639     ASSERT_TRUE(brush != nullptr);
640     auto newBrush = brush;
641     EXPECT_FALSE(brush != newBrush);
642 }
643 
644 /**
645  * @tc.name: IsNotEquals002
646  * @tc.desc:
647  * @tc.type: FUNC
648  * @tc.require: AR000GGNV3
649  * @tc.author:
650  */
651 HWTEST_F(BrushTest, IsNotEquals002, TestSize.Level1)
652 {
653     auto brush = std::make_shared<Brush>();
654     ASSERT_TRUE(brush != nullptr);
655     auto newBrush = brush;
656     EXPECT_FALSE(brush != newBrush);
657 }
658 } // namespace Drawing
659 } // namespace Rosen
660 } // namespace OHOS
661