If you need to capture information about an exception in the Setup, Test, or Reset member functions, override TTest::HandleException, which is called whenever an exception is caught. To capture information about an exception that occurs in the Cleanup member function, override HandleCleanupException.
Both HandleException member functions make a copy of the exception, which you can retrieve with CreateException or CreateCleanupException. You can override the HandleException member functions to be notified when an exception occurs or to repair a test after an exception to make it streamable to the log.
Tests with uncaught exceptions fail by definition; if an uncaught exception occurs, TTest::Run will call SetSuccess(false) before calling HandleException.
To get information about an exception:
void TSampleObjectBaseTest::HandleException(const TStandardException& exception)
{
TTest::HandleException(exception);
OutputTextStream() << "\nHandleException!\n";
}
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Generated with WebMaker