Name

NotEqualException

Description

The class NotEqualException (see Figure C-8) is a subclass of Exception. A NotEqualException is thrown when an equality assertion fails. Its Type is CppUnit::NotEqualException.

NotEqualException belongs to the namespace CppUnit. It is declared in NotEqualException.h and implemented in NotEqualException.cpp.

The class NotEqualException
Figure C-8. The class NotEqualException

Declaration

class NotEqualException : public Exception

Constructors/Destructors

NotEqualException(string expected, string actual, SourceLine sourceLine = SourceLine( ), string additionalMessage = "")

A constructor for NotEqualException. The string arguments expected and actual represent the values that fail the equality test and cause the NotEqualException. The sourceLine and additionalMessage arguments have default empty values.

NotEqualException(const NotEqualException& other)

A copy constructor.

virtual ~NotEqualException( ) throw( )

A destructor.

Public Methods

NotEqualException& operator=(const NotEqualException& other)

A copy operator.

string actualValue( ) const

Returns the actual value.

string additionalMessage( ) const

Returns the additionalMessage.

virtual Exception *clone( ) const

Returns a copy of the NotEqualException.

string expectedValue( ) const

Returns the expected value.

virtual bool isInstanceOf(const Type& type) const

Returns TRUE if the NotEqualException is of the given Type. Used for runtime ...

Get Unit Test Frameworks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.