Commit b939beb1 authored by Davis King's avatar Davis King

made test more robust

parent c82e003e
......@@ -1352,8 +1352,16 @@ namespace
// Lets the float_details object while we are here doing this stuff.
float_details temp = val;
T val2 = temp;
// for the same type we should exactly reproduce the value.
DLIB_TEST(val2 == val);
// for the same type we should exactly reproduce the value (unless
// it's long double and then maybe it's slightly different).
if (is_same_type<T,long double>::value)
{
DLIB_TEST(std::abs(val2-val) < scale*std::numeric_limits<T>::epsilon());
}
else
{
DLIB_TEST(val2 == val);
}
float valf = temp;
double vald = temp;
......
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