Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60623 - trunk/libs/numeric/ublas/test
From: guwi17_at_[hidden]
Date: 2010-03-15 15:59:12


Author: guwi17
Date: 2010-03-15 15:59:11 EDT (Mon, 15 Mar 2010)
New Revision: 60623
URL: http://svn.boost.org/trac/boost/changeset/60623

Log:
see #3968
test/test_coordinate_matrix_sort.cpp: fixed wrong index in check
test/utils.hpp: fixed wrong exit code on failure

Text files modified:
   trunk/libs/numeric/ublas/test/test_coordinate_matrix_sort.cpp | 6 ++++--
   trunk/libs/numeric/ublas/test/utils.hpp | 3 ++-
   2 files changed, 6 insertions(+), 3 deletions(-)

Modified: trunk/libs/numeric/ublas/test/test_coordinate_matrix_sort.cpp
==============================================================================
--- trunk/libs/numeric/ublas/test/test_coordinate_matrix_sort.cpp (original)
+++ trunk/libs/numeric/ublas/test/test_coordinate_matrix_sort.cpp 2010-03-15 15:59:11 EDT (Mon, 15 Mar 2010)
@@ -1,4 +1,6 @@
-#define BOOST_UBLAS_NO_ELEMENT_PROXIES
+#ifndef BOOST_UBLAS_NO_ELEMENT_PROXIES
+# define BOOST_UBLAS_NO_ELEMENT_PROXIES
+#endif
 
 #include<boost/numeric/ublas/matrix_sparse.hpp>
 #include<boost/numeric/ublas/io.hpp>
@@ -51,7 +53,7 @@
     BOOST_UBLAS_TEST_CHECK( matrix_mask(1,1) == 2.1 );
 
     BOOST_UBLAS_DEBUG_TRACE( "Displaying matrix(0,1)" << matrix_mask(0,1) );
- BOOST_UBLAS_TEST_CHECK( matrix_mask(1,1) == 1.1 );
+ BOOST_UBLAS_TEST_CHECK( matrix_mask(0,1) == 1.1 );
 
 }
 

Modified: trunk/libs/numeric/ublas/test/utils.hpp
==============================================================================
--- trunk/libs/numeric/ublas/test/utils.hpp (original)
+++ trunk/libs/numeric/ublas/test/utils.hpp 2010-03-15 15:59:11 EDT (Mon, 15 Mar 2010)
@@ -25,7 +25,8 @@
 
 #define BOOST_UBLAS_TEST_DO(x) EXPAND_(x)(test_fails_)
 
-#define BOOST_UBLAS_TEST_END() if (test_fails_ > 0) { std::cerr << "Number of failed tests: " << test_fails_ << std::endl; } else { std::cerr << "No failed test" << std::endl; }
+#define BOOST_UBLAS_TEST_END() if (test_fails_ > 0) { std::cerr << "Number of failed tests: " << test_fails_ << std::endl; return -1; \
+} else { std::cerr << "No failed test" << std::endl; return 0; }
 
 #define BOOST_UBLAS_TEST_CHECK(x) if (!(x)) { std::cerr << "Failed assertion: " << STRINGIFY_(x) << std::endl; ++test_fails_; }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk