1 /*
2  * Copyright (c) 2024 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 #include "drawing_color_space.h"
18 
19 using namespace testing;
20 using namespace testing::ext;
21 
22 namespace OHOS {
23 namespace Rosen {
24 namespace Drawing {
25 class NativeDrawingColorSpaceTest : 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 NativeDrawingColorSpaceTest::SetUpTestCase() {}
TearDownTestCase()34 void NativeDrawingColorSpaceTest::TearDownTestCase() {}
SetUp()35 void NativeDrawingColorSpaceTest::SetUp() {}
TearDown()36 void NativeDrawingColorSpaceTest::TearDown() {}
37 
38 /*
39  * @tc.name: NativeDrawingColorSpaceTest_ColorSpace001
40  * @tc.desc: test for ColorSpace.
41  * @tc.size  : MediumTest
42  * @tc.type  : Function
43  * @tc.level : Level 1
44  */
HWTEST_F(NativeDrawingColorSpaceTest, NativeDrawingColorSpaceTest_ColorSpace001, TestSize.Level1)45 HWTEST_F(NativeDrawingColorSpaceTest, NativeDrawingColorSpaceTest_ColorSpace001, TestSize.Level1)
46 {
47     OH_Drawing_ColorSpace* colorSpace = OH_Drawing_ColorSpaceCreateSrgb();
48     EXPECT_NE(colorSpace, nullptr);
49     OH_Drawing_ColorSpaceDestroy(colorSpace);
50 }
51 
52 /*
53  * @tc.name: NativeDrawingColorSpaceTest_ColorSpace002
54  * @tc.desc: test for ColorSpace.
55  * @tc.size  : MediumTest
56  * @tc.type  : Function
57  * @tc.level : Level 1
58  */
HWTEST_F(NativeDrawingColorSpaceTest, NativeDrawingColorSpaceTest_ColorSpace002, TestSize.Level1)59 HWTEST_F(NativeDrawingColorSpaceTest, NativeDrawingColorSpaceTest_ColorSpace002, TestSize.Level1)
60 {
61     OH_Drawing_ColorSpace* colorSpace = OH_Drawing_ColorSpaceCreateSrgbLinear();
62     EXPECT_NE(colorSpace, nullptr);
63     OH_Drawing_ColorSpaceDestroy(colorSpace);
64 }
65 } // namespace Drawing
66 } // namespace Rosen
67 } // namespace OHOS