Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

UnitTest Class Reference

Deprecated! Nice, but shell scripts really are much simpler in general, and allow us to use the same code for examples. More...

#include <UnitTest.h>

List of all members.


Detailed Description

Deprecated! Nice, but shell scripts really are much simpler in general, and allow us to use the same code for examples.

A test of part of some API. A UnitTest contains some identification information and a pointer to a function which performs the actual test.

You use it like this (in a .cpp file):


 # ifndef SKIP_UNIT_TESTS
 # include "UnitTest.h"

 UNIT_TEST(1, "title for this test, keyword1, keyword2, ...") 
 {
    ...
    out << "odd circumstance" << std::endl;
    ...
    return false;     // test failed!
 }


 UNIT_TEST(2, "") 
 {
    ...
    return (expected_result == obtained_result);    // true=test passed
 }
 # endif

Author:
\URL[Sandro Hawke]{http://www.w3.org/People/Sandro} (sandro@w3.org)
Version:
Id:
UnitTest.h,v 1.6 2001/09/19 19:41:52 sandro Exp

Definition at line 46 of file UnitTest.h.


Home to blindfold. This page generated via doxygen 1.2.11.1 Wed Oct 10 16:40:36 2001.