0aa5845e59
git-svn-id: http://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@2781 dfc29bdd-3216-0410-991c-e03cc46cb475
44 lines
857 B
C++
44 lines
857 B
C++
// Copyright (C) 2009 Christian Stehno
|
|
// No rights reserved: this software is in the public domain.
|
|
|
|
#include "testUtils.h"
|
|
|
|
using namespace irr;
|
|
using namespace core;
|
|
|
|
/** Tests for XML handling */
|
|
bool testXML(void)
|
|
{
|
|
IrrlichtDevice *device = createDevice(video::EDT_NULL, dimension2du(400, 200));
|
|
|
|
io::IXMLReaderUTF8* reader = device->getFileSystem()->createXMLReaderUTF8("media/test.xml");
|
|
if (!reader)
|
|
{
|
|
logTestString("Could not create XML reader.\n");
|
|
return false;
|
|
}
|
|
|
|
const core::stringc expected[] = {
|
|
"a", "b", "c"
|
|
};
|
|
|
|
bool retVal = true;
|
|
u32 i=0;
|
|
while(reader->read())
|
|
{
|
|
if (reader->getNodeType() == io::EXN_ELEMENT)
|
|
{
|
|
if (expected[i++] != reader->getNodeName())
|
|
{
|
|
logTestString("Did not find expected string in XML element name.\n");
|
|
retVal = false;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
reader->drop();
|
|
return retVal;
|
|
}
|
|
|