testcase.hh File Reference

#include <iostream>
#include <string>
#include <iosfwd>
#include <complex>

Go to the source code of this file.

Classes

class  test::TestCase
 Base class for tests. More...
 

Namespaces

 test
 Unit tests.
 

Macros

#define _fail(str)   do_fail(str, __FILE__, __LINE__)
 Explicitly fails a test. More...
 
#define _numtest(num, orig)   do_numtest(num, orig, #num, #orig, __FILE__, __LINE__)
 Tests if num and orig are equal up to a rel. difference of 1e-10. More...
 
#define _numtesttol(num, orig, tol)   do_numtest(num, orig, #num, #orig, __FILE__, __LINE__, tol)
 Tests if num and orig are equal up to a rel. difference of tol. More...
 
#define _test(cond)   do_test(cond, #cond, __FILE__, __LINE__)
 Tests if cond is true (test passed) or not (test failed) More...
 

Detailed Description

Test from Chuck Allison in C/C++ Users Journal, September 2000: "The Simplest Automated Unit Test Framework That Could Possibly Work"

Definition in file testcase.hh.

Macro Definition Documentation

◆ _fail

#define _fail (   str)    do_fail(str, __FILE__, __LINE__)

Explicitly fails a test.

Definition at line 83 of file testcase.hh.

◆ _numtest

#define _numtest (   num,
  orig 
)    do_numtest(num, orig, #num, #orig, __FILE__, __LINE__)

Tests if num and orig are equal up to a rel. difference of 1e-10.

Definition at line 79 of file testcase.hh.

◆ _numtesttol

#define _numtesttol (   num,
  orig,
  tol 
)    do_numtest(num, orig, #num, #orig, __FILE__, __LINE__, tol)

Tests if num and orig are equal up to a rel. difference of tol.

Definition at line 81 of file testcase.hh.

◆ _test

#define _test (   cond)    do_test(cond, #cond, __FILE__, __LINE__)

Tests if cond is true (test passed) or not (test failed)

Definition at line 77 of file testcase.hh.

Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich