#include <wibble/string.h>
#include <iostream>
#include <cstdlib>
Go to the source code of this file.
|
#define | LOCATION(stmt) ::wibble::Location( __FILE__, __LINE__, stmt ) |
|
#define | LOCATION_I(stmt, i) ::wibble::Location( __FILE__, __LINE__, stmt, i ) |
|
#define | assert(x) assert_fn( LOCATION( #x ), x ) |
|
#define | assert_pred(p, x) |
|
#define | assert_eq(x, y) assert_eq_fn( LOCATION( #x " == " #y ), x, y ) |
|
#define | assert_leq(x, y) assert_leq_fn( LOCATION( #x " <= " #y ), x, y ) |
|
#define | assert_eq_l(i, x, y) assert_eq_fn( LOCATION_I( #x " == " #y, i ), x, y ) |
|
#define | assert_neq(x, y) assert_neq_fn( LOCATION( #x " != " #y ), x, y ) |
|
#define | assert_list_eq(x, y) |
|
#define | assert_unreachable(...) assert_die_fn( LOCATION( wibble::str::fmtf(__VA_ARGS__) ) ) |
|
#define | assert_unimplemented() assert_die_fn( LOCATION( "not imlemented" ) ) |
|
#define | assert_die() assert_die_fn( LOCATION( "forbidden code path tripped" ) ) |
|
|
template<typename X > |
AssertFailed & | wibble::operator<< (AssertFailed &f, X x) |
|
template<typename X > |
void | wibble::assert_fn (Location l, X x) |
|
void | wibble::assert_die_fn (Location l) |
|
template<typename X , typename Y > |
void | wibble::assert_eq_fn (Location l, X x, Y y) |
|
template<typename X , typename Y > |
void | wibble::assert_leq_fn (Location l, X x, Y y) |
|
template<typename X > |
void | wibble::assert_pred_fn (Location l, X x, bool p) |
|
template<typename X > |
void | wibble::assert_list_eq_fn (Location loc, int c, X l, const typename X::Type check[]) |
|
template<typename X , typename Y > |
void | wibble::assert_neq_fn (Location l, X x, Y y) |
|
void | wibble::beginAssertFailure () |
|
void | wibble::endAssertFailure () |
|
◆ assert
#define assert |
( |
|
x | ) |
assert_fn( LOCATION( #x ), x ) |
◆ assert_die
#define assert_die |
( |
| ) |
assert_die_fn( LOCATION( "forbidden code path tripped" ) ) |
◆ assert_eq
#define assert_eq |
( |
|
x, |
|
|
|
y |
|
) |
| assert_eq_fn( LOCATION( #x " == " #y ), x, y ) |
◆ assert_eq_l
#define assert_eq_l |
( |
|
i, |
|
|
|
x, |
|
|
|
y |
|
) |
| assert_eq_fn( LOCATION_I( #x " == " #y, i ), x, y ) |
◆ assert_leq
#define assert_leq |
( |
|
x, |
|
|
|
y |
|
) |
| assert_leq_fn( LOCATION( #x " <= " #y ), x, y ) |
◆ assert_list_eq
#define assert_list_eq |
( |
|
x, |
|
|
|
y |
|
) |
| |
Value: assert_list_eq_fn(
LOCATION( #x
" == " #y ), \
sizeof( y ) / sizeof( y[0] ), x, y )
#define LOCATION(stmt)
Definition test.h:23
◆ assert_neq
#define assert_neq |
( |
|
x, |
|
|
|
y |
|
) |
| assert_neq_fn( LOCATION( #x " != " #y ), x, y ) |
◆ assert_pred
#define assert_pred |
( |
|
p, |
|
|
|
x |
|
) |
| |
Value: assert_pred_fn( \
LOCATION( #p
"( " #x
" )" ), x, p( x ) )
◆ assert_unimplemented
#define assert_unimplemented |
( |
| ) |
assert_die_fn( LOCATION( "not imlemented" ) ) |
◆ assert_unreachable
◆ LOCATION
◆ LOCATION_I
◆ Test