Skip to content

Commit 1db1128

Browse files
committed
Add documentation for usage of ASSERT_EQUAL
1 parent e05d690 commit 1db1128

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

OpenSim/Auxiliary/auxiliaryTestFunctions.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@
3535
#include <regex>
3636
#include <type_traits>
3737

38+
/**
39+
* ASSERT_EQUAL is a general utility for comparing two values and throwing
40+
* an Exception with a caller defined message when values are not equivalent.
41+
* Note, ASSERT_EQUAL is typically used to verify that some found value matches
42+
* a given expected or standard value. If the expected value is NaN,
43+
* ASSERT_EQUAL will NOT throw if the found value is also NaN. This is
44+
* particularly helpful for comparing motion capture data where missing data
45+
* are denoted by NaN values. If NaNs are not acceptable for your test, then
46+
* the expected value should not be NaN. In the case of floating point values
47+
* (or containers of floating points) a tolerance of the same value type is
48+
* required.
49+
*/
3850
template <typename T,
3951
typename std::enable_if<std::is_floating_point<T>::value>::type* = nullptr >
4052
void ASSERT_EQUAL(T expected,

0 commit comments

Comments
 (0)