aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTsuda Kageyu <tsuda.kageyu@gmail.com>2017-01-27 11:44:56 +0900
committerTsuda Kageyu <tsuda.kageyu@gmail.com>2017-01-27 14:47:55 +0900
commit0c45c63943ec70bcb8734299ca0b86f4f0131c6f (patch)
tree0aeac6ccec8690b0c637e8a4e016c59be053f7bf /tests
parent586c9bd962f0c3f9aa520d7f2f9bf0f7447a9cbf (diff)
Replace unicode.h/unicode.cpp by the UTF8-CPP library.
unicode.h/unicode.cpp are no longer maintained and incompatible with Debian's guideline. UTF8-CPP is maintained on GitHub and published under the Boost Software License which is compatible with either LGPL or MPL and should go along with Debian's guideline.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_string.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test_string.cpp b/tests/test_string.cpp
index d3661c24..20d96559 100644
--- a/tests/test_string.cpp
+++ b/tests/test_string.cpp
@@ -49,6 +49,7 @@ class TestString : public CppUnit::TestFixture
CPPUNIT_TEST(testUpper);
CPPUNIT_TEST(testEncodeNonLatin1);
CPPUNIT_TEST(testEncodeEmpty);
+ CPPUNIT_TEST(testEncodeNonBMP);
CPPUNIT_TEST(testIterator);
CPPUNIT_TEST(testRedundantUTF8);
CPPUNIT_TEST_SUITE_END();
@@ -313,6 +314,13 @@ public:
CPPUNIT_ASSERT(empty.to8Bit(true).empty());
}
+ void testEncodeNonBMP()
+ {
+ const ByteVector a("\xFF\xFE\x3C\xD8\x50\xDD\x40\xD8\xF5\xDC\x3C\xD8\x00\xDE", 14);
+ const ByteVector b("\xF0\x9F\x85\x90\xF0\xA0\x83\xB5\xF0\x9F\x88\x80");
+ CPPUNIT_ASSERT_EQUAL(b, String(a, String::UTF16).data(String::UTF8));
+ }
+
void testIterator()
{
String s1 = "taglib string";