Merge "StartsWith allows a std::string prefix now."
This commit is contained in:
@@ -397,7 +397,7 @@ bool matches_locale(const std::string& prefix, const std::string& locale) {
|
|||||||
// match the locale string without the {script} section.
|
// match the locale string without the {script} section.
|
||||||
// For instance, prefix == "en" matches locale == "en-US", prefix == "sr-Latn" matches locale
|
// For instance, prefix == "en" matches locale == "en-US", prefix == "sr-Latn" matches locale
|
||||||
// == "sr-Latn-BA", and prefix == "zh-CN" matches locale == "zh-Hans-CN".
|
// == "sr-Latn-BA", and prefix == "zh-CN" matches locale == "zh-Hans-CN".
|
||||||
if (android::base::StartsWith(locale, prefix.c_str())) {
|
if (android::base::StartsWith(locale, prefix)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -209,7 +209,7 @@ TEST_P(ResourceTest, ValidateLocale) {
|
|||||||
ASSERT_GT(height, y + 1 + h) << "Locale: " << kLocale << " is not found in the file.";
|
ASSERT_GT(height, y + 1 + h) << "Locale: " << kLocale << " is not found in the file.";
|
||||||
char* loc = reinterpret_cast<char*>(&row[5]);
|
char* loc = reinterpret_cast<char*>(&row[5]);
|
||||||
if (matches_locale(loc, kLocale.c_str())) {
|
if (matches_locale(loc, kLocale.c_str())) {
|
||||||
EXPECT_TRUE(android::base::StartsWith(loc, kLocale.c_str()));
|
EXPECT_TRUE(android::base::StartsWith(loc, kLocale));
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < h; ++i, ++y) {
|
for (int i = 0; i < h; ++i, ++y) {
|
||||||
|
|||||||
Reference in New Issue
Block a user