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  Location
struct  AssertFailed
struct  ExpectFailure

Defines

#define LOCATION(stmt)   Location( __FILE__, __LINE__, stmt )
#define assert(x)   assert_fn( LOCATION( #x ), x )
#define assert_eq(x, y)   assert_eq_fn( LOCATION( #x " == " #y ), x, y )
#define assert_neq(x, y)   assert_neq_fn( LOCATION( #x " != " #y ), x, y )
#define assert_list_eq(x, y)

Typedefs

typedef void Test

Functions

template<typename X >
AssertFailedoperator<< (AssertFailed &f, X x)
template<typename X >
void assert_fn (Location l, X x)
template<typename X , typename Y >
void assert_eq_fn (Location l, X x, Y y)
template<typename X >
void assert_list_eq_fn (Location loc, int c, X l, const typename X::Type check[])
template<typename X , typename Y >
void assert_neq_fn (Location l, X x, Y y)
void beginAssertFailure ()
void endAssertFailure ()

Variables

int assertFailure


Define Documentation

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

#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(), TestCommandlineOptions::intOpt(), TestCommandlineCore::isSwitch(), TestChildprocess::kill(), TestCommandlineEngine::longOptsWithArgs(), TestCommandlineEngine::longOptsWithDashes(), TestBuffer::nonemptiness(), TestCommandlineEngine::optsAndArgs(), TestCommandlineEngine::optsOnly(), TestChildprocess::output(), Main::parent(), Main::processStatus(), TestChildprocess::redirect(), TestBuffer::resize(), TestThread::sharedMemory(), TestChildprocess::shellCommand(), TestMMap::simple(), TestList::single(), TestNetBuffer::skipBytes(), TestList::sorted(), TestNetBuffer::startAtBeginning(), TestList::stl(), TestCommandlineOptions::stringOpt(), TestException::system(), TestList::take(), TestBuffer::takeover(), TestProcess::umask(), TestList::unique(), TestCommandlineOptions::vectorBoolOpt(), TestCommandlineOptions::vectorStringOpt(), RunAll::waitForAck(), and wibble::exception::AddContext::~AddContext().

#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 LOCATION ( stmt   )     Location( __FILE__, __LINE__, stmt )


Typedef Documentation

typedef void Test


Function Documentation

template<typename X , typename Y >
void assert_eq_fn ( Location  l,
x,
y 
) [inline]

template<typename X >
void assert_fn ( Location  l,
x 
) [inline]

template<typename X >
void assert_list_eq_fn ( Location  loc,
int  c,
l,
const typename X::Type  check[] 
) [inline]

template<typename X , typename Y >
void assert_neq_fn ( Location  l,
x,
y 
) [inline]

void beginAssertFailure (  )  [inline]

References assertFailure.

Referenced by ExpectFailure::ExpectFailure().

void endAssertFailure (  )  [inline]

References assert, and assertFailure.

Referenced by ExpectFailure::~ExpectFailure().

template<typename X >
AssertFailed& operator<< ( AssertFailed f,
x 
) [inline]

References AssertFailed::str.


Variable Documentation


Generated on Fri Jun 12 05:14:13 2009 for wibble by  doxygen 1.5.9