You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2011/05/13 00:33:34 UTC

svn commit: r1102491 - in /activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent: ExecutorsTestSupport.cpp ExecutorsTestSupport.h

Author: tabish
Date: Thu May 12 22:33:33 2011
New Revision: 1102491

URL: http://svn.apache.org/viewvc?rev=1102491&view=rev
Log:
Add some more test support methods.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ExecutorsTestSupport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ExecutorsTestSupport.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ExecutorsTestSupport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ExecutorsTestSupport.cpp?rev=1102491&r1=1102490&r2=1102491&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ExecutorsTestSupport.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ExecutorsTestSupport.cpp Thu May 12 22:33:33 2011
@@ -60,6 +60,12 @@ void ExecutorsTestSupport::threadFail(co
 }
 
 ///////////////////////////////////////////////////////////////////////////////
+void ExecutorsTestSupport::threadShouldThrow() {
+   threadFailed = true;
+   CPPUNIT_FAIL("should throw exception");
+}
+
+///////////////////////////////////////////////////////////////////////////////
 void ExecutorsTestSupport::threadUnexpectedException() {
     threadFailed = true;
     CPPUNIT_FAIL("Unexpected exception");
@@ -72,6 +78,30 @@ void ExecutorsTestSupport::threadUnexpec
 }
 
 ///////////////////////////////////////////////////////////////////////////////
+void ExecutorsTestSupport::threadAssertFalse(bool b) {
+    if (b) {
+        threadFailed = true;
+        CPPUNIT_ASSERT(!b);
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void ExecutorsTestSupport::threadAssertTrue(bool b) {
+    if (!b) {
+        threadFailed = true;
+        CPPUNIT_ASSERT(b);
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void ExecutorsTestSupport::threadAssertEquals(long long x, long long y) {
+    if (x != y) {
+        threadFailed = true;
+        CPPUNIT_ASSERT_EQUAL(x, y);
+    }
+}
+
+///////////////////////////////////////////////////////////////////////////////
 void ExecutorsTestSupport::shouldThrow() {
     CPPUNIT_FAIL("Should throw exception");
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ExecutorsTestSupport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ExecutorsTestSupport.h?rev=1102491&r1=1102490&r2=1102491&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ExecutorsTestSupport.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/concurrent/ExecutorsTestSupport.h Thu May 12 22:33:33 2011
@@ -56,11 +56,15 @@ namespace concurrent {
         virtual void setUp();
         virtual void tearDown();
 
-    protected:
+    public:
 
         void threadFail(const std::string& reason);
+        void threadShouldThrow();
         void threadUnexpectedException();
         void threadUnexpectedException(decaf::lang::Throwable& ex);
+        void threadAssertFalse(bool value);
+        void threadAssertTrue(bool value);
+        void threadAssertEquals(long long x, long long y);
 
         void unexpectedException();
         void shouldThrow();