tests: Minor fixes, added autotest script
git-svn-id: http://pugixml.googlecode.com/svn/trunk@196 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
parent
a70f6b1a70
commit
5346828488
@ -64,6 +64,11 @@ else if ( $(toolset:I=^msvc) )
|
|||||||
{
|
{
|
||||||
CCFLAGS += /EHsc ;
|
CCFLAGS += /EHsc ;
|
||||||
}
|
}
|
||||||
|
else if ( $(toolset) = "msvc6" || $(toolset) = "msvc71" )
|
||||||
|
{
|
||||||
|
# No no-exception STL in MSVC6, buggy no-exception STL in MSVC71
|
||||||
|
CCFLAGS += /EHsc ;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CCFLAGS += /D_HAS_EXCEPTIONS=0 ;
|
CCFLAGS += /D_HAS_EXCEPTIONS=0 ;
|
||||||
|
|||||||
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
// letters taken from http://www.utf8-chartable.de/
|
// letters taken from http://www.utf8-chartable.de/
|
||||||
|
|
||||||
|
#ifdef __DMC__
|
||||||
|
#define U_LITERALS // DMC does not understand \x01234 (it parses first three digits), but understands \u01234
|
||||||
|
#endif
|
||||||
|
|
||||||
inline wchar_t wchar_cast(unsigned int value)
|
inline wchar_t wchar_cast(unsigned int value)
|
||||||
{
|
{
|
||||||
return static_cast<wchar_t>(value); // to avoid C4310 on MSVC
|
return static_cast<wchar_t>(value); // to avoid C4310 on MSVC
|
||||||
@ -11,8 +15,12 @@ inline wchar_t wchar_cast(unsigned int value)
|
|||||||
TEST(as_utf16)
|
TEST(as_utf16)
|
||||||
{
|
{
|
||||||
// valid 1-byte, 2-byte and 3-byte inputs
|
// valid 1-byte, 2-byte and 3-byte inputs
|
||||||
|
#ifdef U_LITERALS
|
||||||
|
CHECK(as_utf16("?\xd0\x80\xe2\x80\xbd") == L"?\u0400\u203D");
|
||||||
|
#else
|
||||||
CHECK(as_utf16("?\xd0\x80\xe2\x80\xbd") == L"?\x0400\x203D");
|
CHECK(as_utf16("?\xd0\x80\xe2\x80\xbd") == L"?\x0400\x203D");
|
||||||
|
#endif
|
||||||
|
|
||||||
// invalid 1-byte input
|
// invalid 1-byte input
|
||||||
CHECK(as_utf16("\xb0") == L" ");
|
CHECK(as_utf16("\xb0") == L" ");
|
||||||
|
|
||||||
@ -28,7 +36,11 @@ TEST(as_utf16)
|
|||||||
TEST(as_utf8)
|
TEST(as_utf8)
|
||||||
{
|
{
|
||||||
// valid 1-byte, 2-byte and 3-byte outputs
|
// valid 1-byte, 2-byte and 3-byte outputs
|
||||||
|
#ifdef U_LITERALS
|
||||||
|
CHECK(as_utf8(L"?\u0400\u203D") == "?\xd0\x80\xe2\x80\xbd");
|
||||||
|
#else
|
||||||
CHECK(as_utf8(L"?\x0400\x203D") == "?\xd0\x80\xe2\x80\xbd");
|
CHECK(as_utf8(L"?\x0400\x203D") == "?\xd0\x80\xe2\x80\xbd");
|
||||||
|
#endif
|
||||||
|
|
||||||
// valid 4-byte output
|
// valid 4-byte output
|
||||||
#if 0
|
#if 0
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user