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) ...@@ -125,3 +125,4 @@ bool ioScene(void)
bool result = saveScene(); bool result = saveScene();
result &= loadScene(); result &= loadScene();
return result; return result;
}
...@@ -13,8 +13,8 @@ using namespace gui; ...@@ -13,8 +13,8 @@ using namespace gui;
namespace namespace
{ {
// Basic tests // Basic tests for identity matrix
bool matrices(void) bool identity(void)
{ {
bool result = true; bool result = true;
matrix4 m; matrix4 m;
...@@ -189,6 +189,14 @@ bool rotations(void) ...@@ -189,6 +189,14 @@ bool rotations(void)
result &= (vec1.equals(core::vector3df(0.f, 0.f, 180.0f), 0.000002f)); result &= (vec1.equals(core::vector3df(0.f, 0.f, 180.0f), 0.000002f));
assert(result); 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; return result;
} }
...@@ -233,7 +241,7 @@ bool isOrthogonal(void) ...@@ -233,7 +241,7 @@ bool isOrthogonal(void)
bool matrixOps(void) bool matrixOps(void)
{ {
bool result = true; bool result = true;
result &= matrices(); result &= identity();
result &= rotations(); result &= rotations();
result &= isOrthogonal(); result &= isOrthogonal();
result &= transformations(); result &= transformations();
......
Tests finished. 61 tests of 61 passed. Tests finished. 61 tests of 61 passed.
Compiled as DEBUG 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() ...@@ -45,3 +45,4 @@ bool videoDriver()
result &= testVideoDriver(video::EDT_SOFTWARE); result &= testVideoDriver(video::EDT_SOFTWARE);
result &= testVideoDriver(video::EDT_NULL); result &= testVideoDriver(video::EDT_NULL);
return result; 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