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, 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 #include "application_info.h" 18 #include "bundle_info.h" 19 #include "hap_module_info.h" 20 #include "txt/text_bundle_config_parser.h" 21 22 using namespace testing; 23 using namespace testing::ext; 24 25 namespace OHOS { 26 namespace Rosen { 27 namespace SPText { 28 class TextBundleConfigParserTest : public testing::Test { 29 public: 30 static void SetUpTestCase(); 31 static void TearDownTestCase(); 32 static inline std::string metaData; 33 }; 34 SetUpTestCase()35void TextBundleConfigParserTest::SetUpTestCase() 36 { 37 metaData = "text_bundle_config_parser_test"; 38 } 39 TearDownTestCase()40void TextBundleConfigParserTest::TearDownTestCase() {} 41 42 /* 43 * @tc.name: BundleManagerTest001 44 * @tc.desc: test for GetAdapterTextHeight 45 * @tc.type: FUNC 46 */ 47 HWTEST_F(TextBundleConfigParserTest, BundleManagerTest001, TestSize.Level0) 48 { 49 EXPECT_FALSE(TextBundleConfigParser::GetInstance().IsAdapterTextHeightEnabled()); 50 } 51 52 #ifdef ENABLE_OHOS_ENHANCE 53 /* 54 * @tc.name: IsTargetApiVersionText001 55 * @tc.desc: test for IsTargetApiVersion 56 * @tc.type: FUNC 57 */ 58 HWTEST_F(TextBundleConfigParserTest, IsTargetApiVersionText001, TestSize.Level0) 59 { 60 TextBundleConfigParser::GetInstance().initStatus_ = true; 61 TextBundleConfigParser::GetInstance().bundleApiVersion_ = SINCE_API18_VERSION; 62 ASSERT_TRUE(TextBundleConfigParser::GetInstance().IsTargetApiVersion(SINCE_API18_VERSION)); 63 TextBundleConfigParser::GetInstance().initStatus_ = false; 64 } 65 #endif 66 } // namespace SPText 67 } // namespace Rosen 68 } // namespace OHOS