summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-30 16:17:40 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-30 16:17:40 +0100
commit2a85e711df07e8a707cfc50667bd0a29d8a09519 (patch)
treeb89200eeda155787d91e5cc0ab8044c93b3225cb /test
parenta4114c49aeec1e24e0607814a88f0f6a2d6111f5 (diff)
Encode to ISO6937 on the way into STL binary.
Diffstat (limited to 'test')
-rw-r--r--test/iso6937_test.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/iso6937_test.cc b/test/iso6937_test.cc
index e8563b8..f537230 100644
--- a/test/iso6937_test.cc
+++ b/test/iso6937_test.cc
@@ -24,7 +24,7 @@
using std::cout;
using boost::locale::conv::utf_to_utf;
-BOOST_AUTO_TEST_CASE (iso6937_test)
+BOOST_AUTO_TEST_CASE (iso6937_to_utf16_test)
{
BOOST_CHECK_EQUAL (utf_to_utf<char> (sub::iso6937_to_utf16 ("Hello world")), "Hello world");
BOOST_CHECK_EQUAL (utf_to_utf<char> (sub::iso6937_to_utf16 ("Testing \xA9testing\xB9")), "Testing ‘testing’");
@@ -32,3 +32,12 @@ BOOST_AUTO_TEST_CASE (iso6937_test)
BOOST_CHECK_EQUAL (utf_to_utf<char> (sub::iso6937_to_utf16 ("M\xC8otorhead")), "Mötorhead");
BOOST_CHECK_EQUAL (utf_to_utf<char> (sub::iso6937_to_utf16 ("Pass\nnewlines\nthrough")), "Pass\nnewlines\nthrough");
}
+
+BOOST_AUTO_TEST_CASE (utf16_to_iso6937_test)
+{
+ BOOST_CHECK_EQUAL (sub::utf16_to_iso6937 (utf_to_utf<wchar_t> ("Hello world")), "Hello world");
+ BOOST_CHECK_EQUAL (sub::utf16_to_iso6937 (utf_to_utf<wchar_t> ("Testing ‘testing’")), "Testing \xA9testing\xB9");
+ BOOST_CHECK_EQUAL (sub::utf16_to_iso6937 (utf_to_utf<wchar_t> ("All must have çedillas")), "All must have \xCB""cedillas");
+ BOOST_CHECK_EQUAL (sub::utf16_to_iso6937 (utf_to_utf<wchar_t> ("Mötorhead")), "M\xC8otorhead");
+ BOOST_CHECK_EQUAL (sub::utf16_to_iso6937 (utf_to_utf<wchar_t> ("Pass\nnewlines\nthrough")), "Pass\nnewlines\nthrough");
+}