From ea1bc4300d53569f11d02d226413e0f61ffb7d3a Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 18 Oct 2018 07:39:32 -0700 Subject: [PATCH] QA: Add unicode to test_utf8.cpp Previous test strings did not utilize extended table unicode, so some cases slipped through testing. When initializing wxString, we need to be careful to specify that we are initializing from a UTF-8 string otherwise the system will utilize a locale-specific initialization. --- qa/common/test_utf8.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/qa/common/test_utf8.cpp b/qa/common/test_utf8.cpp index c52ca1ff7c..ac93d7e10e 100644 --- a/qa/common/test_utf8.cpp +++ b/qa/common/test_utf8.cpp @@ -27,8 +27,9 @@ #include #include +#include - +#define UTF8_INIT "This is a test of UTF-8: ü‱☺😕😱" struct Utf8Fixture { }; @@ -45,9 +46,9 @@ BOOST_FIXTURE_TEST_SUITE( Utf8, Utf8Fixture ) */ BOOST_AUTO_TEST_CASE( Utf8AndStdString ) { - std::string str { "input" }; + std::string str { UTF8_INIT }; - UTF8 utf8_inited { "input" }; + UTF8 utf8_inited { UTF8_INIT }; UTF8 utf8_copied_from_stdstr = str; BOOST_CHECK_EQUAL( utf8_inited, utf8_copied_from_stdstr ); @@ -63,8 +64,8 @@ BOOST_AUTO_TEST_CASE( Utf8AndStdString ) */ BOOST_AUTO_TEST_CASE( Utf8AndWx ) { - UTF8 utf8_inited { "input" }; - wxString wx_inited { "input" }; + UTF8 utf8_inited { UTF8_INIT }; + wxString wx_inited = wxString::FromUTF8( UTF8_INIT ); // Check that we can copy convert WxString and compare wxString wx_copied_from_utf8 = utf8_inited;