Vault  4.1
Public Member Functions | Protected Attributes
VFailureEmitter Class Reference

There are some types of unit tests where you have to do some setup before actually invoking the VUnit subclass, where the setup can fail. More...

#include <vunit.h>

Inheritance diagram for VFailureEmitter:
VUnit

List of all members.

Public Member Functions

 VFailureEmitter (const VString &testName, bool logOnSuccess, bool throwOnError, const VString &errorMessage)
virtual void run ()
 Executes the unit test.

Protected Attributes

VString fErrorMessage

Detailed Description

There are some types of unit tests where you have to do some setup before actually invoking the VUnit subclass, where the setup can fail.

An example is setting up loopback socket, so that a unit test can send and receive data on the socket. If the setup fails, you want to emit a unit test failure to record the failure. This class lets you emit the failure information easily. Just declare this and give it a test name describing the failed setup operation, along with the error message you want shown, and "run" this unit test.

Definition at line 406 of file vunit.h.


Member Function Documentation

void VFailureEmitter::run ( ) [virtual]

Executes the unit test.

Must be overridden by concrete class.

Implements VUnit.

Definition at line 200 of file vunit.cpp.

References VString::chars(), VUnit::getName(), VUnit::logStatus(), and VUnit::test().


The documentation for this class was generated from the following files:

Copyright ©1997-2014 Trygve Isaacson. All rights reserved. This documentation was generated with Doxygen.