[fixed] Do unit tests for fast_atof() check something ?
Posted: Fri Apr 10, 2015 12:36 pm
Hello,
I was just looking the unit tests for fast_atof() in trunk/tests/fast_atof.cpp and wondering if the function testCalculation_atof() does really check something.
Here is the source code in irrlicht SVN repo :
http://sourceforge.net/p/irrlicht/code/ ... of.cpp#l84
Take a look at those lines (93 & 94) :
diffNew and diffOld have the same values, so the "accurate" test shall always return true.
Do I miss something ?
I was just looking the unit tests for fast_atof() in trunk/tests/fast_atof.cpp and wondering if the function testCalculation_atof() does really check something.
Here is the source code in irrlicht SVN repo :
http://sourceforge.net/p/irrlicht/code/ ... of.cpp#l84
Take a look at those lines (93 & 94) :
Code: Select all
const f32 diffNew = fabs(newFastValue - atofValue) ;
const f32 diffOld = fabs(newFastValue - atofValue) ;
bool accurate = diffNew <= diffOld || equalsByUlp(diffNew, diffOld, 1);
Do I miss something ?