aboutsummaryrefslogtreecommitdiff
path: root/src/common/test.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2003-08-12 03:08:41 +0000
committerNick Mathewson <nickm@torproject.org>2003-08-12 03:08:41 +0000
commitc336c99e609b2918ca664bc1fdbfb916a6811508 (patch)
treeff04c4774b60cef2dce98d88497ac5ac4a3cb8e7 /src/common/test.h
parent5126f203f23773f64b51e5c0c7b7e1d702f26ca9 (diff)
downloadtor-c336c99e609b2918ca664bc1fdbfb916a6811508.tar.gz
tor-c336c99e609b2918ca664bc1fdbfb916a6811508.zip
Start of port to win32. Missing are:
- signal support - forking for DNS farm - changes for async IO - daemonizing In other words, some files still don't build, and the ones that do build, do nonblocking IO incorrectly. I'm also not checking in the project files till I have a good place for them. svn:r380
Diffstat (limited to 'src/common/test.h')
-rw-r--r--src/common/test.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/common/test.h b/src/common/test.h
index e80a964fca..a22b8dd93e 100644
--- a/src/common/test.h
+++ b/src/common/test.h
@@ -10,12 +10,18 @@
#define STMT_BEGIN do {
#define STMT_END } while (0)
+#ifdef __GNUC__
+#define PRETTY_FUNCTION __PRETTY_FUNCTION__
+#else
+#define PRETTY_FUNCTION ""
+#endif
+
#define test_fail() \
STMT_BEGIN \
printf("\nFile %s: line %d (%s): assertion failed.", \
__FILE__, \
__LINE__, \
- __PRETTY_FUNCTION__); \
+ PRETTY_FUNCTION); \
return; \
STMT_END
@@ -25,7 +31,7 @@
printf("\nFile %s: line %d (%s): assertion failed: (%s)\n", \
__FILE__, \
__LINE__, \
- __PRETTY_FUNCTION__, \
+ PRETTY_FUNCTION, \
#expr); \
return; \
} STMT_END
@@ -38,7 +44,7 @@
" (%ld != %ld)\n", \
__FILE__, \
__LINE__, \
- __PRETTY_FUNCTION__, \
+ PRETTY_FUNCTION, \
#expr1, #expr2, \
v1, v2); \
return; \
@@ -52,7 +58,7 @@
" (%ld == %ld)\n", \
__FILE__, \
__LINE__, \
- __PRETTY_FUNCTION__, \
+ PRETTY_FUNCTION, \
#expr1, #expr2, \
v1, v2); \
return; \
@@ -66,7 +72,7 @@
" (\"%s\" != \"%s\")\n", \
__FILE__, \
__LINE__, \
- __PRETTY_FUNCTION__, \
+ PRETTY_FUNCTION, \
#expr1, #expr2, \
v1, v2); \
return; \
@@ -80,7 +86,7 @@
" (\"%s\" == \"%s\")\n", \
__FILE__, \
__LINE__, \
- __PRETTY_FUNCTION__, \
+ PRETTY_FUNCTION, \
#expr1, #expr2, \
v1, v2); \
return; \
@@ -93,7 +99,7 @@
printf("\nFile %s: line %d (%s): Assertion failed: (%s==%s)\n", \
__FILE__, \
__LINE__, \
- __PRETTY_FUNCTION__, \
+ PRETTY_FUNCTION, \
#expr1, #expr2); \
return; \
} STMT_END
@@ -105,7 +111,7 @@
printf("\nFile %s: line %d (%s): Assertion failed: (%s!=%s)\n", \
__FILE__, \
__LINE__, \
- __PRETTY_FUNCTION__, \
+ PRETTY_FUNCTION, \
#expr1, #expr2); \
return; \
} STMT_END