summaryrefslogtreecommitdiff
path: root/cpp/src/tests/unit_test.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-04-23 18:43:05 +0000
committerAlan Conway <aconway@apache.org>2008-04-23 18:43:05 +0000
commitb83a962dce2d5525e84346797f6387c14dea55e0 (patch)
tree23ef0e37630211f5c07ca6fe4b40bcdb7b074fdb /cpp/src/tests/unit_test.h
parent3d77fe97fac8498640f2f9b7706e4e465ea6886c (diff)
downloadqpid-python-b83a962dce2d5525e84346797f6387c14dea55e0.tar.gz
src/tests/ClientSessionTest.cpp: uncommented tests for session resume as EXPECTED_FAILURES tests.
src/tests/unit_test.h: workarounds for broken EXPECTED_FAILURES tests in boost <= 1.34 git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@650997 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/unit_test.h')
-rw-r--r--cpp/src/tests/unit_test.h54
1 files changed, 45 insertions, 9 deletions
diff --git a/cpp/src/tests/unit_test.h b/cpp/src/tests/unit_test.h
index 098545cbd8..e757961616 100644
--- a/cpp/src/tests/unit_test.h
+++ b/cpp/src/tests/unit_test.h
@@ -28,9 +28,17 @@
#include <boost/version.hpp>
#include <limits.h> // Must be inclued beofre boost/test headers.
-#if (BOOST_VERSION < 103300)
-
+// #include the correct header file.
+//
+#if (BOOST_VERSION < 103400)
# include <boost/test/auto_unit_test.hpp>
+#else
+# include <boost/test/unit_test.hpp>
+#endif // BOOST_VERSION
+
+// Workarounds for BOOST_AUTO_TEST_CASE|SUITE|SUITE_END
+//
+#if (BOOST_VERSION < 103300)
# define QPID_AUTO_TEST_SUITE(name)
# define QPID_AUTO_TEST_CASE(name) BOOST_AUTO_UNIT_TEST(name)
@@ -38,19 +46,47 @@
#elif (BOOST_VERSION < 103400)
-# include <boost/test/auto_unit_test.hpp>
-
# define QPID_AUTO_TEST_SUITE(name) BOOST_AUTO_TEST_SUITE(name);
-# define QPID_AUTO_TEST_CASE(name) BOOST_AUTO_TEST_CASE(name)
# define QPID_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END();
-#else
+#elif (BOOST_VERSION < 103400)
# define QPID_AUTO_TEST_SUITE(name) BOOST_AUTO_TEST_SUITE(name)
-# define QPID_AUTO_TEST_CASE(name) BOOST_AUTO_TEST_CASE(name)
# define QPID_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
-# include <boost/test/unit_test.hpp>
+#endif // Workarounds for BOOST_AUTO_TEST_CASE|SUITE|SUITE_END
+
+
+// Workaround for BOOST_AUTO_TEST_SUITE_EXPECTED_FAILURES
+//
+#if (BOOST_VERSION < 103500)
+
+// Keep the test function for compilation but do not not register it.
+// TODO aconway 2008-04-23: better workaround for expected failures.
+# define QPID_AUTO_TEST_CASE_EXPECTED_FAILURES(test_name,n) \
+ namespace { struct test_name { void test_method(); }; } \
+ void test_name::test_method()
+
+#endif // Workaround for BOOST_AUTO_TEST_SUITE_EXPECTED_FAILURES
+
+//
+// Default definitions for latest version of boost.
+//
+
+#ifndef QPID_AUTO_TEST_SUITE
+# define QPID_AUTO_TEST_SUITE(name) BOOST_AUTO_TEST_SUITE(name)
+#endif
+
+#ifndef QPID_AUTO_TEST_CASE
+# define QPID_AUTO_TEST_CASE(name) BOOST_AUTO_TEST_CASE(name)
+#endif
+
+#ifndef QPID_AUTO_TEST_CASE_EXPECTED_FAILURES
+# define QPID_AUTO_TEST_CASE_EXPECTED_FAILURES(name,n) BOOST_AUTO_TEST_SUITE_EXPECTED_FAILURES(name,n)
+#endif
+
+#ifndef QPID_AUTO_TEST_SUITE_END
+# define QPID_AUTO_TEST_SUITE_END() BOOST_AUTO_TEST_SUITE_END()
#endif
-#endif /*!QPIPD_TEST_UNIT_TEST_H_*/
+#endif // !QPIPD_TEST_UNIT_TEST_H_