Commit 11ac4e71 authored by Thomas Feuvrier's avatar Thomas Feuvrier
Browse files

ENH: Improve Epsilon condition for checking comparaison values for regression:...

ENH: Improve Epsilon condition for checking comparaison values for regression: the value lower than m_EpsilonBoundaryChecking (fix to 1.0e-30) is well-respected
parent 7299a742
......@@ -184,6 +184,7 @@ namespace otb
}
else if ( (strRef != strTest)
&& (vcl_abs(atof(strRef.c_str())) > m_EpsilonBoundaryChecking)
&& (vcl_abs(atof(strRef.c_str())-atof(strTest.c_str()))
> epsilon*vcl_abs(atof(strRef.c_str()))
) )//epsilon as relative error
......@@ -244,6 +245,7 @@ namespace otb
{
if ( (strNumRef != strNumTest)
&& (vcl_abs(atof(strNumRef.c_str())) > m_EpsilonBoundaryChecking)
&& (vcl_abs(atof(strNumRef.c_str())-atof(strNumTest.c_str()))
> epsilon*vcl_abs(atof(strNumRef.c_str()))
) ) //epsilon as relative error
......@@ -289,6 +291,7 @@ namespace otb
{
if ( ( strRef != strTest)
&& (vcl_abs(atof(strRef.c_str())) > m_EpsilonBoundaryChecking)
&& (vcl_abs(atof(strRef.c_str())-atof(strTest.c_str()))
> epsilon*vcl_abs(atof(strRef.c_str()))
)) //epsilon as relative error
......@@ -382,6 +385,7 @@ namespace otb
std::cout << "Test ASCII File : "<<testAsciiFileName << std::endl;
std::cout << "Diff ASCII File : "<<diffAsciiFileName << std::endl;
std::cout << "Tolerance value : "<<epsilon << std::endl;
std::cout << "Tolerance max check : "<<m_EpsilonBoundaryChecking << std::endl;
std::cout << "Nb lines differents : "<<listStrDiffLineFileRef.size() << std::endl;
for ( unsigned int i = 0; i < listStrDiffLineFileRef.size(); ++i)
......
......@@ -34,7 +34,7 @@ namespace otb
class /*ITK_EXPORT*/ TestHelper
{
public:
TestHelper(){};
TestHelper() : m_EpsilonBoundaryChecking(1.0e-30){};
~TestHelper(){};
std::map<std::string,int> RegressionTestbaselines (char *baselineFilename) const;
......@@ -60,6 +60,7 @@ namespace otb
OGRLayer * test_poLayer, const char *test_pszWHERE, OGRGeometry *test_poSpatialFilter,
int & nbdiff, int bVerbose ) const;
double m_EpsilonBoundaryChecking;
};
}
......
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