From 70ca83702deb88fc8d3f20374eea61eceaef9af6 Mon Sep 17 00:00:00 2001 From: Gunter Winkler Date: Mon, 15 Mar 2010 19:59:11 +0000 Subject: [PATCH] see #3968 test/test_coordinate_matrix_sort.cpp: fixed wrong index in check test/utils.hpp: fixed wrong exit code on failure --- test/test_coordinate_matrix_sort.cpp | 6 ++++-- test/utils.hpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/test_coordinate_matrix_sort.cpp b/test/test_coordinate_matrix_sort.cpp index 48d34cac..afa58b45 100644 --- a/test/test_coordinate_matrix_sort.cpp +++ b/test/test_coordinate_matrix_sort.cpp @@ -1,4 +1,6 @@ -#define BOOST_UBLAS_NO_ELEMENT_PROXIES +#ifndef BOOST_UBLAS_NO_ELEMENT_PROXIES +# define BOOST_UBLAS_NO_ELEMENT_PROXIES +#endif #include #include @@ -51,7 +53,7 @@ BOOST_UBLAS_TEST_DEF( test_coordinate_matrix_sort ) 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 ); } diff --git a/test/utils.hpp b/test/utils.hpp index 5f67e116..d0a0c2a4 100644 --- a/test/utils.hpp +++ b/test/utils.hpp @@ -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_; }