summaryrefslogtreecommitdiff
path: root/libutils/String16_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libutils/String16_test.cpp')
-rw-r--r--libutils/String16_test.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/libutils/String16_test.cpp b/libutils/String16_test.cpp
index ae9ba89c7..9e02b7886 100644
--- a/libutils/String16_test.cpp
+++ b/libutils/String16_test.cpp
@@ -229,4 +229,16 @@ TEST(String16Test, EmptyStringIsStatic) {
EXPECT_TRUE(tmp.isStaticString());
}
+TEST(String16Test, OverreadUtf8Conversion) {
+ char tmp[] = {'a', static_cast<char>(0xe0), '\0'};
+ String16 another(tmp);
+ EXPECT_TRUE(another.size() == 0);
+}
+
+TEST(String16Test, ValidUtf8Conversion) {
+ String16 another("abcdef");
+ EXPECT_EQ(6U, another.size());
+ EXPECT_STR16EQ(another, u"abcdef");
+}
+
} // namespace android