unittest.h File Reference

#include "rutz/error.h"
#include "rutz/fileposition.h"
#include "rutz/sfmt.h"
#include <cmath>
#include "rutz/debug.h"

Include dependency graph for unittest.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  rutz

Defines

#define TEST_REQUIRE(expr)   rutz::test_require(bool(expr), #expr, SRC_POS)
#define TEST_REQUIRE_EQ(expr1, expr2)
#define TEST_REQUIRE_APPROX(expr1, expr2, tol)
#define DEF_TEST(pkg, func)   pkg->def(#func, "", &func, SRC_POS)

Functions

void rutz::test_require (bool expr, const char *expr_string, const rutz::file_pos &pos)
template<class T, class U>
void rutz::test_require_eq (const T &expr1, const U &expr2, const char *expr_string1, const char *expr_string2, const rutz::file_pos &pos)
bool rutz::approx_eq (double a, double b, double tol=APPROX_TOL)
void rutz::test_require_approx_eq (double expr1, double expr2, double tol, const char *expr_string1, const char *expr_string2, const rutz::file_pos &pos)

Variables

const double rutz::APPROX_TOL = 1e-40


Detailed Description

helper functions for implementing unit tests

Definition in file unittest.h.


Define Documentation

#define TEST_REQUIRE_APPROX ( expr1,
expr2,
tol   ) 

Value:

rutz::test_require_approx_eq(expr1, expr2, tol, \
                               #expr1, #expr2, SRC_POS)

Definition at line 129 of file unittest.h.

#define TEST_REQUIRE_EQ ( expr1,
expr2   ) 

Value:

rutz::test_require_eq(expr1, expr2, \
                        #expr1, #expr2, SRC_POS)

Definition at line 125 of file unittest.h.


The software described here is Copyright (c) 1998-2005, Rob Peters.
This page was generated Wed Dec 3 06:52:14 2008 by Doxygen version 1.5.5.