summaryrefslogtreecommitdiff
path: root/tests/test.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test.h')
-rw-r--r--tests/test.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test.h b/tests/test.h
index 072b797..b337674 100644
--- a/tests/test.h
+++ b/tests/test.h
@@ -45,6 +45,8 @@
#include <windows.h>
#include <stdio.h>
+#define PTW32_THREAD_NULL_ID {NULL,0}
+
char * error_string[] = {
"ZERO_or_EOK",
"EPERM",
@@ -122,6 +124,16 @@ char * error_string[] = {
(fprintf(stderr, "Assertion failed: (%s), file %s, line %d\n", \
#e, __FILE__, (int) __LINE__), exit(1), 0))
+int assertE;
+# define assert_e(e, o, r) \
+ (((assertE = e) o (r)) ? ((ASSERT_TRACE) ? fprintf(stderr, \
+ "Assertion succeeded: (%s), file %s, line %d\n", \
+ #e, __FILE__, (int) __LINE__), \
+ fflush(stderr) : \
+ 0) : \
+ (fprintf(stderr, "Assertion failed: (%s %s %s), file %s, line %d, error %s\n", \
+ #e,#o,#r, __FILE__, (int) __LINE__, error_string[assertE]), exit(1), 0))
+
#endif /* NDEBUG */