CPUnit 0.95 (beta)
The REAL C++ port of JUnit.
cpunit::priv Namespace Reference

Functions

template<class T >
max (const T &a, const T &b)
 Returns the larger of two values.
template<class T >
abs (const T &a)
 Returns the absolute value of an object.
template<class T >
void fail_equals (const std::string &msg, const T &expected, const T &actual)
 Throws an AssertionException with a message consistent with being the cause of a failed assert_equals call.

Function Documentation

template<class T >
T cpunit::priv::abs ( const T &  a)

Returns the absolute value of an object.

Template Parameters:
TThe type of object to return the absolute value of. The type must support the unary operator '-', as well as the partial ordering operator '<'.
Parameters:
aThe object to find the absolute value of.
Returns:
The absolute value of 'a'.

Definition at line 131 of file cpunit_Assert.tcc.

template<class T >
void cpunit::priv::fail_equals ( const std::string &  msg,
const T &  expected,
const T &  actual 
)

Throws an AssertionException with a message consistent with being the cause of a failed assert_equals call.

Template Parameters:
TThe type of object failing in comparision. The type must support the std::ostream& operator << (std::ostream&, const T&).
Parameters:
msgThe text message to show together with the text "ASSERT EQUALS FAILED - ".
expectedThe expected value.
actualThe actual value.
Exceptions:
AssertionExceptionallways.

Definition at line 146 of file cpunit_Assert.tcc.

template<class T >
T cpunit::priv::max ( const T &  a,
const T &  b 
)

Returns the larger of two values.

Template Parameters:
TThe type of objects to compare. The type must support the partial ordering operator '<'.
Parameters:
aThe first operand.
bThe second operand.
Returns:
'a' if it is not less than 'b', therwise 'b'.

Definition at line 118 of file cpunit_Assert.tcc.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines