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

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

#include <unittest_AssertionException.hpp>

Inheritance diagram for unittest::AssertionException:
unittest::UnitTestException

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 Attributes

const RegInfotest

Detailed Description

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

Definition at line 46 of file unittest_AssertionException.hpp.


Constructor & Destructor Documentation

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

Definition at line 38 of file unittest_AssertionException.cpp.

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

Definition at line 42 of file unittest_AssertionException.cpp.


Member Function Documentation

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

Short message.

Returns:
the text passed as parameter to the constructor.

Definition at line 67 of file unittest_AssertionException.cpp.

void unittest::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 77 of file unittest_AssertionException.cpp.

const char * unittest::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 unittest::UnitTestException.

Definition at line 51 of file unittest_AssertionException.cpp.


Member Data Documentation

Definition at line 47 of file unittest_AssertionException.hpp.


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