Test Macros Sample
Tests Description
Basic
These examples cover simple uses of each of the macro families. The names of the test methods contain either Pass or Fail. All methods containing Fail illustrates uses of test macros that result in failures. Methods containing Pass illustrate passing uses.
ExpectBool
This example demonstrates uses of the srEXPECT_TRUE() and srEXPECT_FALSE() test class macros.
Comparison
This example demonstrates uses of the srEXPECT_EQ(), srEXPECT_NE(), srEXPECT_GT(), srEXPECT_GE(), srEXPECT_LT() and srEXPECT_LE() macros.
CString
This example demonstrates use of the C-string (zero terminated character sequence) macros srEXPECT_STREQ(), srEXPECT_STRNE(), srEXPECT_STRCASEEQ() and srEXPECT_STRCASENE().
Exceptions
This example demonstrates use of the exception verification macros srEXPECT_THROW(), srEXPECT_THROW_ANY() and srEXPECT_NO_THROW(). Note there is only C++ implementation for this test.
Predicates
This example demonstrates use of the predicate based macros srEXPECT_PRED<n>().
FloatingPointComparison
This example demonstrates use of the macro used to test equality (or near equality) of floating point values srEXPECT_NEAR().
Assert
This example illustrates the use of the assertion macros (srASSERT_xx) which, in contrast to the expectation macros (srEXPECT_xx), cause the rest of the test case code to be bypassed.