2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-22 03:42:19 +00:00
Files
ublas/test/utils.hpp
Gunter Winkler b0d995246b close #3968: merge 60156,60215,60623,60780,61111 into release
boost/numeric/ublas/storage.hpp
libs/numeric/ublas/test/test_coordinate_matrix_sort.cpp
libs/numeric/ublas/test/utils.hpp
libs/numeric/ublas/test/Jamfile.v2
libs/numeric/ublas/doc/release_notes.htm



[SVN r61112]
2010-04-06 20:09:04 +00:00

35 lines
925 B
C++

/** -*- c++ -*- \file utils.hpp \brief Test utilities. */
#ifndef TEST_UTILS_HPP
#define TEST_UTILS_HPP
#include <iostream>
#define EXPAND_(x) x
#define STRINGIFY_(x) #x
#define JOIN_(x,y) x ## y
#ifndef NDEBUG
# define BOOST_UBLAS_DEBUG_TRACE(x) std::cerr << "[Debug>> " << EXPAND_(x) << std::endl
#else
# define BOOST_UBLAS_DEBUG_TRACE(x) /**/
#endif // NDEBUG
#define BOOST_UBLAS_TEST_BEGIN() unsigned int test_fails_(0)
#define BOOST_UBLAS_TEST_DEF(x) void EXPAND_(x)(unsigned int& test_fails_)
#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; 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_; }
#endif // TEST_UTILS_HPP