From d17a6885253da909e376ba5ca5084f5281f3557c Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Mon, 9 Jan 2017 11:18:29 -0800 Subject: Add checkers and tests for empty locale in PNG file match_locale() will return false for empty locale string in the PNG file. Also add a manual test to validate if a PNG file is qualified to use under recovery. Bug: 34054052 Test: recovery_manual_test catches invalid PNG files successfully & Locale_test passed Change-Id: Id7e2136e1d8abf20da15825aa7901effbced8b03 --- tests/unit/locale_test.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/unit/locale_test.cpp') diff --git a/tests/unit/locale_test.cpp b/tests/unit/locale_test.cpp index 0e515f8c1..f73235005 100644 --- a/tests/unit/locale_test.cpp +++ b/tests/unit/locale_test.cpp @@ -26,4 +26,7 @@ TEST(LocaleTest, Misc) { EXPECT_TRUE(matches_locale("en", "en_GB")); EXPECT_FALSE(matches_locale("en_GB", "en")); EXPECT_FALSE(matches_locale("en_GB", "en_US")); + EXPECT_FALSE(matches_locale("en_US", "")); + // Empty locale prefix in the PNG file will match the input locale. + EXPECT_TRUE(matches_locale("", "en_US")); } -- cgit v1.2.3