!900 补充接口覆盖测试用例

Merge pull request !900 from zhangdd_ewan/cherry-241122
This commit is contained in:
openharmony_ci 2024-11-22 11:33:48 +00:00 committed by Gitee
commit 06359281ad
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 11 additions and 1 deletions

View File

@ -49,7 +49,6 @@ bool GetPseudoLocalizationEnforce();
std::string PseudoLocalizationProcessor(const std::string &input);
std::string PseudoLocalizationProcessor(const std::string &input, bool ifEnforce);
bool CheckSystemPermission();
size_t ConvertBytesToSizeT(const char *byteArray);
std::set<std::string> GetTimeZoneAvailableIDs(I18nErrorCode &errorCode);
bool RegexSearchNoExcept(const std::string& str, std::smatch& match, const std::regex& regex);
std::string LocaleEncode(const std::string& locale);

View File

@ -541,6 +541,11 @@ HWTEST_F(IntlTest, IntlFuncTest0062, TestSize.Level1)
std::string localeCode = LocaleEncode(localeTag);
std::string targetCode = "58400008334651000314";
EXPECT_EQ(localeCode, targetCode);
std::vector<std::string> resultVec = {"zh", "en", "fr", "de", "zh-Hant", "fil"};
const std::string separator = ",";
std::string source;
Merge(resultVec, separator, source);
EXPECT_EQ(source, "zh,en,fr,de,zh-Hant,fil");
std::string localeRule = "zh-Hans";
DateTimeRule* dateTimeRule = new DateTimeRule(localeRule);

View File

@ -445,6 +445,12 @@ HWTEST_F(LocaleConfigTest, LocaleConfigFuncTest021, TestSize.Level1)
flag = LocaleConfig::IsValidTag(fakeTag);
EXPECT_TRUE(!flag);
EXPECT_FALSE(LocaleConfig::IsValidTag(""));
std::string langaugeKey = LocaleConfig::GetLanguageKey();
EXPECT_EQ(langaugeKey, "persist.global.language");
std::string localeKey = LocaleConfig::GetLocaleKey();
EXPECT_EQ(localeKey, "persist.global.locale");
std::string hourKey = LocaleConfig::GetHourKey();
EXPECT_EQ(hourKey, "persist.global.is24Hour");
}
} // namespace I18n
} // namespace Global