Apple Developer Connection
Advanced Search
Member Login Log In | Not a Member? Contact ADC
ADC Home > Reference Library > Reference > Tools > Xcode > CPlusTest Reference

 


TestFailure

Declared In:

Overview

Exception that represents the failure of a unit test.

Discussion

A TestFailure is an exception that represents the failure of a unit test and records the file and line number of the failure along with a message describing the failure. While this class does not descend from std::exception it may be thrown.



Functions

file
Gets the source file in which the failure occurred.
line
Gets the line in the source file on which the failure occurred.
message
Gets informative text describing the failure.
TestFailure
Constructor for the TestFailure exception.
~TestFailure
Destructor for the TestFailure exception.

file


Gets the source file in which the failure occurred.

public

const std::string& file() const throw();
Return Value

The source file in which the failure occurred.

Discussion

Gets the source file in which the failure occurred.


line


Gets the line in the source file on which the failure occurred.

public

const unsigned int line() const throw();
Return Value

The line in the source file on which the failure occurred.

Discussion

Gets the line in the source file on which the failure occurred.


message


Gets informative text describing the failure.

public

const std::string& message() const throw();
Return Value

Informative text describing the failure.

Discussion

Gets informative text describing the failure.


TestFailure


Constructor for the TestFailure exception.

public

TestFailure( const std::string& file, const unsigned int line, const std::string& message) throw();
Parameters
file
The name of the source file in which the failure occurred.
line
The number of the line in the source file on which the failure occurred.
message
Informative text describing the failure.
Discussion

Constructor for the TestFailure exception.


~TestFailure


Destructor for the TestFailure exception.

public

virtual ~TestFailure() throw();
Discussion

Destructor for the TestFailure exception.




Did this document help you?
Yes: Tell us what works for you.

It’s good, but: Report typos, inaccuracies, and so forth.

It wasn’t helpful: Tell us what would have helped.
Last Updated: 2008-03-11