Add test for mesh cache.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2988 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2009-12-05 11:42:18 +00:00
parent 6ffcba6836
commit e699ab8889
5 changed files with 51 additions and 6 deletions

View File

@ -24,14 +24,12 @@ bool b3dAnimation(void)
ISceneManager * smgr = device->getSceneManager();
IAnimatedMesh* mesh = smgr->getMesh("../media/ninja.b3d");
IAnimatedMeshSceneNode* node1;
IAnimatedMeshSceneNode* node2;
assert(mesh);
bool result = false;
if(mesh)
{
node1 = smgr->addAnimatedMeshSceneNode(mesh);
IAnimatedMeshSceneNode* node1 = smgr->addAnimatedMeshSceneNode(mesh);
assert(node1);
if(node1)
@ -43,7 +41,7 @@ bool b3dAnimation(void)
node1->setDebugDataVisible(irr::scene::EDS_BBOX_BUFFERS);
}
node2 = smgr->addAnimatedMeshSceneNode(mesh);
IAnimatedMeshSceneNode* node2 = smgr->addAnimatedMeshSceneNode(mesh);
assert(node2);
if(node2)
{

View File

@ -64,7 +64,7 @@ int main(int argumentCount, char * arguments[])
// TODO: Needs to be fixed first
// TEST(testTriangle3d);
TEST(vectorPositionDimension2d);
// file system checks
// file system checks (with null driver)
TEST(filesystem);
TEST(archiveReader);
TEST(testXML);
@ -75,6 +75,7 @@ int main(int argumentCount, char * arguments[])
TEST(removeCustomAnimator);
TEST(sceneCollisionManager);
TEST(sceneNodeAnimator);
TEST(meshLoaders);
// software drivers only
TEST(softwareDevice);
TEST(b3dAnimation);

42
tests/meshLoaders.cpp Normal file
View File

@ -0,0 +1,42 @@
// Copyright (C) 2008-2009 Colin MacDonald
// No rights reserved: this software is in the public domain.
#include "testUtils.h"
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
// Tests mesh loading features and the mesh cache.
/** This won't test render results. Currently, not all mesh loaders are tested. */
bool meshLoaders(void)
{
IrrlichtDevice *device = createDevice( EDT_NULL, dimension2d<u32>(160, 120), 32);
assert(device);
if (!device)
return false;
IVideoDriver* driver = device->getVideoDriver();
ISceneManager * smgr = device->getSceneManager();
IAnimatedMesh* mesh = smgr->getMesh("../media/ninja.b3d");
assert(mesh);
bool result = (mesh != 0);
if (mesh)
{
if (mesh != smgr->getMesh("../media/ninja.b3d"))
{
logTestString("Loading from same file results in different meshes!");
result=false;
}
}
device->drop();
return result;
}

View File

@ -1,2 +1,2 @@
Test suite pass at GMT Sat Dec 05 11:03:29 2009
Test suite pass at GMT Sat Dec 05 11:31:52 2009

View File

@ -258,6 +258,10 @@
RelativePath=".\md2Animation.cpp"
>
</File>
<File
RelativePath=".\meshLoaders.cpp"
>
</File>
<File
RelativePath=".\planeMatrix.cpp"
>