unittest.h File Reference

Go to the source code of this file.

Classes

struct  _testfunc
class  UnitTest

Typedefs

typedef _testfunc TestFunc

Functions

template<class T>
bool valarray_equals (std::valarray< T > &v1, std::valarray< T > &v2)
template<class T>
void valarray_print (std::valarray< T > &v, const char *label)
bool double_array_equals (const double *a, const double *b, const int size, const double tol)
 Test whether the arrays are equals within tolerance for the first <size> elements.


Typedef Documentation

typedef struct _testfunc TestFunc

Each unit test builds a table that can be traversed to exercise each function in the component.


Function Documentation

bool double_array_equals ( const double *  a,
const double *  b,
const int  size,
const double  tol 
)

Test whether the arrays are equals within tolerance for the first <size> elements.

Parameters:
double * a array of doubles.
double * b array of doubles.
int size the number of elements to traverse
double tol tolerance within which the arrays are assumed equal.
Returns:
bool true if equal within tolerance, false otherwise.
Warning:
No error checking in this function. The user is responsible for ensuring that the allocated sizes are within the size parameter.

template<class T>
bool valarray_equals ( std::valarray< T > &  v1,
std::valarray< T > &  v2 
)

Definition at line 81 of file unittest.h.

template<class T>
void valarray_print ( std::valarray< T > &  v,
const char *  label 
)

Definition at line 98 of file unittest.h.

Generated on Mon Oct 23 15:05:36 2006 for OpenSees by doxygen 1.5.0