CPUnit 0.95 (beta)
The REAL C++ port of JUnit.
cpunit::AssertionException Class Reference

Thrown when an assert fails, or if someone calls cpunit::fail(). More...

#include <cpunit_AssertionException.hpp>

Inheritance diagram for cpunit::AssertionException:
cpunit::CPUnitException

List of all members.

Public Member Functions

 AssertionException (const std::string &m) throw ()
virtual ~AssertionException () throw ()
virtual const char * what () const throw ()
 Long message.
virtual const char * get_message () const throw ()
 Short message.
virtual void set_test (const RegInfo &t) throw ()
 Registers test data.

Private Member Functions

void generate_what_msg ()

Private Attributes

const RegInfotest
std::string what_msg

Detailed Description

Thrown when an assert fails, or if someone calls cpunit::fail().

Definition at line 46 of file cpunit_AssertionException.hpp.


Constructor & Destructor Documentation

cpunit::AssertionException::AssertionException ( const std::string &  m) throw ()
Parameters:
mThe exception message.

Definition at line 38 of file cpunit_AssertionException.cpp.

cpunit::AssertionException::~AssertionException ( ) throw () [virtual]

Definition at line 46 of file cpunit_AssertionException.cpp.


Member Function Documentation

void cpunit::AssertionException::generate_what_msg ( ) [private]

Definition at line 78 of file cpunit_AssertionException.cpp.

const char * cpunit::AssertionException::get_message ( ) const throw () [virtual]

Short message.

Returns:
the text passed as parameter to the constructor.

Definition at line 63 of file cpunit_AssertionException.cpp.

void cpunit::AssertionException::set_test ( const RegInfo t) throw () [virtual]

Registers test data.

This method can be called to set the test data before propagating the exception out to the main method.

Parameters:
tThe RegInfo for the test that has failed.

Definition at line 73 of file cpunit_AssertionException.cpp.

const char * cpunit::AssertionException::what ( ) const throw () [virtual]

Long message.

In particular, the returned string contains both the exception message and data from the possibly contained RegInfo.

Returns:
a full report of the contained exception information.

Reimplemented from cpunit::CPUnitException.

Definition at line 55 of file cpunit_AssertionException.cpp.


Member Data Documentation

Definition at line 47 of file cpunit_AssertionException.hpp.

std::string cpunit::AssertionException::what_msg [private]

Definition at line 48 of file cpunit_AssertionException.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines