Commit a8972015 authored by monstrobishi's avatar monstrobishi

- Set default tolerance for s32 core::equals to 0 (Was 1).

 - Added tests to vector2d and vector3d regression tests for 0 to 1 equally using the s32 data type (Related to previous change).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2707 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 10201179
...@@ -38,7 +38,7 @@ namespace core ...@@ -38,7 +38,7 @@ namespace core
//! Rounding error constant often used when comparing f32 values. //! Rounding error constant often used when comparing f32 values.
const s32 ROUNDING_ERROR_S32 = 1; const s32 ROUNDING_ERROR_S32 = 0;
const f32 ROUNDING_ERROR_f32 = 0.000001f; const f32 ROUNDING_ERROR_f32 = 0.000001f;
const f64 ROUNDING_ERROR_f64 = 0.00000001; const f64 ROUNDING_ERROR_f64 = 0.00000001;
......
...@@ -52,7 +52,7 @@ static bool doTests() ...@@ -52,7 +52,7 @@ static bool doTests()
vec.set(5, 5); vec.set(5, 5);
vec.normalize(); vec.normalize();
compareVectors(vec, vector2d<T>((T)0.70710681378841400, (T)0.70710681378841400)); COMPARE_VECTORS(vec, vector2d<T>((T)0.70710681378841400, (T)0.70710681378841400));
vec.set(5, 5); vec.set(5, 5);
otherVec.set(10, 20); otherVec.set(10, 20);
...@@ -162,6 +162,16 @@ static bool doTests() ...@@ -162,6 +162,16 @@ static bool doTests()
return false; return false;
} }
core::vector2d<T> zeroZero(0, 0);
core::vector2d<T> oneOne(1, 1);
// Check if comparing (0.0, 0.0) with (1.0, 1.0) returns false.
if(zeroZero == oneOne)
{
logTestString("\nERROR: vector2d %.16f, %.16f == vector2d %.16f, %.16f\n",
(f64)zeroZero.X, (f64)zeroZero.Y, (f64)oneOne.X, (f64)oneOne.Y);
return false;
}
return true; return true;
} }
......
...@@ -126,6 +126,17 @@ static bool doTests() ...@@ -126,6 +126,17 @@ static bool doTests()
if ( is_nan(vec) ) if ( is_nan(vec) )
return false; return false;
core::vector3d<T> zeroZero(0, 0, 0);
core::vector3d<T> oneOne(1, 1, 1);
// Check if comparing (0.0, 0.0, 0.0) with (1.0, 1.0, 1.0) returns false.
if(zeroZero == oneOne)
{
logTestString("\nERROR: vector3d %.16f, %.16f, %.16f == vector3d %.16f, %.16f, %.16f\n",
(f64)zeroZero.X, (f64)zeroZero.Y, (f64)zeroZero.Z,
(f64)oneOne.X, (f64)oneOne.Y, (f64)oneOne.Z);
return false;
}
return true; return true;
} }
......
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