|
10 | 10 | #include "libipc/platform/to_tchar.h" |
11 | 11 |
|
12 | 12 | TEST(Platform, to_tchar) { |
13 | | - char const utf8[] = { |
| 13 | + unsigned char const utf8[] = { |
14 | 14 | 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x2c, 0x20, 0xe6, 0xb5, 0xa3, |
15 | 15 | 0xe7, 0x8a, 0xb2, 0xe3, 0x82, 0xbd, 0xe9, 0x94, 0x9b, 0xe5, 0xb1, 0xbb, 0xe4, 0xba, 0xbe, 0xe9, |
16 | 16 | 0x8a, 0x88, 0xe6, 0x92, 0xb1, 0xe4, 0xbc, 0x80, 0xe9, 0x8a, 0x87, 0xc2, 0xb0, 0xe4, 0xbc, 0x85, |
17 | 17 | 0x00, |
18 | 18 | }; |
19 | | - wchar_t const wstr[] = L"hello world, 你好,こんにちは"; |
| 19 | + char const *sstr = reinterpret_cast<char const *>(utf8); |
| 20 | + wchar_t const *wstr = reinterpret_cast<wchar_t const *>(u"hello world, 你好,こんにちは"); |
20 | 21 | { |
21 | | - ipc::string str = ipc::detail::to_tchar<char>(utf8); |
22 | | - EXPECT_STREQ(str.c_str(), utf8); |
| 22 | + ipc::string str = ipc::detail::to_tchar<char>(sstr); |
| 23 | + EXPECT_STREQ(str.c_str(), sstr); |
23 | 24 | } |
24 | 25 | { |
25 | | - ipc::wstring wtr = ipc::detail::to_tchar<wchar_t>(utf8); |
| 26 | + ipc::wstring wtr = ipc::detail::to_tchar<wchar_t>(sstr); |
26 | 27 | EXPECT_STREQ(wtr.c_str(), wstr); |
27 | 28 | } |
28 | 29 | } |
|
0 commit comments