2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-24 04:22:12 +00:00
Files
ublas/test/utils.hpp
David Bellot 2aa6c49524 added licenses where boost.inspect said they were missing
svn path=/trunk/libs/numeric/ublas/; revision=75583
2011-11-21 00:38:29 +00:00

39 lines
1.0 KiB
C++

// Copyright (c) 2011 David Bellot
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#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