Update test suite to use dqn_tester
This commit is contained in:
parent
721c059c4e
commit
f629c019e6
25
dqn_tester.h
25
dqn_tester.h
@ -75,7 +75,9 @@
|
|||||||
all_clear ? "OK" : "FAILED"); \
|
all_clear ? "OK" : "FAILED"); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define DQN_TESTER_ASSERT(test, expr, fmt, ...) DQN_TESTER_ASSERT_AT((test), __FILE__, __LINE__, expr, fmt, ## __VA_ARGS__)
|
#define DQN_TESTER_ASSERTF(test, expr, fmt, ...) DQN_TESTER_ASSERTF_AT((test), __FILE__, __LINE__, (expr), fmt, ## __VA_ARGS__)
|
||||||
|
|
||||||
|
#define DQN_TESTER_ASSERT(test, expr) DQN_TESTER_ASSERT_AT((test), __FILE__, __LINE__, (expr))
|
||||||
|
|
||||||
#define DQN_TESTER_LOG(test, fmt, ...) \
|
#define DQN_TESTER_LOG(test, fmt, ...) \
|
||||||
do \
|
do \
|
||||||
@ -84,7 +86,7 @@
|
|||||||
fprintf(stdout, "%*s" fmt "\n", DQN_TESTER_SPACING * 2, "", ##__VA_ARGS__); \
|
fprintf(stdout, "%*s" fmt "\n", DQN_TESTER_SPACING * 2, "", ##__VA_ARGS__); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define DQN_TESTER_ASSERT_AT(test, file, line, expr, fmt, ...) \
|
#define DQN_TESTER_ASSERTF_AT(test, file, line, expr, fmt, ...) \
|
||||||
do \
|
do \
|
||||||
{ \
|
{ \
|
||||||
if (!(expr)) \
|
if (!(expr)) \
|
||||||
@ -107,6 +109,25 @@
|
|||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
#define DQN_TESTER_ASSERT_AT(test, file, line, expr) \
|
||||||
|
do \
|
||||||
|
{ \
|
||||||
|
if (!(expr)) \
|
||||||
|
{ \
|
||||||
|
if ((test)->log_count++ == 0) fprintf(stdout, "\n"); \
|
||||||
|
(test)->failed = true; \
|
||||||
|
fprintf(stderr, \
|
||||||
|
"%*sFile: %s:%d\n" \
|
||||||
|
"%*sExpression: [" #expr "]\n", \
|
||||||
|
DQN_TESTER_SPACING * 2, \
|
||||||
|
"", \
|
||||||
|
file, \
|
||||||
|
line, \
|
||||||
|
DQN_TESTER_SPACING * 2, \
|
||||||
|
""); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// NOTE: Header
|
// NOTE: Header
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
1177
dqn_tests.cpp
1177
dqn_tests.cpp
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user