summaryrefslogtreecommitdiff
path: root/ACE/TAO/tests/Sequence_Unit_Tests/test_macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/TAO/tests/Sequence_Unit_Tests/test_macros.h')
-rw-r--r--ACE/TAO/tests/Sequence_Unit_Tests/test_macros.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/ACE/TAO/tests/Sequence_Unit_Tests/test_macros.h b/ACE/TAO/tests/Sequence_Unit_Tests/test_macros.h
new file mode 100644
index 00000000000..2db80f1410f
--- /dev/null
+++ b/ACE/TAO/tests/Sequence_Unit_Tests/test_macros.h
@@ -0,0 +1,43 @@
+// $Id$
+
+#include "ace/Log_Msg.h"
+
+#define FAIL_RETURN_IF(CONDITION) \
+ if (CONDITION) \
+ { \
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tFailed at %N:%l\n"))); \
+ return 1; \
+ }
+
+#define FAIL_RETURN_IF_NOT(CONDITION, X) \
+ if (!(CONDITION)) \
+ { \
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tFailed at %N:%l\n"))); \
+ return 1; \
+ }
+#define CHECK_EQUAL(X, Y) \
+ if ((X) != (Y)) \
+ { \
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tFailed at %N:%l\n"))); \
+ return 1; \
+ }
+#define CHECK(X) \
+ if (!(X)) \
+ { \
+ ACE_ERROR ((LM_ERROR, ACE_TEXT ("\tFailed at %N:%l\n"))); \
+ return 1; \
+ }
+
+#define CHECK_THROW(X, Y) \
+ try { \
+ X; \
+ } \
+ catch (Y const &) \
+ { \
+ } \
+ catch (...) \
+ { \
+ return 1; \
+ } \
+
+