补充接口覆盖测试用例

Signed-off-by: zhangdd_ewan <zhangdongdong50@huawei.com>
This commit is contained in:
zhangdd_ewan 2024-11-22 17:19:52 +08:00
parent 527c1a4538
commit 5aec14e653
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;
const std::string separator = ",";
std::string source = "zh,en,fr,de,zh-Hant,fil";
Merge(resultVec, separator, source);
EXPECT_EQ(resultVec.size(), 6);
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