Functions
testlib_test.cxx File Reference
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <complex>
#include "testlib_test.h"

Go to the source code of this file.

Functions

void testlib_test_start (const char *name)
 initialise test counters, check test name 'name' exists. More...
 
void testlib_test_begin (const char *msg)
 increment number of tests, then output msg. More...
 
void testlib_test_perform (bool success)
 increment success/failure counters. More...
 
int testlib_test_summary ()
 output summary of tests performed. More...
 
void testlib_test_assert (const std::string &msg, bool expr)
 output msg, then perform test in expr. More...
 
void testlib_test_assert_near (const std::string &msg, double expr, double target, double tol)
 output msg, then perform test to see if expr is within tol of target. More...
 
void testlib_test_assert_near (const std::string &msg, std::complex< double > expr, std::complex< double > target, double tol)
 output msg, then perform test to see if expr is within tol of target. More...
 
void testlib_test_assert_near_relative (const std::string &msg, double expr, double target, double tol)
 output msg, then test to see if expr is within relative tol of target. More...
 
void testlib_test_assert_near_relative (const std::string &msg, std::complex< double > expr, std::complex< double > target, double tol)
 output msg, then test to see if expr is within relative tol of target. More...
 
void testlib_test_assert_far (const std::string &msg, double expr, double target, double tol)
 output msg, then perform test to see if expr is not within tol of target. More...
 
void testlib_test_assert_far (const std::string &msg, std::complex< double > expr, std::complex< double > target, double tol)
 output msg, then perform test to see if expr is not within tol of target. More...
 
void testlib_test_assert_equal (const std::string &msg, long expr, long target)
 output msg, then perform test to see if expr is equal to target. More...
 

Function Documentation

◆ testlib_test_assert()

void testlib_test_assert ( const std::string &  msg,
bool  expr 
)

output msg, then perform test in expr.

Definition at line 98 of file testlib_test.cxx.

◆ testlib_test_assert_equal()

void testlib_test_assert_equal ( const std::string &  msg,
long  expr,
long  target 
)

output msg, then perform test to see if expr is equal to target.

Definition at line 162 of file testlib_test.cxx.

◆ testlib_test_assert_far() [1/2]

void testlib_test_assert_far ( const std::string &  msg,
double  expr,
double  target,
double  tol 
)

output msg, then perform test to see if expr is not within tol of target.

Definition at line 144 of file testlib_test.cxx.

◆ testlib_test_assert_far() [2/2]

void testlib_test_assert_far ( const std::string &  msg,
std::complex< double >  expr,
std::complex< double >  target,
double  tol 
)

output msg, then perform test to see if expr is not within tol of target.

Definition at line 153 of file testlib_test.cxx.

◆ testlib_test_assert_near() [1/2]

void testlib_test_assert_near ( const std::string &  msg,
double  expr,
double  target,
double  tol 
)

output msg, then perform test to see if expr is within tol of target.

Definition at line 104 of file testlib_test.cxx.

◆ testlib_test_assert_near() [2/2]

void testlib_test_assert_near ( const std::string &  msg,
std::complex< double >  expr,
std::complex< double >  target,
double  tol 
)

output msg, then perform test to see if expr is within tol of target.

Definition at line 113 of file testlib_test.cxx.

◆ testlib_test_assert_near_relative() [1/2]

void testlib_test_assert_near_relative ( const std::string &  msg,
double  expr,
double  target,
double  tol 
)

output msg, then test to see if expr is within relative tol of target.

Definition at line 122 of file testlib_test.cxx.

◆ testlib_test_assert_near_relative() [2/2]

void testlib_test_assert_near_relative ( const std::string &  msg,
std::complex< double >  expr,
std::complex< double >  target,
double  tol 
)

output msg, then test to see if expr is within relative tol of target.

Definition at line 133 of file testlib_test.cxx.

◆ testlib_test_begin()

void testlib_test_begin ( const char *  msg)

increment number of tests, then output msg.

Definition at line 43 of file testlib_test.cxx.

◆ testlib_test_perform()

void testlib_test_perform ( bool  success)

increment success/failure counters.

Definition at line 55 of file testlib_test.cxx.

◆ testlib_test_start()

void testlib_test_start ( const char *  name)

initialise test counters, check test name 'name' exists.

Definition at line 31 of file testlib_test.cxx.

◆ testlib_test_summary()

int testlib_test_summary ( )

output summary of tests performed.

Definition at line 66 of file testlib_test.cxx.