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 2009/02/05 15:29:18 UTC

svn commit: r741107 - /activemq/activemq-cpp/trunk/src/test/decaf/lang/PointerTest.cpp

Author: tabish
Date: Thu Feb  5 14:29:18 2009
New Revision: 741107

URL: http://svn.apache.org/viewvc?rev=741107&view=rev
Log:
Add more tests

Modified:
    activemq/activemq-cpp/trunk/src/test/decaf/lang/PointerTest.cpp

Modified: activemq/activemq-cpp/trunk/src/test/decaf/lang/PointerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/decaf/lang/PointerTest.cpp?rev=741107&r1=741106&r2=741107&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/decaf/lang/PointerTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/decaf/lang/PointerTest.cpp Thu Feb  5 14:29:18 2009
@@ -73,6 +73,15 @@
 };
 
 ////////////////////////////////////////////////////////////////////////////////
+class ExceptionThrowingClass {
+public:
+
+    ExceptionThrowingClass() {
+        throw std::bad_alloc();
+    }
+};
+
+////////////////////////////////////////////////////////////////////////////////
 struct X {
     Pointer<X> next;
 };
@@ -108,6 +117,11 @@
     p->next = Pointer<X>( new X );
     p = p->next;
     CPPUNIT_ASSERT( !p->next );
+
+    try{
+        Pointer<ExceptionThrowingClass> ex( new ExceptionThrowingClass() );
+        CPPUNIT_FAIL( "Should Have Thrown." );
+    } catch(...) {}
 }
 
 ////////////////////////////////////////////////////////////////////////////////