diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-12-22 02:32:26 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-12-22 02:32:26 +0000 |
commit | 32978afa5481f66c9ff4fb7ededbdecf6800c16c (patch) | |
tree | 3bf7fdc0ad64e66a100f0a987c9777a671a41136 /src/common/test.h | |
parent | 64195e380d08b7e293071392ffb16d5691129eda (diff) | |
download | tor-32978afa5481f66c9ff4fb7ededbdecf6800c16c.tar.gz tor-32978afa5481f66c9ff4fb7ededbdecf6800c16c.zip |
Workaround for brain-damaged __FILE__ handling on MSVC: keep Nick's name out
of the warning messages.
svn:r3199
Diffstat (limited to 'src/common/test.h')
-rw-r--r-- | src/common/test.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/common/test.h b/src/common/test.h index 083d00eae9..12731a53bc 100644 --- a/src/common/test.h +++ b/src/common/test.h @@ -13,6 +13,7 @@ #include <string.h> #include <stdio.h> +#include "compat.h" #define STMT_BEGIN do { #define STMT_END } while (0) @@ -29,7 +30,7 @@ extern int have_failed; STMT_BEGIN \ have_failed = 1; \ printf("\nFile %s: line %d (%s): assertion failed.", \ - __FILE__, \ + _SHORT_FILE_, \ __LINE__, \ PRETTY_FUNCTION); \ return; \ @@ -40,7 +41,7 @@ extern int have_failed; if (expr) { printf("."); fflush(stdout); } else { \ have_failed = 1; \ printf("\nFile %s: line %d (%s): assertion failed: (%s)\n", \ - __FILE__, \ + _SHORT_FILE_, \ __LINE__, \ PRETTY_FUNCTION, \ #expr); \ @@ -54,7 +55,7 @@ extern int have_failed; have_failed = 1; \ printf("\nFile %s: line %d (%s): Assertion failed: (%s==%s)\n"\ " (%ld != %ld)\n", \ - __FILE__, \ + _SHORT_FILE_, \ __LINE__, \ PRETTY_FUNCTION, \ #expr1, #expr2, \ @@ -69,7 +70,7 @@ extern int have_failed; have_failed = 1; \ printf("\nFile %s: line %d (%s): Assertion failed: (%s!=%s)\n"\ " (%ld == %ld)\n", \ - __FILE__, \ + _SHORT_FILE_, \ __LINE__, \ PRETTY_FUNCTION, \ #expr1, #expr2, \ @@ -84,7 +85,7 @@ extern int have_failed; have_failed = 1; \ printf("\nFile %s: line %d (%s): Assertion failed: (%s==%s)\n"\ " (\"%s\" != \"%s\")\n", \ - __FILE__, \ + _SHORT_FILE_, \ __LINE__, \ PRETTY_FUNCTION, \ #expr1, #expr2, \ @@ -99,7 +100,7 @@ extern int have_failed; have_failed = 1; \ printf("\nFile %s: line %d (%s): Assertion failed: (%s!=%s)\n"\ " (\"%s\" == \"%s\")\n", \ - __FILE__, \ + _SHORT_FILE_, \ __LINE__, \ PRETTY_FUNCTION, \ #expr1, #expr2, \ @@ -113,7 +114,7 @@ extern int have_failed; if (!memcmp(v1,v2,(len))) { printf("."); fflush(stdout); } else {\ have_failed = 1; \ printf("\nFile %s: line %d (%s): Assertion failed: (%s==%s)\n", \ - __FILE__, \ + _SHORT_FILE_, \ __LINE__, \ PRETTY_FUNCTION, \ #expr1, #expr2); \ @@ -126,7 +127,7 @@ extern int have_failed; if (memcmp(v1,v2,(len))) { printf("."); fflush(stdout); } else {\ have_failed = 1; \ printf("\nFile %s: line %d (%s): Assertion failed: (%s!=%s)\n", \ - __FILE__, \ + _SHORT_FILE_, \ __LINE__, \ PRETTY_FUNCTION, \ #expr1, #expr2); \ |