activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r592015 - in /activemq/activemq-cpp/decaf/trunk/src: main/decaf/io/ test/ test/decaf/io/
Date Mon, 05 Nov 2007 14:32:47 GMT
Author: tabish
Date: Mon Nov  5 06:32:46 2007
New Revision: 592015

URL: http://svn.apache.org/viewvc?rev=592015&view=rev
Log:
http://issues.apache.org/activemq/browse/AMQCPP-136
http://issues.apache.org/activemq/browse/AMQCPP-103

Modified:
    activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/ByteArrayOutputStream.cpp
    activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayInputStreamTest.cpp
    activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayInputStreamTest.h
    activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayOutputStreamTest.cpp
    activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayOutputStreamTest.h
    activemq/activemq-cpp/decaf/trunk/src/test/testRegistry.cpp

Modified: activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/ByteArrayOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/ByteArrayOutputStream.cpp?rev=592015&r1=592014&r2=592015&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/ByteArrayOutputStream.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/main/decaf/io/ByteArrayOutputStream.cpp Mon Nov
 5 06:32:46 2007
@@ -80,7 +80,7 @@
     }
 
     std::back_insert_iterator< std::vector<unsigned char> > iter( *activeBuffer
);
-    std::copy( buffer, buffer + offset + len, iter );
+    std::copy( buffer + offset, buffer + offset + len, iter );
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayInputStreamTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayInputStreamTest.cpp?rev=592015&r1=592014&r2=592015&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayInputStreamTest.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayInputStreamTest.cpp Mon Nov
 5 06:32:46 2007
@@ -156,6 +156,26 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+void ByteArrayInputStreamTest::testRead3() {
+
+    std::vector<unsigned char> testBuffer;
+    testBuffer.insert( testBuffer.end(), 10, 'a' );
+    ByteArrayInputStream is( testBuffer );
+
+    unsigned char buf[10];
+    memset( buf, 'b', 10 );
+    is.read( buf, 5, 5 );
+
+    CPPUNIT_ASSERT_MESSAGE(
+        "Failed to read correct data",
+        string( (const char*)buf, 10 ) == "bbbbbaaaaa" );
+
+    // Try for an EOF
+    is.skip( 5 );
+    CPPUNIT_ASSERT( is.read( buf, 5, 5 ) == -1 );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 void ByteArrayInputStreamTest::testSkip() {
 
     std::vector<unsigned char> testBuffer;

Modified: activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayInputStreamTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayInputStreamTest.h?rev=592015&r1=592014&r2=592015&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayInputStreamTest.h (original)
+++ activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayInputStreamTest.h Mon Nov
 5 06:32:46 2007
@@ -36,6 +36,7 @@
        CPPUNIT_TEST( testClose );
        CPPUNIT_TEST( testRead );
        CPPUNIT_TEST( testRead2 );
+       CPPUNIT_TEST( testRead3 );
        CPPUNIT_TEST( testSkip );
        CPPUNIT_TEST_SUITE_END();
 
@@ -51,6 +52,7 @@
        void testClose();
        void testRead();
        void testRead2();
+       void testRead3();
        void testSkip();
 
    };

Modified: activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayOutputStreamTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayOutputStreamTest.cpp?rev=592015&r1=592014&r2=592015&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayOutputStreamTest.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayOutputStreamTest.cpp Mon
Nov  5 06:32:46 2007
@@ -101,6 +101,15 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+void ByteArrayOutputStreamTest::testWrite3() {
+    ByteArrayOutputStream baos;
+    baos.write( (unsigned char*)&testString[0], 50, 100 );
+    const unsigned char* bytes = baos.toByteArray();
+    CPPUNIT_ASSERT_MESSAGE("Wrote incorrect bytes",
+            string((const char*)bytes, baos.size() ) == testString.substr(50, 100) );
+}
+
+////////////////////////////////////////////////////////////////////////////////
 void ByteArrayOutputStreamTest::testWriteToDecaf_io_OutputStream() {
     ByteArrayOutputStream baos1;
     ByteArrayOutputStream baos2;

Modified: activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayOutputStreamTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayOutputStreamTest.h?rev=592015&r1=592014&r2=592015&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayOutputStreamTest.h (original)
+++ activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/ByteArrayOutputStreamTest.h Mon Nov
 5 06:32:46 2007
@@ -39,6 +39,7 @@
         CPPUNIT_TEST( testToString );
         CPPUNIT_TEST( testWrite1 );
         CPPUNIT_TEST( testWrite2 );
+        CPPUNIT_TEST( testWrite3 );
         CPPUNIT_TEST( testWriteToDecaf_io_OutputStream );
         CPPUNIT_TEST_SUITE_END();
 
@@ -63,6 +64,7 @@
         void testToString();
         void testWrite1();
         void testWrite2();
+        void testWrite3();
         void testWriteToDecaf_io_OutputStream();
 
     };

Modified: activemq/activemq-cpp/decaf/trunk/src/test/testRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/test/testRegistry.cpp?rev=592015&r1=592014&r2=592015&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/test/testRegistry.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/test/testRegistry.cpp Mon Nov  5 06:32:46 2007
@@ -35,58 +35,58 @@
 #include <decaf/io/DataOutputStreamTest.h>
 CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::DataOutputStreamTest );
 
