From 2c7ac6d6a9df1f6cead3a7b362e107490d7a4031 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Mon, 30 Jan 2017 12:56:53 +0900 Subject: [PATCH] Add a few more test cases for invalid UTF-8 sequences. --- tests/test_string.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test_string.cpp b/tests/test_string.cpp index 0ade0113..1bd29ff5 100644 --- a/tests/test_string.cpp +++ b/tests/test_string.cpp @@ -350,6 +350,9 @@ public: CPPUNIT_ASSERT(String(ByteVector("\xFC\x80\x80\x80\x80\x80"), String::UTF8).isEmpty()); CPPUNIT_ASSERT(String('\x80', String::UTF8).isEmpty()); + + CPPUNIT_ASSERT(String(ByteVector("\xED\xA0\x80\xED\xB0\x80"), String::UTF8).isEmpty()); + CPPUNIT_ASSERT(String(ByteVector("\xED\xB0\x80\xED\xA0\x80"), String::UTF8).isEmpty()); } }; -- 2.40.0