Fix issues in unit tests

This commit is contained in:
Daniel Chappuis 2013-03-18 22:13:04 +01:00
parent 5f3c66b9f1
commit 4b320701c4
2 changed files with 7 additions and 6 deletions

View File

@ -29,6 +29,7 @@
// Libraries
#include "Test.h"
#include <vector>
#include <stdexcept>
/// Reactphysics3D namespace
namespace reactphysics3d {

View File

@ -164,9 +164,9 @@ class TestQuaternion : public Test {
Vector3 vector(56, -2, 82);
Vector3 vector1 = matrix * vector;
Vector3 vector2 = mQuaternion1 * vector;
test(approxEqual(vector1.x, vector2.x));
test(approxEqual(vector1.y, vector2.y));
test(approxEqual(vector1.z, vector2.z));
test(approxEqual(vector1.x, vector2.x, decimal(10e-6)));
test(approxEqual(vector1.y, vector2.y, decimal(10e-6)));
test(approxEqual(vector1.z, vector2.z, decimal(10e-6)));
// Test slerp method
Quaternion quatStart = quaternion1.getUnit();
@ -214,9 +214,9 @@ class TestQuaternion : public Test {
Vector3 vector2 = mQuaternion1 * point;
Vector3 testVector2 = mQuaternion1.getMatrix() * point;
test(vector1 == point);
test(approxEqual(vector2.x, testVector2.x, decimal(10e-6)));
test(approxEqual(vector2.y, testVector2.y, decimal(10e-6)));
test(approxEqual(vector2.z, testVector2.z, decimal(10e-6)));
test(approxEqual(vector2.x, testVector2.x, decimal(10e-5)));
test(approxEqual(vector2.y, testVector2.y, decimal(10e-5)));
test(approxEqual(vector2.z, testVector2.z, decimal(10e-5)));
// Test assignment operator
Quaternion quaternion;