diff options
Diffstat (limited to 'testing/misc_tools.h')
-rw-r--r-- | testing/misc_tools.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/testing/misc_tools.h b/testing/misc_tools.h index 006ddbd9..9a3d5b40 100644 --- a/testing/misc_tools.h +++ b/testing/misc_tools.h | |||
@@ -39,26 +39,26 @@ unsigned char *hex_string_to_bin(char hex_string[]); | |||
39 | #include <string.h> | 39 | #include <string.h> |
40 | 40 | ||
41 | #define DEBUG_PRINT(str, ...) do { \ | 41 | #define DEBUG_PRINT(str, ...) do { \ |
42 | char msg[1000]; \ | 42 | char msg[1000]; \ |
43 | sprintf(msg, "%s(): line %d (file %s): %s%%c\n", __FUNCTION__, __LINE__, __FILE__, str); \ | 43 | sprintf(msg, "%s(): line %d (file %s): %s%%c\n", __FUNCTION__, __LINE__, __FILE__, str); \ |
44 | fprintf(stderr, msg, __VA_ARGS__); \ | 44 | fprintf(stderr, msg, __VA_ARGS__); \ |
45 | } while (0) | 45 | } while (0) |
46 | 46 | ||
47 | #define WARNING(...) do { \ | 47 | #define WARNING(...) do { \ |
48 | fprintf(stderr, "warning in "); \ | 48 | fprintf(stderr, "warning in "); \ |
49 | DEBUG_PRINT(__VA_ARGS__, ' '); \ | 49 | DEBUG_PRINT(__VA_ARGS__, ' '); \ |
50 | } while (0) | 50 | } while (0) |
51 | 51 | ||
52 | #define INFO(...) do { \ | 52 | #define INFO(...) do { \ |
53 | DEBUG_PRINT(__VA_ARGS__, ' '); \ | 53 | DEBUG_PRINT(__VA_ARGS__, ' '); \ |
54 | } while (0) | 54 | } while (0) |
55 | 55 | ||
56 | #undef ERROR | 56 | #undef ERROR |
57 | #define ERROR(exit_status, ...) do { \ | 57 | #define ERROR(exit_status, ...) do { \ |
58 | fprintf(stderr, "error in "); \ | 58 | fprintf(stderr, "error in "); \ |
59 | DEBUG_PRINT(__VA_ARGS__, ' '); \ | 59 | DEBUG_PRINT(__VA_ARGS__, ' '); \ |
60 | exit(exit_status); \ | 60 | exit(exit_status); \ |
61 | } while (0) | 61 | } while (0) |
62 | #else | 62 | #else |
63 | #define WARNING(...) | 63 | #define WARNING(...) |
64 | #define INFO(...) | 64 | #define INFO(...) |