wibble  1.1
Classes | Namespaces | Constant Groups | Macros | Typedefs | Functions
test.h File Reference
#include <wibble/string.h>
#include <iostream>
#include <cstdlib>
Include dependency graph for test.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wibble::Location
 
struct  wibble::AssertFailed
 
struct  wibble::ExpectFailure
 

Namespaces

 wibble
 

Constant Groups

 wibble
 

Macros

#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" ) )
 

Typedefs

typedef void Test
 

Functions

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 ()
 

Macro Definition Documentation

#define assert (   x)    assert_fn( LOCATION( #x ), x )

Referenced by TestFs::_deleteIfExists(), TestFs::_isdir(), TestFs::_mkdirIfMissing(), TestFs::_mkFilePath(), TestFs::_mkPath2(), TestList::append(), TestEmpty::basic(), TestList::checkListSorted(), TestList::checkOddList(), TestCommandlineEngine::clusteredShortOpts(), TestCommandlineEngine::commandsWithoutCommand(), TestCommandlineEngine::commandsWithOverlappingArgs(), TestCommandlineEngine::commandWithArg(), wibble::Parser< Token, Stream >::context(), TestBuffer::copy(), TestCommandlineEngine::creationShortcuts(), TestFs::directoryIsdir(), TestFs::directoryIterate(), TestBuffer::emptiness(), TestList::empty(), wibble::endAssertFailure(), TestCommandlineCore::eraseAndAdvance(), TestException::generic(), TestFs::invalidDirectories(), TestChildprocess::kill(), TestCommandlineEngine::longOptsWithArgs(), TestCommandlineEngine::longOptsWithDashes(), wibble::sys::Pipe::nextLine(), wibble::sys::Pipe::nextLineBlocking(), TestBuffer::nonemptiness(), TestCommandlineEngine::noSwitchesAfterFirstArg(), TestCommandlineEngine::optsAndArgs(), TestCommandlineEngine::optsOnly(), TestChildprocess::output(), Main::processStatus(), TestMMapV2::read(), wibble::sys::Pipe::readMore(), TestChildprocess::redirect(), TestBuffer::resize(), wibble::ParseContext< Token, Stream >::rewind(), RunAll::runFrom(), TestChildprocess::shellCommand(), wibble::Lexer< Token, IOStream >::shift(), TestMMap::simple(), TestList::single(), TestNetBuffer::skipBytes(), TestNetBuffer::startAtBeginning(), wibble::ParseContext< Token, Stream >::stream(), TestException::system(), TestFs::timestamp(), wibble::sys::Pipe::wait(), and wibble::Lexer< Token, IOStream >::window().

#define assert_die ( )    assert_die_fn( LOCATION( "forbidden code path tripped" ) )
#define assert_eq (   x,
 
)    assert_eq_fn( LOCATION( #x " == " #y ), x, y )

Referenced by TestException::addContext(), TestList::append(), TestList::appendCount(), TestException::badCast(), TestEmpty::basic(), TestCommandlineOptions::boolOpt(), TestList::checkOddList(), TestCommandlineEngine::clusteredShortOpts(), TestCommandlineEngine::commandsWithoutCommand(), TestCommandlineEngine::commandsWithOverlappingArgs(), TestCommandlineEngine::commandWithArg(), TestBuffer::copy(), TestList::count(), TestCommandlineEngine::creationShortcuts(), TestBuffer::emptiness(), TestCommandlineCore::eraseAndAdvance(), TestThread::execution(), TestList::filtered(), TestProcess::getcwdAndChdir(), TestChildprocess::inout(), TestCommandlineOptions::intOpt(), TestCommandlineCore::isSwitch(), TestChildprocess::kill(), TestParse::lexer(), TestCommandlineEngine::longOptsWithArgs(), TestCommandlineEngine::longOptsWithDashes(), TestBuffer::nonemptiness(), TestCommandlineEngine::noSwitchesAfterFirstArg(), TestCommandlineEngine::optsAndArgs(), TestCommandlineEngine::optsOnly(), TestChildprocess::output(), Main::processStatus(), TestMMapV2::read(), TestChildprocess::redirect(), TestBuffer::resize(), wibble::sys::Pipe::Writer::run(), TestThread::sharedMemory(), TestChildprocess::shellCommand(), TestSignal::sigAction(), TestSignal::sigProcMask(), TestMMap::simple(), TestList::single(), TestNetBuffer::skipBytes(), TestList::sorted(), TestNetBuffer::startAtBeginning(), TestList::stl(), TestCommandlineOptions::stringOpt(), TestException::system(), TestBuffer::takeover(), TestFs::timestamp(), TestProcess::umask(), TestList::unique(), TestCommandlineOptions::vectorBoolOpt(), TestCommandlineOptions::vectorStringOpt(), Main::waitForAck(), TestFs::writeFileAtomically(), and wibble::exception::AddContext::~AddContext().

#define assert_eq_l (   i,
  x,
 
)    assert_eq_fn( LOCATION_I( #x " == " #y, i ), x, y )
#define assert_leq (   x,
 
)    assert_leq_fn( LOCATION( #x " <= " #y ), x, y )
#define assert_list_eq (   x,
 
)
Value:
assert_list_eq_fn( LOCATION( #x " == " #y ), \
sizeof( y ) / sizeof( y[0] ), x, y )
#define assert_neq (   x,
 
)    assert_neq_fn( LOCATION( #x " != " #y ), x, y )
#define assert_pred (   p,
 
)
Value:
LOCATION( #p "( " #x " )" ), x, p( x ) )
#define assert_unimplemented ( )    assert_die_fn( LOCATION( "not imlemented" ) )
#define assert_unreachable (   ...)    assert_die_fn( LOCATION( wibble::str::fmtf(__VA_ARGS__) ) )
#define LOCATION (   stmt)    ::wibble::Location( __FILE__, __LINE__, stmt )
#define LOCATION_I (   stmt,
 
)    ::wibble::Location( __FILE__, __LINE__, stmt, i )

Typedef Documentation

typedef void Test