Author: aconway
Date: Wed Apr 23 11:43:05 2008
New Revision: 650997

URL: http://svn.apache.org/viewvc?rev=650997&view=rev
Log:
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

Modified:
    incubator/qpid/trunk/qpid/cpp/src/tests/ClientSessionTest.cpp
    incubator/qpid/trunk/qpid/cpp/src/tests/unit_test.h

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/ClientSessionTest.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/ClientSessionTest.cpp?rev=650997&r1=650996&r2=650997&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/ClientSessionTest.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/ClientSessionTest.cpp Wed Apr 23 
11:43:05 2008
@@ -144,7 +144,8 @@
         BOOST_CHECK_EQUAL(lexical_cast<string>(i), 
listener.messages[i].getData());
 }
 
-/* FIXME aconway 2008-01-28: hangs
+// FIXME aconway 2008-04-23: hangs
+#if 0
 BOOST_FIXTURE_TEST_CASE(testDispatcherThread, ClientSessionFixture)
 {
     session =connection.newSession(ASYNC);
@@ -161,11 +162,10 @@
     for (size_t i = 0; i < count; ++i) 
         BOOST_CHECK_EQUAL(lexical_cast<string>(i), 
listener.messages[i].getData());
 }
-*/
+#endif
 
-/*
- * GS (18-APR-2008): disabled resume tests until resumption for 0-10 final 
spec is implemented
-QPID_AUTO_TEST_CASE(_FIXTURE)
+
+QPID_AUTO_TEST_CASE_EXPECTED_FAILURES(testSuspend0Timeout, 1)
 {
     ClientSessionFixture fix;
     fix.session =fix.connection.newSession(ASYNC, 0);
@@ -176,7 +176,7 @@
     } catch(const InternalErrorException&) {}
 }
 
-QPID_AUTO_TEST_CASE(testUseSuspendedError)
+QPID_AUTO_TEST_CASE_EXPECTED_FAILURES(testUseSuspendedError, 1)
 {
     ClientSessionFixture fix;
     fix.session =fix.connection.newSession(ASYNC, 60);
@@ -187,7 +187,7 @@
     } catch(const CommandInvalidException&) {}
 }
 
-QPID_AUTO_TEST_CASE(testSuspendResume)
+QPID_AUTO_TEST_CASE_EXPECTED_FAILURES(testSuspendResume, 1)
 {
     ClientSessionFixture fix;
     fix.session =fix.connection.newSession(ASYNC, 60);
@@ -199,10 +199,9 @@
     FrameSet::shared_ptr msg = fix.session.get();
     BOOST_CHECK_EQUAL(string("my-message"), msg->getContent());
 }
-*/
-/**
- * Currently broken due to a deadlock in SessionCore
- *
+
+// FIXME aconway 2008-04-23: broken due to a deadlock in SessionCore
+#if 0
 BOOST_FIXTURE_TEST_CASE(testSendToSelf, SessionFixture) {
     // Deadlock if SubscriptionManager  run() concurrent with session ack.
     SimpleListener mylistener;
@@ -224,7 +223,7 @@
         BOOST_CHECK_EQUAL(mylistener.messages[j].getData(), data);
     }
 }
-*/
+#endif
 
 QPID_AUTO_TEST_SUITE_END()
 

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/unit_test.h
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/unit_test.h?rev=650997&r1=650996&r2=650997&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/unit_test.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/unit_test.h Wed Apr 23 11:43:05 2008
@@ -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_


Reply via email to