modify to_tchar test

This commit is contained in:
mutouyun 2021-08-15 14:42:47 +08:00
parent 619f84cacc
commit e8cf471615

View File

@ -1,4 +1,4 @@
#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) || \
#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) || \
defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || \
defined(WINCE) || defined(_WIN32_WCE)
@ -11,10 +11,10 @@
TEST(Platform, to_tchar) {
char const *utf8 = "hello world, "
"\xE6\xB5\xA3\xE7\x8A\xB2\xE3\x82\xBD\xE9\x94\x9B\xE5\xB1\xBB\xE4"
"\xBA\xBE\xE9\x8A\x88\xE6\x92\xB1\xE4\xBC\x80\xE9\x8A\x87\xC2\xB0"
"\xE4\xBC\x85";
wchar_t const *utf16 = L"hello world, \x6D63\x72B2\x30BD\x951B\x5C7B\x4EBE\x9288\x64B1\x4F00\x9287\xB0\x4F05";
"\xe6\xb5\xa3\xe7\x8a\xb2\xe3\x82\xbd\xe9\x94\x9b\xe5\xb1\xbb\xe4"
"\xba\xbe\xe9\x8a\x88\xe6\x92\xb1\xe4\xbc\x80\xe9\x8a\x87\xc2\xb0"
"\xe4\xbc\x85";
wchar_t const *utf16 = L"hello world, \u4f60\u597d\uff0c\u3053\u3093\u306b\u3061\u306f";
{
ipc::string str = ipc::detail::to_tchar<char>(utf8);
EXPECT_STREQ(str.c_str(), utf8);