Commit cd700608 authored by hybrid's avatar hybrid

Add test case for getRotations which tests consecutive x rotations.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@3563 dfc29bdd-3216-0410-991c-e03cc46cb475
parent fade354b
......@@ -125,3 +125,4 @@ bool ioScene(void)
bool result = saveScene();
result &= loadScene();
return result;
}
......@@ -13,8 +13,8 @@ using namespace gui;
namespace
{
// Basic tests
bool matrices(void)
// Basic tests for identity matrix
bool identity(void)
{
bool result = true;
matrix4 m;
......@@ -189,6 +189,14 @@ bool rotations(void)
result &= (vec1.equals(core::vector3df(0.f, 0.f, 180.0f), 0.000002f));
assert(result);
rot1.makeIdentity();
rot1.setRotationDegrees(core::vector3df(270.f,0,0));
rot2.makeIdentity();
rot2.setRotationDegrees(core::vector3df(-90.f,0,0));
vec1=(rot1*rot2).getRotationDegrees();
result &= (vec1.equals(core::vector3df(180.f, 0.f, 0.0f)));
assert(result);
return result;
}
......@@ -233,7 +241,7 @@ bool isOrthogonal(void)
bool matrixOps(void)
{
bool result = true;
result &= matrices();
result &= identity();
result &= rotations();
result &= isOrthogonal();
result &= transformations();
......
Tests finished. 61 tests of 61 passed.
Compiled as DEBUG
Test suite pass at GMT Wed Jan 05 18:07:13 2011
Test suite pass at GMT Mon Jan 17 10:25:55 2011
......@@ -45,3 +45,4 @@ bool videoDriver()
result &= testVideoDriver(video::EDT_SOFTWARE);
result &= testVideoDriver(video::EDT_NULL);
return result;
}
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