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 #ifndef USE_GRAPHIC_TEXT_GINE 17 #include <gtest/gtest.h> 18 #include <gmock/gmock.h> 19 #include "texgine_dash_path_effect.h" 20 21 using namespace testing; 22 using namespace testing::ext; 23 #else 24 #include <gtest/gtest.h> 25 #include <gmock/gmock.h> 26 #include "texgine_path_effect.h" 27 28 using namespace testing; 29 using namespace testing::ext; 30 #endif 31 32 #ifndef USE_GRAPHIC_TEXT_GINE 33 namespace OHOS { 34 namespace Rosen { 35 namespace TextEngine { 36 class TexgineDashPathEffectTest : public testing::Test { 37 }; 38 39 /** 40 * @tc.name:Make 41 * @tc.desc: Verify the Make 42 * @tc.type:FUNC 43 */ 44 HWTEST_F(TexgineDashPathEffectTest, Make, TestSize.Level1) 45 { 46 float intervals[] = {0.0}; 47 EXPECT_NO_THROW({ 48 TexgineDashPathEffect::Make(intervals, 0, 0.0); 49 }); 50 } 51 } // namespace TextEngine 52 } // namespace Rosen 53 } // namespace OHOS 54 #else 55 namespace OHOS { 56 namespace Rosen { 57 namespace TextEngine { 58 class TexginePathEffectTest : public testing::Test { 59 }; 60 61 /** 62 * @tc.name:SetAndGet 63 * @tc.desc: Verify the SetAndGet 64 * @tc.type:FUNC 65 */ 66 HWTEST_F(TexginePathEffectTest, SetAndGet, TestSize.Level1) 67 { 68 std::shared_ptr<TexginePathEffect> tpe = std::make_shared<TexginePathEffect>(); 69 sk_sp<SkPathEffect> spe = nullptr; 70 EXPECT_NO_THROW({ 71 tpe->SetPathEffect(spe); 72 EXPECT_EQ(tpe->GetPathEffect(), spe); 73 }); 74 } 75 } // namespace TextEngine 76 } // namespace Rosen 77 } // namespace OHOS 78 #endif