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 "image/picture.h" 19 20 #ifdef RS_ENABLE_VK 21 #include "platform/ohos/backend/rs_vulkan_context.h" 22 #endif 23 24 using namespace testing; 25 using namespace testing::ext; 26 27 namespace OHOS { 28 namespace Rosen { 29 namespace Drawing { 30 class PictureTest : public testing::Test { 31 public: 32 static void SetUpTestCase(); 33 static void TearDownTestCase(); 34 void SetUp() override; 35 void TearDown() override; 36 }; 37 SetUpTestCase()38void PictureTest::SetUpTestCase() 39 { 40 #ifdef RS_ENABLE_VK 41 RsVulkanContext::SetRecyclable(false); 42 #endif 43 } TearDownTestCase()44void PictureTest::TearDownTestCase() {} SetUp()45void PictureTest::SetUp() {} TearDown()46void PictureTest::TearDown() {} 47 48 /** 49 * @tc.name: PictureCreateAndDestroy001 50 * @tc.desc: 51 * @tc.type: FUNC 52 * @tc.require:AR000GGNV3 53 * @tc.author: 54 */ 55 HWTEST_F(PictureTest, PictureCreateAndDestroy001, TestSize.Level1) 56 { 57 // The best way to create Picture. 58 std::unique_ptr<Picture> picture = std::make_unique<Picture>(); 59 ASSERT_TRUE(picture != nullptr); 60 } 61 } // namespace Drawing 62 } // namespace Rosen 63 } // namespace OHOS