aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ode-0.9/tests/CppTestHarness/CheckMacros.h
blob: 85040b123472e77071d685270f1494bbed61da5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#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