activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r943487 - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/decaf/lang/ArrayPointer.h test/decaf/lang/ArrayPointerTest.cpp test/decaf/lang/ArrayPointerTest.h
Date Wed, 12 May 2010 13:40:10 GMT
Author: tabish
Date: Wed May 12 13:40:09 2010
New Revision: 943487

URL: http://svn.apache.org/viewvc?rev=943487&view=rev
Log:
Updated ArrayPointer with additional tests

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/ArrayPointer.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/ArrayPointer.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/ArrayPointer.h?rev=943487&r1=943486&r2=943487&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/ArrayPointer.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/lang/ArrayPointer.h Wed May 12
13:40:09 2010
@@ -225,7 +225,7 @@ namespace lang {
          *
          * @return an ArrayPointer that contains a copy of the data in this ArrayPointer.
          */
-        ArrayPointer clone() {
+        ArrayPointer clone() const {
 
             if( this->array->length == 0 ){
                 return ArrayPointer();

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.cpp?rev=943487&r1=943486&r2=943487&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.cpp Wed
May 12 13:40:09 2010
@@ -176,6 +176,27 @@ void ArrayPointerTest::testBasics() {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+void ArrayPointerTest::testClone() {
+
+    const int SIZE = 50;
+
+    ArrayPointer<int> original( SIZE );
+
+    for( int ix = 0; ix < SIZE; ix++ ) {
+        original[ix] = ix + 10;
+    }
+
+    ArrayPointer<int> copy = original.clone();
+
+    CPPUNIT_ASSERT_EQUAL( SIZE, copy.length() );
+    CPPUNIT_ASSERT( original.get() != copy.get() );
+
+    for( int ix = 0; ix < SIZE; ix++ ) {
+        CPPUNIT_ASSERT_EQUAL( original[ix], copy[ix] );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
 void ArrayPointerTest::testAssignment() {
 
     const int SIZE = 50;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.h?rev=943487&r1=943486&r2=943487&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/lang/ArrayPointerTest.h Wed May
12 13:40:09 2010
@@ -28,6 +28,7 @@ namespace lang {
 
         CPPUNIT_TEST_SUITE( ArrayPointerTest );
         CPPUNIT_TEST( testBasics );
+        CPPUNIT_TEST( testClone );
         CPPUNIT_TEST( testAssignment );
         CPPUNIT_TEST( testComparisons );
         CPPUNIT_TEST( testThreaded1 );
@@ -44,6 +45,7 @@ namespace lang {
         virtual ~ArrayPointerTest() {}
 
         void testBasics();
+        void testClone();
         void testAssignment();
         void testComparisons();
         void testThreaded1();



Mime
View raw message