-#include <decaf/lang/MathTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::MathTest );
-#include <decaf/lang/ByteTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ByteTest );
-#include <decaf/lang/CharacterTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::CharacterTest );
-#include <decaf/lang/BooleanTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::BooleanTest );
-#include <decaf/lang/ShortTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ShortTest );
-#include <decaf/lang/IntegerTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::IntegerTest );
-#include <decaf/lang/LongTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::LongTest );
+//#include <decaf/lang/MathTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::MathTest );
+//#include <decaf/lang/ByteTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ByteTest );
+//#include <decaf/lang/CharacterTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::CharacterTest );
+//#include <decaf/lang/BooleanTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::BooleanTest );
+//#include <decaf/lang/ShortTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ShortTest );
+//#include <decaf/lang/IntegerTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::IntegerTest );
+//#include <decaf/lang/LongTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::LongTest );
 //#include <decaf/lang/FloatTest.h>
 //CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::FloatTest );
-#include <decaf/lang/DoubleTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::DoubleTest );
-#include <decaf/lang/ExceptionTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ExceptionTest );
-#include <decaf/lang/ThreadTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ThreadTest );
-#include <decaf/lang/SystemTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::SystemTest );
-
-#include <decaf/net/SocketFactoryTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::SocketFactoryTest );
-#include <decaf/net/SocketTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::SocketTest );
-#include <decaf/net/URITest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URITest );
-#include <decaf/net/URISyntaxExceptionTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URISyntaxExceptionTest );
-
-#include <decaf/util/concurrent/CountDownLatchTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::CountDownLatchTest );
-#include <decaf/util/concurrent/MutexTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::MutexTest );
-#include <decaf/util/concurrent/ThreadPoolTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::ThreadPoolTest );
-
-#include <decaf/util/DateTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::DateTest );
-#include <decaf/util/UUIDTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::UUIDTest );
-#include <decaf/util/MapTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::MapTest );
-#include <decaf/util/QueueTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::QueueTest );
-#include <decaf/util/RandomTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::RandomTest );
-#include <decaf/util/SetTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::SetTest );
-#include <decaf/util/StringTokenizerTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::StringTokenizerTest );
+//#include <decaf/lang/DoubleTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::DoubleTest );
+//#include <decaf/lang/ExceptionTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ExceptionTest );
+//#include <decaf/lang/ThreadTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ThreadTest );
+//#include <decaf/lang/SystemTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::SystemTest );
+//
+//#include <decaf/net/SocketFactoryTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::SocketFactoryTest );
+//#include <decaf/net/SocketTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::SocketTest );
+//#include <decaf/net/URITest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URITest );
+//#include <decaf/net/URISyntaxExceptionTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::net::URISyntaxExceptionTest );
+//
+//#include <decaf/util/concurrent/CountDownLatchTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::CountDownLatchTest );
+//#include <decaf/util/concurrent/MutexTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::MutexTest );
+//#include <decaf/util/concurrent/ThreadPoolTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::concurrent::ThreadPoolTest );
+//
+//#include <decaf/util/DateTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::DateTest );
+//#include <decaf/util/UUIDTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::UUIDTest );
+//#include <decaf/util/MapTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::MapTest );
+//#include <decaf/util/QueueTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::QueueTest );
+//#include <decaf/util/RandomTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::RandomTest );
+//#include <decaf/util/SetTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::SetTest );
+//#include <decaf/util/StringTokenizerTest.h>
+//CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::StringTokenizerTest );



Mime
View raw message