Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInference 4.1.9.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALInferenceTest.h
Go to the documentation of this file.
1// Some utilities for quick and dirty debugging.
2#define ECHO_F(x) printf("%f\n", x)
3#define ECHO_S(x) printf("%s\n", x)
4#define ECHO_I(x) printf("%i\n", x)
5
6// Define test utility macros.
7#define TEST_RUN(name, count) \
8{ \
9 count += name(); \
10 printf("\n"); \
11}
12#define TEST_HEADER() \
13 printf("Testing: %s\n", __func__); \
14 int test_failure_count = 0
15#define TEST_FOOTER() \
16{ \
17 if (test_failure_count > 0) \
18 printf("%i test(s) failed.\n", test_failure_count); \
19 else \
20 printf("All tests passed.\n"); \
21 return test_failure_count; \
22}
23#define TEST_FAIL(...) \
24{ \
25 fprintf(stderr, "FAIL - %s (%s:%i): ", __func__, __FILE__, __LINE__); \
26 fprintf(stderr, __VA_ARGS__); \
27 fprintf(stderr, "\n"); \
28 test_failure_count += 1; \
29}
30
31int compareFloats(REAL8 x, REAL8 y, REAL8 epsilon);
32
34{
35 return fabs(x - y) < epsilon;
36}
int compareFloats(REAL8 x, REAL8 y, REAL8 epsilon)
double REAL8
list y