ReFRACtor
|
#include "global_fixture.h"
#include "ifstream_cs.h"
#include <boost/test/unit_test.hpp>
#include <boost/test/floating_point_comparison.hpp>
#include <blitz/array.h>
#include <string>
Go to the source code of this file.
Macros | |
#define | BOOST_CHECK_ARRAYAD_CLOSE(A, B) BOOST_CHECK_MATRIX_CLOSE(A.value(), B.value()); BOOST_CHECK_MATRIX_CLOSE(A.jacobian(), B.jacobian()) |
#define | BOOST_CHECK_ARRAYAD_CLOSE_TOL(A, B, tol) BOOST_CHECK_MATRIX_CLOSE_TOL(A.value(), B.value(), tol); BOOST_CHECK_MATRIX_CLOSE_TOL(A.jacobian(), B.jacobian(), tol) |
Check for two ArrayAd being equal. More... | |
#define | BOOST_CHECK_MATRIX_CLOSE(A, B) BOOST_CHECK_MATRIX_CLOSE_TOL(A, B, 1e-8) |
#define | BOOST_CHECK_MATRIX_CLOSE_TOL(A, B, tol) BOOST_CHECK_LT(max(abs(A - (B))), tol) |
Check for two matrixes being equal. More... | |
#define | CHECK_THROW_EXCEPTION(S, V) |
Throw Exception, with string the given value. More... | |
#define | is_long_test() |
Mark as test as "long". More... | |
#define | is_really_long_test() |
#define | is_timing_test() |
Mark as test as "timing". More... | |
Functions | |
template<class T > | |
void | compare_item_by_item (const blitz::Array< T, 1 > &A, const blitz::Array< T, 1 > &B, double tol, bool show_all=false) |
Go through two 1D arrays and compare items item by item. More... | |
template<class T > | |
void | compare_item_by_item (const blitz::Array< T, 2 > &A, const blitz::Array< T, 2 > &B, double tol, bool show_all=false) |
Go through two 2D arrays and compare items item by item. More... | |
template<class T > | |
void | compare_item_by_item (const blitz::Array< T, 3 > &A, const blitz::Array< T, 3 > &B, double tol, bool show_all=false) |
Go through two 3D arrays and compare items item by item. More... | |
template<class T > | |
void | compare_item_by_item (const blitz::Array< T, 4 > &A, const blitz::Array< T, 4 > &B, double tol, bool show_all=false) |
Go through two 4D arrays and compare items item by item. More... | |
template<class T , int N> | |
void | compare_shapes (const blitz::Array< T, N > &A, const blitz::Array< T, N > &B) |
#define BOOST_CHECK_ARRAYAD_CLOSE | ( | A, | |
B | |||
) | BOOST_CHECK_MATRIX_CLOSE(A.value(), B.value()); BOOST_CHECK_MATRIX_CLOSE(A.jacobian(), B.jacobian()) |
Definition at line 29 of file unit_test_support.h.
#define BOOST_CHECK_ARRAYAD_CLOSE_TOL | ( | A, | |
B, | |||
tol | |||
) | BOOST_CHECK_MATRIX_CLOSE_TOL(A.value(), B.value(), tol); BOOST_CHECK_MATRIX_CLOSE_TOL(A.jacobian(), B.jacobian(), tol) |
Check for two ArrayAd being equal.
Definition at line 28 of file unit_test_support.h.
#define BOOST_CHECK_MATRIX_CLOSE | ( | A, | |
B | |||
) | BOOST_CHECK_MATRIX_CLOSE_TOL(A, B, 1e-8) |
Definition at line 22 of file unit_test_support.h.
#define BOOST_CHECK_MATRIX_CLOSE_TOL | ( | A, | |
B, | |||
tol | |||
) | BOOST_CHECK_LT(max(abs(A - (B))), tol) |
Check for two matrixes being equal.
Definition at line 21 of file unit_test_support.h.
#define CHECK_THROW_EXCEPTION | ( | S, | |
V | |||
) |
Throw Exception, with string the given value.
Definition at line 35 of file unit_test_support.h.
#define is_long_test | ( | ) |
Mark as test as "long".
We only run these tests when doing "long_check", the normal "check" doesn't run these. This is handled by checking for the environment variable L2_FP_LONG_CHECK (so when debugging long tests you need to define this environment variable)
Definition at line 142 of file unit_test_support.h.
#define is_really_long_test | ( | ) |
Definition at line 148 of file unit_test_support.h.
#define is_timing_test | ( | ) |
Mark as test as "timing".
We only run these tests when doing "timing_check", the normal "check" doesn't run these. This is handled by checking for the environment variable L2_FP_TIMING_CHECK (so when debugging long tests you need to define this environment variable)
Definition at line 162 of file unit_test_support.h.
|
inline |
Go through two 1D arrays and compare items item by item.
Definition at line 55 of file unit_test_support.h.
|
inline |
Go through two 2D arrays and compare items item by item.
Definition at line 73 of file unit_test_support.h.
|
inline |
Go through two 3D arrays and compare items item by item.
Definition at line 93 of file unit_test_support.h.
|
inline |
Go through two 4D arrays and compare items item by item.
Definition at line 115 of file unit_test_support.h.
|
inline |
Definition at line 44 of file unit_test_support.h.