#include <iostream>
#include <cstdlib>


Go to the source code of this file.
Classes | |
| struct | Location |
| struct | AssertFailure |
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 | CHECK_ASSERT(x) |
Typedefs | |
| typedef void | Test |
Functions | |
| 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, typename Y> | |
| void | assert_neq_fn (Location l, X x, Y y) |
| void | beginAssertFailure () |
| void | endAssertFailure () |
Variables | |
| int | assertFailure |
| #define assert | ( | x | ) | assert_fn( LOCATION( #x ), x ) |
Referenced by TestFs::_mkFilePath(), TestFs::_mkPath2(), TestEmpty::basic(), TestCommandlineEngine::clusteredShortOpts(), TestCommandlineEngine::commandsWithoutCommand(), TestCommandlineEngine::commandsWithOverlappingArgs(), TestCommandlineEngine::commandWithArg(), TestBuffer::copy(), TestCommandlineEngine::creationShortcuts(), TestFs::directoryIterate(), TestBuffer::emptiness(), endAssertFailure(), TestCommandlineCore::eraseAndAdvance(), TestException::generic(), TestFs::invalidDirectories(), TestChildprocess::kill(), TestCommandlineEngine::longOptsWithArgs(), TestCommandlineEngine::longOptsWithDashes(), TestBuffer::nonemptiness(), TestCommandlineEngine::optsAndArgs(), TestCommandlineEngine::optsOnly(), TestChildprocess::output(), Main::processStatus(), TestChildprocess::redirect(), TestBuffer::resize(), RunAll::runFrom(), TestChildprocess::shellCommand(), TestNetBuffer::skipBytes(), TestNetBuffer::startAtBeginning(), and TestException::system().
| #define assert_eq | ( | x, | |||
| y | ) | assert_eq_fn( LOCATION( #x " == " #y ), x, y ) |
Referenced by TestException::addContext(), TestException::badCast(), TestEmpty::basic(), TestCommandlineOptions::boolOpt(), TestCommandlineEngine::clusteredShortOpts(), TestCommandlineEngine::commandsWithoutCommand(), TestCommandlineEngine::commandsWithOverlappingArgs(), TestCommandlineEngine::commandWithArg(), TestBuffer::copy(), TestCommandlineEngine::creationShortcuts(), TestBuffer::emptiness(), TestCommandlineCore::eraseAndAdvance(), TestThread::execution(), 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(), TestNetBuffer::skipBytes(), TestNetBuffer::startAtBeginning(), TestCommandlineOptions::stringOpt(), TestException::system(), TestBuffer::takeover(), TestProcess::umask(), TestCommandlineOptions::vectorBoolOpt(), TestCommandlineOptions::vectorStringOpt(), RunAll::waitForAck(), and wibble::exception::AddContext::~AddContext().
| #define assert_neq | ( | x, | |||
| y | ) | assert_neq_fn( LOCATION( #x " != " #y ), x, y ) |
| #define CHECK_ASSERT | ( | x | ) |
Value:
do { \ if ( x ) return; \ else if ( assertFailure ) \ { \ ++assertFailure; \ return; \ } \ } while (0)
Referenced by assert_eq_fn(), assert_fn(), and assert_neq_fn().
| #define LOCATION | ( | stmt | ) | Location( __FILE__, __LINE__, stmt ) |
| typedef void Test |
| void assert_eq_fn | ( | Location | l, | |
| X | x, | |||
| Y | y | |||
| ) | [inline] |
References CHECK_ASSERT.
| void assert_fn | ( | Location | l, | |
| X | x | |||
| ) | [inline] |
References CHECK_ASSERT.
| void assert_neq_fn | ( | Location | l, | |
| X | x, | |||
| Y | y | |||
| ) | [inline] |
References CHECK_ASSERT.
| void beginAssertFailure | ( | ) | [inline] |
| void endAssertFailure | ( | ) | [inline] |
| int assertFailure |
Referenced by beginAssertFailure(), and endAssertFailure().
1.5.5