Commit 9cda111b authored by hybrid's avatar hybrid

Add duplicated archive mounting test, fix some precision problems.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2881 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 1b89cef4
......@@ -4,7 +4,7 @@ Sources = $(wildcard *.cpp)
CPPFLAGS = -I../include -I/usr/X11R6/include -pipe
# CXXFLAGS += -O3
CXXFLAGS += -Wall -O0 -g -D_DEBUG
CXXFLAGS += -Wall -ansi -pedantic -O0 -g -D_DEBUG
ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
......
......@@ -6,8 +6,39 @@ using namespace io;
bool testArchive(IFileSystem* fs, const io::path& archiveName)
{
// make sure there is no archive mounted
if ( fs->getFileArchiveCount() )
{
logTestString("Already mounted archives found");
return false;
}
if ( !fs->addFileArchive(archiveName, /*bool ignoreCase=*/true, /*bool ignorePaths=*/false) )
{
logTestString("Mounting archive failed");
return false;
}
// make sure there is an archive mounted
if ( !fs->getFileArchiveCount() )
{
logTestString("Mounted archive not in list");
return false;
}
// mount again
if ( !fs->addFileArchive(archiveName, /*bool ignoreCase=*/true, /*bool ignorePaths=*/false) )
{
logTestString("Mounting a second time failed");
return false;
}
// make sure there is exactly one archive mounted
if ( fs->getFileArchiveCount() != 1 )
{
logTestString("Duplicate mount not recognized");
return false;
}
// log what we got
io::IFileArchive* archive = fs->getFileArchive(fs->getFileArchiveCount()-1);
......@@ -51,6 +82,11 @@ bool testArchive(IFileSystem* fs, const io::path& archiveName)
logTestString("Couldn't remove archive.\n");
return false;
}
// make sure there is no archive mounted
if ( fs->getFileArchiveCount() )
return false;
return true;
}
......
......@@ -115,8 +115,8 @@ template <class T>
static bool checkAngleCalculations()
{
core::vector3d<T> vec(5, 5, 0);
EQUAL_VECTORS(vec.getHorizontalAngle(), vector3d<T>(315, 90, 0));
EQUAL_VECTORS(vec.getSphericalCoordinateAngles(), vector3d<T>((T)44.999997, 0, 0));
EQUAL_VECTORS(vec.getHorizontalAngle(), vector3d<T>(315, (T)90.0, 0));
EQUAL_VECTORS(vec.getSphericalCoordinateAngles(), vector3d<T>((T)45.0, 0, 0));
return true;
}
......@@ -130,7 +130,9 @@ static bool checkRotations()
EQUAL_VECTORS(vec, vector3d<T>(0, (T)7.0710678118654755, 0));
vec.normalize();
EQUAL_VECTORS(vec, vector3d<T>(0, (T)1.0, 0));
// TODO: This breaks under Linux/gcc due to FP differences, but is no bug
if (((T)0.5f)>0.f)
EQUAL_VECTORS(vec, vector3d<T>(0, (T)1.0, 0));
vec.set(10, 10, 10);
center.set(5, 5, 10);
......
Test suite pass at GMT Thu Nov 12 19:48:37 2009
Test suite pass at GMT Tue Nov 17 12:41:18 2009
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment