Skip to content

Commit

Permalink
add utf16 -> utf8 unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
gfgtdf committed Oct 8, 2014
1 parent b037cbb commit 4a46ef1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/tests/test_serialization.cpp
Expand Up @@ -54,6 +54,9 @@ BOOST_AUTO_TEST_CASE( utils_unicode_test )

BOOST_CHECK( apple_u4.size() == 5 );
BOOST_CHECK_EQUAL( apple_u8, unicode_cast<utf8::string>(apple_u4) );
BOOST_CHECK_EQUAL( apple_u8, unicode_cast<utf8::string>(apple_u16) );
BOOST_CHECK( apple_u4 == unicode_cast<ucs4::string>(apple_u16) );
BOOST_CHECK( apple_u16 == unicode_cast<utf16::string>(apple_u4) );
BOOST_CHECK_EQUAL( apple_u8.size(), apple_u16.size() );

ucs4::string water_u4;
Expand All @@ -73,6 +76,9 @@ BOOST_AUTO_TEST_CASE( utils_unicode_test )
BOOST_CHECK_EQUAL(nonbmp_u16[0], 0xD800);
BOOST_CHECK_EQUAL(nonbmp_u16[1], 0xDC00);
BOOST_CHECK_EQUAL(nonbmp_u8, unicode_cast<utf8::string>(nonbmp_u4));
BOOST_CHECK_EQUAL(nonbmp_u8, unicode_cast<utf8::string>(nonbmp_u16));
BOOST_CHECK(nonbmp_u16 == unicode_cast<utf16::string>(nonbmp_u4));
BOOST_CHECK(nonbmp_u4 == unicode_cast<ucs4::string>(nonbmp_u16));
}

BOOST_AUTO_TEST_CASE( test_lowercase )
Expand Down

0 comments on commit 4a46ef1

Please sign in to comment.