activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r591138 - in /activemq/activemq-cpp/decaf/trunk/src/test/decaf/io: BufferedInputStreamTest.cpp BufferedInputStreamTest.h
Date Thu, 01 Nov 2007 20:11:00 GMT
Author: tabish
Date: Thu Nov  1 13:10:59 2007
New Revision: 591138

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

Modified:
    activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/BufferedInputStreamTest.cpp
    activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/BufferedInputStreamTest.h

Modified: activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/BufferedInputStreamTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/BufferedInputStreamTest.cpp?rev=591138&r1=591137&r2=591138&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/BufferedInputStreamTest.cpp (original)
+++ activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/BufferedInputStreamTest.cpp Thu Nov
 1 13:10:59 2007
@@ -167,6 +167,31 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+void BufferedInputStreamTest::testRead2() {
+
+    std::string testStr;
+    testStr.append( "A", 3000 );
+    testStr.append( "B", 1000 );
+    MyInputStream myStream( testStr );
+    // Create buffer with exact size of data
+    BufferedInputStream is( &myStream, testStr.length() );
+
+    // Test for method int BufferedInputStream.read(byte [], int,
+    // int)
+    unsigned char buf1[100];
+    try {
+        is.skip( 3000 );
+        is.read( buf1, 100 );
+        CPPUNIT_ASSERT_MESSAGE(
+            "Failed to read correct data",
+            string( (const char*)&buf1[0], 100 ) == testStr.substr( 3000, 100 ) );
+
+    } catch (IOException& e) {
+        CPPUNIT_FAIL("Exception during read test");
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
 void BufferedInputStreamTest::testReadException() {
 
     BufferedInputStream bis( NULL );

Modified: activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/BufferedInputStreamTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/BufferedInputStreamTest.h?rev=591138&r1=591137&r2=591138&view=diff
==============================================================================
--- activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/BufferedInputStreamTest.h (original)
+++ activemq/activemq-cpp/decaf/trunk/src/test/decaf/io/BufferedInputStreamTest.h Thu Nov
 1 13:10:59 2007
@@ -36,6 +36,7 @@
         CPPUNIT_TEST( testAvailable );
         CPPUNIT_TEST( testClose );
         CPPUNIT_TEST( testRead );
+        CPPUNIT_TEST( testRead2 );
         CPPUNIT_TEST( testReadException );
         CPPUNIT_TEST_SUITE_END();
 
@@ -52,6 +53,7 @@
         void testClose();
         void testRead();
         void testReadException();
+        void testRead2();
 
     public:
 



Mime
View raw message