[med-svn] [SCM] mia branch, master, updated. upstream/2.0.7-64-gb612b58

Gert Wollny gw.fossdev at gmail.com
Wed Feb 27 10:38:43 UTC 2013


The following commit has been merged in the master branch:
commit 0feea13bcb53192211982f3264ab5c8281ac3650
Author: Gert Wollny <gw.fossdev at gmail.com>
Date:   Tue Feb 26 16:56:40 2013 +0100

    add that patch

diff --git a/mia/3d/filter/test_scale.cc b/mia/3d/filter/test_scale.cc
index 90c9e51..6e9bcae 100644
--- a/mia/3d/filter/test_scale.cc
+++ b/mia/3d/filter/test_scale.cc
@@ -203,7 +203,10 @@ BOOST_AUTO_TEST_CASE( test_downscale_float_persists )
 	for (size_t i = 0; i < 64; ++i) {
 
 		cvdebug() << i << ":" << fscaled[i] << " - " << test_float[i] << '\n'; 
-		BOOST_CHECK_CLOSE(fscaled[i], test_float[i], 0.1); 
+		if (fabs(test_float[i]) > 1e-16) 
+			BOOST_CHECK_CLOSE(fscaled[i], test_float[i], 0.1); 
+		else 
+			BOOST_CHECK((fabs(fscaled[i]) < 1e-16)); 
 	}
 		
 
diff --git a/mia/core/test_splineparzenmi.cc b/mia/core/test_splineparzenmi.cc
index 9fac7e0..7856ae2 100644
--- a/mia/core/test_splineparzenmi.cc
+++ b/mia/core/test_splineparzenmi.cc
@@ -254,9 +254,12 @@ BOOST_FIXTURE_TEST_CASE( test_self, CSplineParzenMIFixture )
 			cvdebug() << self_grad << " vs " << test_grad << ":" << self_grad / test_grad<<"\n"; 
 
 
-			if (test_grad != 0) 
+			// if the gradient is very small test against 'close to zero'
+			if (fabs(test_grad) > 1e-16) 
 				BOOST_CHECK_CLOSE(self_grad, test_grad, 0.1); 
-                }
+			else 
+				BOOST_CHECK(fabs(self_grad) < 1e-16);
+                }	
 	
 }
 

-- 
Packaging of mia in Debian



More information about the debian-med-commit mailing list