17 #ifndef AGXUNIT_AGXUNIT_H
18 #define AGXUNIT_AGXUNIT_H
20 #include <agx/config/AGX_USE_UNIT_TESTS.h>
21 #if AGX_USE_UNIT_TESTS()
48 static UnitTestManager *instance();
53 void parseArgs(
int& argc,
char **argv );
56 bool reportError(
const AssertMessage &message,
const SourceCodeInfo& info );
58 void setEnable(
bool flag ) { m_enable = flag; }
59 bool getEnable( )
const {
return m_enable; }
61 void setDoOnlyFastTests(
bool flag ) { m_doOnlyFastTests = flag; }
62 bool getDoOnlyFastTests( )
const {
return m_doOnlyFastTests; }
64 void setPassOnExceptions(
bool flag ) { m_passOnExceptions = flag; }
65 bool getPassOnExceptions( )
const {
return m_passOnExceptions; }
76 bool m_doOnlyFastTests;
77 bool m_passOnExceptions;
81 struct agxAssertion_utils
85 static bool equal(
const T& a,
const T&b)
92 std::ostringstream ost;
108 struct agxAssertion_utils<double>
110 static bool equal(
double a,
double b)
117 std::ostringstream str;
120 const int precision = DBL_DIG;
122 const int precision = 15;
124 str.precision( precision );
130 template <
typename T>
131 void agxAssertEquals(
const T& expected,
136 if ( !agxAssertion_utils<T>::equal(expected, actual ))
138 Assert::failNotEqual( agxAssertion_utils<T>::toString(expected),
139 agxAssertion_utils<T>::toString(actual),
153 SourceCodeInfo sourceLine,
165 SourceCodeInfo sourceLine,
#define AGXPHYSICS_EXPORT
A small argument parser class.
The agxIO namespace contains classes for reading, writing and finding files.
void AGXPHYSICS_EXPORT shutdown()
Shutdown agx.