Merge remote-tracking branch 'origin/master' into clone
This commit is contained in:
29
xmltest.cpp
29
xmltest.cpp
@@ -10,16 +10,10 @@
|
||||
#include <ctime>
|
||||
|
||||
#if defined( _MSC_VER )
|
||||
#include <direct.h> // _mkdir
|
||||
#include <crtdbg.h>
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
_CrtMemState startMemState;
|
||||
_CrtMemState endMemState;
|
||||
#elif defined(MINGW32) || defined(__MINGW32__)
|
||||
#include <io.h> // mkdir
|
||||
#else
|
||||
#include <sys/stat.h> // mkdir
|
||||
#endif
|
||||
|
||||
using namespace tinyxml2;
|
||||
@@ -299,17 +293,6 @@ int main( int argc, const char ** argv )
|
||||
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_LEAK_CHECK_DF);
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER) || defined(MINGW32) || defined(__MINGW32__)
|
||||
#if defined __MINGW64_VERSION_MAJOR && defined __MINGW64_VERSION_MINOR
|
||||
//MINGW64: both 32 and 64-bit
|
||||
mkdir( "resources/out/" );
|
||||
#else
|
||||
_mkdir( "resources/out/" );
|
||||
#endif
|
||||
#else
|
||||
mkdir( "resources/out/", S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
|
||||
#endif
|
||||
|
||||
{
|
||||
TIXMLASSERT( true );
|
||||
}
|
||||
@@ -752,6 +735,18 @@ int main( int argc, const char ** argv )
|
||||
XMLTest("Attribute: bool", true, v, true);
|
||||
XMLTest("Attribute: bool", true, element->BoolAttribute("attrib"), true);
|
||||
}
|
||||
{
|
||||
element->SetAttribute("attrib", true);
|
||||
const char* result = element->Attribute("attrib");
|
||||
XMLTest("Bool true is 'true'", "true", result);
|
||||
|
||||
XMLUtil::SetBoolSerialization("1", "0");
|
||||
element->SetAttribute("attrib", true);
|
||||
result = element->Attribute("attrib");
|
||||
XMLTest("Bool true is '1'", "1", result);
|
||||
|
||||
XMLUtil::SetBoolSerialization(0, 0);
|
||||
}
|
||||
{
|
||||
element->SetAttribute("attrib", 100.0);
|
||||
double v = 0;
|
||||
|
||||
Reference in New Issue
Block a user