OpenSimMirror/libraries/ode-0.9/tests/CppTestHarness/CheckMacros.h

28 lines
1.1 KiB
C
Raw Normal View History

2007-10-19 05:24:38 +00:00
#ifndef CHECK_MACROS_H
#define CHECK_MACROS_H
#include "Checks.h"
#define CHECK(value) \
if (!CppTestHarness::Check(value)) \
testResults_.ReportFailure(__FILE__, __LINE__, #value);
#define CHECK_EQUAL(actual, expected) \
if (!CppTestHarness::CheckEqual(actual, expected)) \
testResults_.ReportFailure(__FILE__, __LINE__, CppTestHarness::BuildFailureString(expected, actual));
#define CHECK_CLOSE(actual, expected, tolerance) \
if (!CppTestHarness::CheckClose(actual, expected, tolerance)) \
testResults_.ReportFailure(__FILE__, __LINE__, CppTestHarness::BuildFailureString(expected, actual));
#define CHECK_ARRAY_EQUAL(actual, expected, count) \
if (!CppTestHarness::CheckArrayEqual(actual, expected, count)) \
testResults_.ReportFailure(__FILE__, __LINE__, CppTestHarness::BuildFailureString(expected, actual, count));
#define CHECK_ARRAY_CLOSE(actual, expected, count, tolerance) \
if (!CppTestHarness::CheckArrayClose(actual, expected, count, tolerance)) \
testResults_.ReportFailure(__FILE__, __LINE__, CppTestHarness::BuildFailureString(expected, actual, count));
#endif