From commits-return-7808-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Mon Dec 10 12:30:52 2007 Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 4331 invoked from network); 10 Dec 2007 12:30:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Dec 2007 12:30:52 -0000 Received: (qmail 16671 invoked by uid 500); 10 Dec 2007 12:30:41 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 16643 invoked by uid 500); 10 Dec 2007 12:30:41 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 16633 invoked by uid 99); 10 Dec 2007 12:30:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Dec 2007 04:30:40 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Dec 2007 12:30:28 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 50ACA1A9832; Mon, 10 Dec 2007 04:30:31 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r602884 - in /activemq/activemq-cpp/decaf/trunk/src: main/decaf/internal/util/ByteArrayAdapter.cpp test/decaf/internal/nio/DoubleArrayBufferTest.cpp test/decaf/internal/nio/DoubleArrayBufferTest.h Date: Mon, 10 Dec 2007 12:30:28 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20071210123031.50ACA1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Mon Dec 10 04:30:27 2007 New Revision: 602884 URL: http://svn.apache.org/viewvc?rev=602884&view=rev Log: http://issues.apache.org/activemq/browse/AMQCPP-153 Working on implementing the NIO package Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/util/ByteArrayAdapter.cpp activemq/activemq-cpp/decaf/trunk/src/test/decaf/internal/nio/DoubleArrayBufferTest.cpp activemq/activemq-cpp/decaf/trunk/src/test/decaf/internal/nio/DoubleArrayBufferTest.h Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/util/ByteArrayAdapter.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/util/ByteArrayAdapter.cpp?rev=602884&r1=602883&r2=602884&view=diff ============================================================================== --- activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/util/ByteArrayAdapter.cpp (original) +++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/internal/util/ByteArrayAdapter.cpp Mon Dec 10 04:30:27 2007 @@ -70,7 +70,8 @@ throw( lang::exceptions::NullPointerException ) { try{ - this->initialize( reinterpret_cast( array ), capacity, own ); + this->initialize( reinterpret_cast( array ), + capacity * sizeof( double ), own ); } DECAF_CATCH_RETHROW( NullPointerException ) DECAF_CATCHALL_THROW( NullPointerException ) @@ -81,7 +82,8 @@ throw( lang::exceptions::NullPointerException ) { try{ - this->initialize( reinterpret_cast( array ), capacity, own ); + this->initialize( reinterpret_cast( array ), + capacity * sizeof( float ), own ); } DECAF_CATCH_RETHROW( NullPointerException ) DECAF_CATCHALL_THROW( NullPointerException ) @@ -92,7 +94,8 @@ throw( lang::exceptions::NullPointerException ) { try{ - this->initialize( reinterpret_cast( array ), capacity, own ); + this->initialize( reinterpret_cast( array ), + capacity * sizeof( long long ), own ); } DECAF_CATCH_RETHROW( NullPointerException ) DECAF_CATCHALL_THROW( NullPointerException ) @@ -103,7 +106,8 @@ throw( lang::exceptions::NullPointerException ) { try{ - this->initialize( reinterpret_cast( array ), capacity, own ); + this->initialize( reinterpret_cast( array ), + capacity * sizeof( int ), own ); } DECAF_CATCH_RETHROW( NullPointerException ) DECAF_CATCHALL_THROW( NullPointerException ) @@ -114,7 +118,8 @@ throw( lang::exceptions::NullPointerException ) { try{ - this->initialize( reinterpret_cast( array ), capacity, own ); + this->initialize( reinterpret_cast( array ), + capacity * sizeof( short ), own ); } DECAF_CATCH_RETHROW( NullPointerException ) DECAF_CATCHALL_THROW( NullPointerException ) Modified: activemq/activemq-cpp/decaf/trunk/src/test/decaf/internal/nio/DoubleArrayBufferTest.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/test/decaf/internal/nio/DoubleArrayBufferTest.cpp?rev=602884&r1=602883&r2=602884&view=diff ============================================================================== --- activemq/activemq-cpp/decaf/trunk/src/test/decaf/internal/nio/DoubleArrayBufferTest.cpp (original) +++ activemq/activemq-cpp/decaf/trunk/src/test/decaf/internal/nio/DoubleArrayBufferTest.cpp Mon Dec 10 04:30:27 2007 @@ -227,15 +227,15 @@ DoubleBuffer* dbuffer2 = DoubleBuffer::wrap( array2 ); DoubleBuffer* dbuffer3 = DoubleBuffer::wrap( array3 ); -// CPPUNIT_ASSERT_MESSAGE( -// "Failed equal comparison with NaN entry", -// dbuffer1->compareTo( *dbuffer2 ) ); -// CPPUNIT_ASSERT_MESSAGE( -// "Failed greater than comparison with NaN entry", -// dbuffer3->compareTo( *dbuffer1 ) ); -// CPPUNIT_ASSERT_MESSAGE( -// "Failed greater than comparison with NaN entry", -// dbuffer1->compareTo( *dbuffer3 ) ); + CPPUNIT_ASSERT_MESSAGE( + "Failed equal comparison with NaN entry", + dbuffer1->compareTo( *dbuffer2 ) ); + CPPUNIT_ASSERT_MESSAGE( + "Failed greater than comparison with NaN entry", + dbuffer3->compareTo( *dbuffer1 ) ); + CPPUNIT_ASSERT_MESSAGE( + "Failed greater than comparison with NaN entry", + dbuffer1->compareTo( *dbuffer3 ) ); delete other; delete dbuffer1; @@ -251,7 +251,7 @@ // duplicate's contents should be the same as testBuffer1 DoubleBuffer* duplicate = testBuffer1->duplicate(); - CPPUNIT_ASSERT( testBuffer1 == duplicate ); + CPPUNIT_ASSERT( testBuffer1 != duplicate ); CPPUNIT_ASSERT( testBuffer1->position() == duplicate->position() ); CPPUNIT_ASSERT( testBuffer1->limit() == duplicate->limit() ); CPPUNIT_ASSERT( testBuffer1->isReadOnly() == duplicate->isReadOnly() ); @@ -292,9 +292,6 @@ delete duplicate; } -/* - * Class under test for double get() - */ //////////////////////////////////////////////////////////////////////////////// void DoubleArrayBufferTest::testGet() { @@ -337,7 +334,7 @@ CPPUNIT_ASSERT_THROW_MESSAGE( "Should throw BufferUnderflowException", - testBuffer1->get( array, 0, testBuffer1->capacity() ), + testBuffer1->get( array, 0, testBuffer1->capacity() + 1 ), BufferUnderflowException ); CPPUNIT_ASSERT( testBuffer1->position() == 0 ); @@ -345,26 +342,9 @@ testBuffer1->get( array, 10, 0 ); CPPUNIT_ASSERT_THROW_MESSAGE( - "Should throw IndexOutOfBoundsException", - testBuffer1->get( array, testBuffer1->capacity() + 1, 1 ), - IndexOutOfBoundsException ); - - CPPUNIT_ASSERT( testBuffer1->position() == 0 ); - - CPPUNIT_ASSERT_THROW_MESSAGE( - "Should throw IndexOutOfBoundsException", - testBuffer1->get(array, 2, testBuffer1->capacity() ), - IndexOutOfBoundsException ); - - CPPUNIT_ASSERT_THROW_MESSAGE( - "Should throw IndexOutOfBoundsException", + "Should throw BufferUnderflowException", testBuffer1->get( array, 1, Integer::MAX_VALUE ), - IndexOutOfBoundsException ); - - CPPUNIT_ASSERT_THROW_MESSAGE( - "Should throw IndexOutOfBoundsException", - testBuffer1->get( array, Integer::MAX_VALUE, 1 ), - IndexOutOfBoundsException ); + BufferUnderflowException ); CPPUNIT_ASSERT( testBuffer1->position() == 0 ); @@ -387,9 +367,9 @@ } CPPUNIT_ASSERT_THROW_MESSAGE( - "Should throw BufferOverflowException", + "Should throw IndexOutOfBoundsException", testBuffer1->get( testBuffer1->limit() ), - BufferOverflowException ); + IndexOutOfBoundsException ); } //////////////////////////////////////////////////////////////////////////////// @@ -451,28 +431,8 @@ CPPUNIT_ASSERT( testBuffer1->position() == 0 ); - CPPUNIT_ASSERT_THROW_MESSAGE( - "Should throw BufferOverflowException", - testBuffer1->put( array1, testBuffer1->capacity() + 1, 0 ), - BufferOverflowException ); - testBuffer1->put( array1, testBuffer1->capacity() + 1, 0 ); CPPUNIT_ASSERT( testBuffer1->position() == 0 ); - - CPPUNIT_ASSERT_THROW_MESSAGE( - "Should throw IndexOutOfBoundsException", - testBuffer1->put( array1, 2, testBuffer1->capacity() + 1 ), - IndexOutOfBoundsException ); - - CPPUNIT_ASSERT_THROW_MESSAGE( - "Should throw IndexOutOfBoundsException", - testBuffer1->put( array1, Integer::MAX_VALUE, 1 ), - IndexOutOfBoundsException ); - - CPPUNIT_ASSERT_THROW_MESSAGE( - "Should throw IndexOutOfBoundsException", - testBuffer1->put( array1, 1, Integer::MAX_VALUE ), - IndexOutOfBoundsException ); CPPUNIT_ASSERT( testBuffer1->position() == 0 ); Modified: activemq/activemq-cpp/decaf/trunk/src/test/decaf/internal/nio/DoubleArrayBufferTest.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/test/decaf/internal/nio/DoubleArrayBufferTest.h?rev=602884&r1=602883&r2=602884&view=diff ============================================================================== --- activemq/activemq-cpp/decaf/trunk/src/test/decaf/internal/nio/DoubleArrayBufferTest.h (original) +++ activemq/activemq-cpp/decaf/trunk/src/test/decaf/internal/nio/DoubleArrayBufferTest.h Mon Dec 10 04:30:27 2007 @@ -37,21 +37,21 @@ CPPUNIT_TEST( testAsReadOnlyBuffer ); CPPUNIT_TEST( testCompact ); CPPUNIT_TEST( testCompareTo ); -// CPPUNIT_TEST( testDuplicate ); -// CPPUNIT_TEST( testEquals ); -// CPPUNIT_TEST( testHasArray ); -// CPPUNIT_TEST( testGet ); -// CPPUNIT_TEST( testGet2 ); -// CPPUNIT_TEST( testGetDoubleArray ); -// CPPUNIT_TEST( testGetDoubleArray2 ); -// CPPUNIT_TEST( testGetWithIndex ); -// CPPUNIT_TEST( testPutDouble ); -// CPPUNIT_TEST( testPutDoubleArray ); -// CPPUNIT_TEST( testPutDoubleArray2 ); -// CPPUNIT_TEST( testPutDoubleBuffer ); -// CPPUNIT_TEST( testPutIndexed ); -// CPPUNIT_TEST( testSlice ); -// CPPUNIT_TEST( testToString ); + CPPUNIT_TEST( testDuplicate ); + CPPUNIT_TEST( testEquals ); + CPPUNIT_TEST( testHasArray ); + CPPUNIT_TEST( testGet ); + CPPUNIT_TEST( testGet2 ); + CPPUNIT_TEST( testGetDoubleArray ); + CPPUNIT_TEST( testGetDoubleArray2 ); + CPPUNIT_TEST( testGetWithIndex ); + CPPUNIT_TEST( testPutDouble ); + CPPUNIT_TEST( testPutDoubleArray ); + CPPUNIT_TEST( testPutDoubleArray2 ); + CPPUNIT_TEST( testPutDoubleBuffer ); + CPPUNIT_TEST( testPutIndexed ); + CPPUNIT_TEST( testSlice ); + CPPUNIT_TEST( testToString ); CPPUNIT_TEST_SUITE_END(); decaf::nio::DoubleBuffer* testBuffer1;