diff options
author | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2009-10-28 20:08:19 +0000 |
---|---|---|
committer | arseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640> | 2009-10-28 20:08:19 +0000 |
commit | 9216c82cfdeba41a35314f0315a5b61b42e82c1c (patch) | |
tree | f554c2aee0c74550bd13bdbaee9ba7e53f54319f /tests/test_unicode.cpp | |
parent | 0815f85d7a1814c4026e6b15e93d8cb88121fe7d (diff) |
tests: Fixed MSVC warnings/errors
git-svn-id: http://pugixml.googlecode.com/svn/trunk@185 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'tests/test_unicode.cpp')
-rw-r--r-- | tests/test_unicode.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/test_unicode.cpp b/tests/test_unicode.cpp index b763355..e7adc47 100644 --- a/tests/test_unicode.cpp +++ b/tests/test_unicode.cpp @@ -2,6 +2,11 @@ // letters taken from http://www.utf8-chartable.de/
+inline wchar_t wchar_cast(unsigned int value)
+{
+ return static_cast<wchar_t>(value); // to avoid C4310 on MSVC
+}
+
TEST(as_utf16)
{
// valid 1-byte, 2-byte and 3-byte inputs
@@ -12,7 +17,7 @@ TEST(as_utf16) // valid 4-byte input
std::wstring b4 = as_utf16("\xf2\x97\x98\xa4 \xf4\x80\x8f\xbf");
- CHECK(b4.size() == 3 && b4[0] == (wchar_t)0x97624 && b4[1] == L' ' && b4[2] == (wchar_t)0x1003ff);
+ CHECK(b4.size() == 3 && b4[0] == wchar_cast(0x97624) && b4[1] == L' ' && b4[2] == wchar_cast(0x1003ff));
// invalid 5-byte input
std::wstring b5 = as_utf16("\xf8\nbcd");
|