Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Functions
Teuchos_TestingHelpers.hpp File Reference

Utilities to make writing tests easier. More...

#include "Teuchos_ConfigDefs.hpp"
#include "Teuchos_ScalarTraits.hpp"
#include "Teuchos_TypeNameTraits.hpp"
#include "Teuchos_FancyOStream.hpp"

Go to the source code of this file.

Classes

class  Teuchos::RelErrSmallNumber< hasMachineParameters, Scalar >
 
class  Teuchos::RelErrSmallNumber< false, Scalar >
 
class  Teuchos::RelErrSmallNumber< true, Scalar >
 
struct  Teuchos::TestRelErr< T1, T2, Enabled >
 Compute, check and optionally print the relative error in two scalars. More...
 

Namespaces

namespace  Teuchos
 The Teuchos namespace contains all of the classes, structs and enums used by Teuchos, as well as a number of utility routines.
 

Macros

#define TEUCHOS_PASS_FAIL(RESULT)    Teuchos::passfail_with_location((RESULT), __FILE__, __LINE__)
 Macro that prints "passed" or "failed" and optionally prints the file name and line number as well.
 
#define TEUCHOS_ECHO(statement, out)
 Echo a statement and then invoke it.
 
#define TEUCHOS_TEST_EQUALITY_CONST(v1, v2, out, success)
 Test that an object is equal to a given constant.
 
#define TEUCHOS_TEST_ASSERT(v1, out, success)
 Assert that a give object is true.
 
#define TEUCHOS_TEST_EQUALITY(v1, v2, out, success)
 Test that two values are equal.
 
#define TEUCHOS_TEST_INEQUALITY_CONST(v1, v2, out, success)
 Test that an object is not equal to a given constant.
 
#define TEUCHOS_TEST_INEQUALITY(v1, v2, out, success)
 Test that two values are not equal.
 
#define TEUCHOS_TEST_FLOATING_EQUALITY(v1, v2, tol, out, success)
 Test if two floating point values are equal to a given tolerance.
 
#define TEUCHOS_TEST_ITER_EQUALITY(iter1, iter2, out, success)
 Test if two iterators are equal.
 
#define TEUCHOS_TEST_ITER_INEQUALITY(iter1, iter2, out, success)
 Test if two iterators are NOT equal.
 
#define TEUCHOS_TEST_ARRAY_ELE_EQUALITY(a, i, val, printPass, out, success)
 Test that an array element value is equal to a given constant.
 
#define TEUCHOS_TEST_ARRAY_ELE_INEQUALITY(a, i, val, printPass, out, success)
 Test that an array element value is not equal to a given constant.
 
#define TEUCHOS_TEST_MATRIX_ELE_FLOATING_EQUALITY(a, i, j, val, tol, printPass, out, success)
 Test if a floating-point array element value is equal to a given constant for a given tolerance.
 
#define TEUCHOS_TEST_MATRIX_ELE_EQUALITY(a, i, j, val, printPass, out, success)
 Test if a matrix element value is equal to a given constant.
 
#define TEUCHOS_TEST_COMPARE(v1, comp, v2, out, success)
 Compare two objects using an input comparsion operator.
 
#define TEUCHOS_TEST_COMPARE_CONST(v1, comp, v2, out, success)
 Compare an object and a constant using an input comparsion operator.
 
#define TEUCHOS_TEST_THROW(code, ExceptType, out, success)
 Test that the chunk of code 'code' throws an expected exception.
 
#define TEUCHOS_TEST_NOTHROW(code, out, success)
 Test that a chunk of code does not throw any exceptions.
 

Functions

void Teuchos::updateSuccess (const bool result, bool &success)
 Update the success bool flag.
 
const std::string Teuchos::passfail (const bool result)
 Return "passed" or "failed".
 
TEUCHOSCORE_LIB_DLL_EXPORT const std::string Teuchos::passfail_with_location (const bool result, const std::string &file, const int lineNumber)
 Helper function for TEUCHOS_PASS_FAIL(...).
 
void Teuchos::showTestFailureLocation (bool)
 Set if TEUCHOS_PASS_FAIL(...) should print test failure location.
 
bool Teuchos::showTestFailureLocation ()
 Return if TEUCHOS_PASS_FAIL(...) should print test failure location.
 
template<class Scalar >
Scalar Teuchos::defaultSmallNumber ()
 
template<class Scalar1 , class Scalar2 >
Teuchos::ScalarTraits< typenamestd::common_type< Scalar1, Scalar2 >::type >::magnitudeType Teuchos::relErr (const Scalar1 &s1, const Scalar2 &s2)
 Return relative error of two scalars.
 
template<class Array1 , class Array2 >
bool Teuchos::compareArrays (const Array1 &a1, const std::string &a1_name, const Array2 &a2, const std::string &a2_name, Teuchos::FancyOStream &out)
 Compare if two array objects are the same or not.
 
template<class Array1 , class Array2 , class ScalarMag >
bool Teuchos::compareFloatingArrays (const Array1 &a1, const std::string &a1_name, const Array2 &a2, const std::string &a2_name, const ScalarMag &tol, Teuchos::FancyOStream &out)
 Compare if two array objects are the same or not up to a relative floating point precision.
 

Detailed Description

Utilities to make writing tests easier.

Definition in file Teuchos_TestingHelpers.hpp.