activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r919468 - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/decaf/io/ main/decaf/util/zip/ test/decaf/util/zip/
Date Fri, 05 Mar 2010 16:23:58 GMT
Author: tabish
Date: Fri Mar  5 16:23:58 2010
New Revision: 919468

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

Completed Deflate and Inflate streams along with tests.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/InflaterInputStream.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterOutputStreamTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterOutputStreamTest.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/InflaterInputStreamTest.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/InflaterInputStreamTest.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp?rev=919468&r1=919467&r2=919468&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.cpp Fri
Mar  5 16:23:58 2010
@@ -52,7 +52,7 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-const std::vector<unsigned char> ByteArrayOutputStream::toByteArrayRef() const {
+const std::vector<unsigned char>& ByteArrayOutputStream::toByteArrayRef() const
{
     if( activeBuffer == NULL ){
         return defaultBuffer;
     }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.h?rev=919468&r1=919467&r2=919468&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/io/ByteArrayOutputStream.h Fri
Mar  5 16:23:58 2010
@@ -71,7 +71,7 @@
          * Get a snapshot of the data
          * @return reference to the underlying data as a const std::vector<unsigned char>&
          */
-        virtual const std::vector<unsigned char> toByteArrayRef() const;
+        virtual const std::vector<unsigned char>& toByteArrayRef() const;
 
         /**
          * Get the Size of the Internal Buffer

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/InflaterInputStream.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/InflaterInputStream.cpp?rev=919468&r1=919467&r2=919468&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/InflaterInputStream.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/decaf/util/zip/InflaterInputStream.cpp
Fri Mar  5 16:23:58 2010
@@ -115,13 +115,15 @@
         std::size_t count = 0;
         std::size_t remaining = Math::min( (long long)num, (long long)buff.size() );
 
+        std::vector<unsigned char> buffer( remaining );
+
         while( count < num ) {
-            int x = read( &buff[0], buff.size() , 0, remaining );
+            int x = read( &buffer[0], buffer.size() , 0, remaining );
             if( x == -1 ) {
                 return count;
             }
             count += x;
-            remaining = ( num - count ) < buff.size() ? num - count : buff.size();
+            remaining = ( num - count ) < buffer.size() ? num - count : buffer.size();
         }
 
         return count;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterOutputStreamTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterOutputStreamTest.cpp?rev=919468&r1=919467&r2=919468&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterOutputStreamTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterOutputStreamTest.cpp
Fri Mar  5 16:23:58 2010
@@ -225,13 +225,6 @@
         "Should have thrown a IOException",
         dos.write( 5 ),
         IOException );
-
-    // Test to write to a ByteArrayOutputStream that should have been closed
-    // by the DeflaterOutputStream.
-    CPPUNIT_ASSERT_THROW_MESSAGE(
-        "Should have thrown a IOException",
-        baos.write( 5 ),
-        IOException );
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -251,104 +244,66 @@
         IOException );
 }
 
-//void testWriteI() {
-//    File f1 = new File("writeI1.tst");
-//    FileOutputStream fos = new FileOutputStream(f1);
-//    DeflaterOutputStream dos = new DeflaterOutputStream(fos);
-//    for (int i = 0; i < 3; i++) {
-//        dos.write(i);
-//    }
-//    dos.close();
-//    FileInputStream fis = new FileInputStream(f1);
-//    InflaterInputStream iis = new InflaterInputStream(fis);
-//    for (int i = 0; i < 3; i++) {
-//        CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned.", i, iis.read());
-//    }
-//    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned (EOF).", -1, iis.read());
-//    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned (EOF).", -1, iis.read());
-//    iis.close();
-//
-//    // Not sure if this test is that important.
-//    // Checks to see if you can write using the DeflaterOutputStream
-//    // after
-//    // the FileOutputStream has been closed.
-//    FileOutputStream fos2 = new FileOutputStream(f1);
-//    DeflaterOutputStream dos2 = new DeflaterOutputStream(fos2);
-//    fos2.close();
-//    try {
-//        dos2.write(2);
-//        CPPUNIT_FAIL("IOException not thrown");
-//    } catch (IOException e) {
-//    }
-//
-//}
-//
-//void testWriteBIII() {
-//    unsigned char byteArray[] = { 1, 3, 4, 7, 8, 3, 6 };
-//
-//    // Test to see if the correct bytes are saved.
-//    File f1 = new File("writeBII.tst");
-//    FileOutputStream fos1 = new FileOutputStream(f1);
-//    DeflaterOutputStream dos1 = new DeflaterOutputStream(fos1);
-//    dos1.write(byteArray, 2, 3);
-//    dos1.close();
-//    FileInputStream fis = new FileInputStream(f1);
-//    InflaterInputStream iis = new InflaterInputStream(fis);
-//    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned.", 4, iis.read());
-//    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned.", 7, iis.read());
-//    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned.", 8, iis.read());
-//    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned (EOF).", -1, iis.read());
-//    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned (EOF).", -1, iis.read());
-//    iis.close();
-//    f1.delete();
-//
-//    // Test for trying to write more bytes than available from the array
-//    File f2 = new File("writeBII2.tst");
-//    FileOutputStream fos2 = new FileOutputStream(f2);
-//    DeflaterOutputStream dos2 = new DeflaterOutputStream(fos2);
-//    try {
-//        dos2.write(byteArray, 2, 10);
-//        CPPUNIT_FAIL("IndexOutOfBoundsException not thrown");
-//    } catch (IndexOutOfBoundsException e) {
-//    }
-//
-//    // Test for trying to write a negative number of bytes.
-//    try {
-//        dos2.write(byteArray, 2, Integer.MIN_VALUE);
-//        CPPUNIT_FAIL("IndexOutOfBoundsException not thrown");
-//    } catch (IndexOutOfBoundsException e) {
-//    }
-//
-//    // Test for trying to start writing from a unsigned char < 0 from the array.
-//    try {
-//        dos2.write(byteArray, Integer.MIN_VALUE, 2);
-//        CPPUNIT_FAIL("IndexOutOfBoundsException not thrown");
-//    } catch (IndexOutOfBoundsException e) {
-//    }
-//
-//    // Test for trying to start writing from a unsigned char > than the array
-//    // size.
-//    try {
-//        dos2.write(byteArray, 10, 2);
-//        CPPUNIT_FAIL("IndexOutOfBoundsException not thrown");
-//    } catch (IndexOutOfBoundsException e) {
-//    }
-//    dos2.close();
-//
-//    // Not sure if this test is that important.
-//    // Checks to see if you can write using the DeflaterOutputStream
-//    // after
-//    // the FileOutputStream has been closed.
-//    FileOutputStream fos3 = new FileOutputStream(f2);
-//    DeflaterOutputStream dos3 = new DeflaterOutputStream(fos3);
-//    fos3.close();
-//    try {
-//        dos3.write(byteArray, 2, 3);
-//        CPPUNIT_FAIL("IOException not thrown");
-//    } catch (IOException e) {
-//    }
-//
-//}
+////////////////////////////////////////////////////////////////////////////////
+void DeflaterOutputStreamTest::testWriteI() {
+
+    ByteArrayOutputStream baos;
+    DeflaterOutputStream dos( &baos );
+
+    for( int i = 0; i < 3; i++ ) {
+        dos.write( i );
+    }
+    dos.close();
+
+    ByteArrayInputStream bais( baos.toByteArrayRef() );
+    InflaterInputStream iis( &bais );
+
+    for( int i = 0; i < 3; i++ ) {
+        CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned.", i, iis.read() );
+    }
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned (EOF).", -1, iis.read() );
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned (EOF).", -1, iis.read() );
+    iis.close();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void DeflaterOutputStreamTest::testWriteBIII() {
+
+    unsigned char byteArray[] = { 1, 3, 4, 7, 8, 3, 6 };
+
+    // Test to see if the correct bytes are saved.
+    ByteArrayOutputStream baos;
+    DeflaterOutputStream dos1( &baos );
+    dos1.write( byteArray, 7, 2, 3 );
+    dos1.close();
+
+    ByteArrayInputStream bais( baos.toByteArrayRef() );
+    InflaterInputStream iis( &bais );
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned.", 4, iis.read() );
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned.", 7, iis.read() );
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned.", 8, iis.read() );
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned (EOF).", -1, iis.read() );
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned (EOF).", -1, iis.read() );
+    iis.close();
+
+    // Test for trying to write more bytes than available from the array
+    ByteArrayOutputStream baos2;
+    DeflaterOutputStream dos2( &baos2 );
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should have thrown an IndexOutOfBoundsException",
+        dos2.write( byteArray, 7, 2, 10 ),
+        IndexOutOfBoundsException );
+
+    // Test for trying to start writing from a unsigned char > than the array
+    // size.
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should have thrown an IndexOutOfBoundsException",
+        dos2.write( byteArray, 7, 2, 10 ),
+        IndexOutOfBoundsException );
+
+    dos2.close();
+}
 
 ////////////////////////////////////////////////////////////////////////////////
 void DeflaterOutputStreamTest::testDeflate() {

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterOutputStreamTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterOutputStreamTest.h?rev=919468&r1=919467&r2=919468&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterOutputStreamTest.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/DeflaterOutputStreamTest.h
Fri Mar  5 16:23:58 2010
@@ -36,6 +36,8 @@
         CPPUNIT_TEST( testClose );
         CPPUNIT_TEST( testFinish );
         CPPUNIT_TEST( testDeflate );
+        CPPUNIT_TEST( testWriteI );
+        CPPUNIT_TEST( testWriteBIII );
         CPPUNIT_TEST_SUITE_END();
 
     private:
@@ -56,6 +58,8 @@
         void testClose();
         void testFinish();
         void testDeflate();
+        void testWriteI();
+        void testWriteBIII();
 
     };
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/InflaterInputStreamTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/InflaterInputStreamTest.cpp?rev=919468&r1=919467&r2=919468&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/InflaterInputStreamTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/InflaterInputStreamTest.cpp
Fri Mar  5 16:23:58 2010
@@ -118,7 +118,7 @@
     this->inputBuffer.clear();
     this->inputBuffer.resize( 500 );
     this->deflatedData.clear();
-    this->deflatedData.resize( testString.size() + 100 );
+    this->deflatedData.resize( testString.size() + 256 );
 
     Deflater deflater;
 
@@ -130,7 +130,7 @@
         x += deflater.deflate( deflatedData, x, deflatedData.size() - x );
     }
 
-    this->deflatedData.resize( x );
+    this->deflatedData.resize( x + 1 );
 
     deflater.end();
 }
@@ -323,120 +323,93 @@
         IOException );
 }
 
-//void testSkip() {
-//    InputStream is = Support_Resources.getStream("hyts_available.tst");
-//    InflaterInputStream iis = new InflaterInputStream(is);
-//
-//    // Tests for skipping a negative number of bytes.
-//    try {
-//        iis.skip(-3);
-//        fail("IllegalArgumentException not thrown");
-//    } catch (IllegalArgumentException e) {
-//        // Expected
-//    }
-//    CPPUNIT_ASSERT_EQUAL("Incorrect Byte Returned.", 5, iis.read());
-//
-//    try {
-//        iis.skip(Integer.MIN_VALUE);
-//        fail("IllegalArgumentException not thrown");
-//    } catch (IllegalArgumentException e) {
-//        // Expected
-//    }
-//    CPPUNIT_ASSERT_EQUAL("Incorrect Byte Returned.", 4, iis.read());
-//
-//    // Test to make sure the correct number of bytes were skipped
-//    CPPUNIT_ASSERT_EQUAL("Incorrect Number Of Bytes Skipped.", 3, iis.skip(3));
-//
-//    // Test to see if the number of bytes skipped returned is true.
-//    CPPUNIT_ASSERT_EQUAL("Incorrect Byte Returned.", 7, iis.read());
-//
-//    CPPUNIT_ASSERT_EQUAL("Incorrect Number Of Bytes Skipped.", 0, iis.skip(0));
-//    CPPUNIT_ASSERT_EQUAL("Incorrect Byte Returned.", 0, iis.read());
-//
-//    // Test for skipping more bytes than available in the stream
-//    CPPUNIT_ASSERT_EQUAL("Incorrect Number Of Bytes Skipped.", 2, iis.skip(4));
-//    CPPUNIT_ASSERT_EQUAL("Incorrect Byte Returned.", -1, iis.read());
-//    iis.close();
-//}
-//
-//void testSkip2() {
-//    int result = 0;
-//    int buffer[] = new int[100];
-//    unsigned char orgBuffer[] = { 1, 3, 4, 7, 8 };
-//
-//    // testing for negative input to skip
-//    InputStream infile = Support_Resources
-//            .getStream("hyts_constru(OD).txt");
-//    Inflater inflate = new Inflater();
-//    InflaterInputStream inflatIP = new InflaterInputStream(infile,
-//            inflate, 10);
-//    long skip;
-//    try {
-//        skip = inflatIP.skip(Integer.MIN_VALUE);
-//        fail("Expected IllegalArgumentException when skip() is called with negative parameter");
-//    } catch (IllegalArgumentException e) {
-//        // Expected
-//    }
-//    inflatIP.close();
-//
-//    // testing for number of bytes greater than input.
-//    InputStream infile2 = Support_Resources
-//            .getStream("hyts_constru(OD).txt");
-//    InflaterInputStream inflatIP2 = new InflaterInputStream(infile2);
-//
-//    // looked at how many bytes the skip skipped. It is
-//    // 5 and its supposed to be the entire input stream.
-//
-//    skip = inflatIP2.skip(Integer.MAX_VALUE);
-//    // System.out.println(skip);
-//    CPPUNIT_ASSERT_EQUAL("method skip() returned wrong number of bytes skipped",
-//            5, skip);
-//
-//    // test for skipping of 2 bytes
-//    InputStream infile3 = Support_Resources
-//            .getStream("hyts_constru(OD).txt");
-//    InflaterInputStream inflatIP3 = new InflaterInputStream(infile3);
-//    skip = inflatIP3.skip(2);
-//    CPPUNIT_ASSERT_EQUAL("the number of bytes returned by skip did not correspond with
its input parameters",
-//            2, skip);
-//    int i = 0;
-//    result = 0;
-//    while ((result = inflatIP3.read()) != -1) {
-//        buffer[i] = result;
-//        i++;
-//    }
-//    inflatIP2.close();
-//
-//    for (int j = 2; j < orgBuffer.length; j++) {
-//        assertTrue(
-//            "original compressed data did not equal decompressed data",
-//            buffer[j - 2] == orgBuffer[j]);
-//    }
-//}
-//
-//void testAvailable() {
-//    InputStream is = Support_Resources.getStream("hyts_available.tst");
-//    InflaterInputStream iis = new InflaterInputStream(is);
-//
-//    int available;
-//    for (int i = 0; i < 11; i++) {
-//        iis.read();
-//        available = iis.available();
-//        if (available == 0) {
-//            CPPUNIT_ASSERT_EQUAL_MESSAGE("Expected no more bytes to read", -1, iis.read());
-//        } else {
-//            CPPUNIT_ASSERT_EQUAL_MESSAGE("Bytes Available Should Return 1.", 1, available);
-//        }
-//    }
-//
-//    iis.close();
-//    try {
-//        iis.available();
-//        fail("available after close should throw IOException.");
-//    } catch (IOException e) {
-//        // Expected
-//    }
-//}
+////////////////////////////////////////////////////////////////////////////////
+void InflaterInputStreamTest::testSkip() {
+
+    ByteArrayInputStream bais( this->deflatedData );
+    InflaterInputStream iis( &bais );
+
+    // Tests for skipping a zero value
+    iis.skip( 0 );
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned.", (int)'T', iis.read() );
+
+    // Test to make sure the correct number of bytes were skipped
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Number Of Bytes Skipped.", 3, (int)iis.skip(
3 ) );
+
+    // Test to see if the number of bytes skipped returned is true.
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned.", (int)'_', iis.read() );
+
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Number Of Bytes Skipped.", 0, (int)iis.skip(
0 ) );
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned.", (int)'A', iis.read() );
+
+    // Test for skipping more bytes than available in the stream
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Number Of Bytes Skipped.",
+                                  testString.length() - 6, iis.skip( testString.length()
) );
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "Incorrect Byte Returned.", -1, iis.read() );
+    iis.close();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void InflaterInputStreamTest::testSkip2() {
+
+    std::vector<unsigned char> buffer( testString.length() );
+
+    // testing for number of bytes greater than input.
+    ByteArrayInputStream bais1( this->deflatedData );
+    InflaterInputStream iis1( &bais1 );
+
+    std::size_t skip = iis1.skip( Integer::MAX_VALUE );
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "method skip() returned wrong number of bytes skipped",
+                                  testString.size(), skip );
+
+    // test for skipping of 2 bytes
+    ByteArrayInputStream bais2( this->deflatedData );
+    InflaterInputStream iis2( &bais2 );
+
+    skip = iis2.skip( 2 );
+    CPPUNIT_ASSERT_EQUAL_MESSAGE( "the number of bytes returned by skip did not correspond
with its input parameters",
+                                  (std::size_t)2, skip );
+    int i = 0;
+    int result = 0;
+    while( ( result = iis2.read() ) != -1 ) {
+        buffer[i] = result;
+        i++;
+    }
+
+    iis2.close();
+
+    for( std::size_t j = 2; j < testString.length(); j++ ) {
+        CPPUNIT_ASSERT_MESSAGE( "original compressed data did not equal decompressed data",
+                                buffer[j - 2] == testString.at( j ) );
+    }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void InflaterInputStreamTest::testAvailable() {
+
+    // this unsigned char[] is a deflation of these bytes: { 1, 3, 4, 6 }
+    unsigned char deflated[] = {72, -119, 99, 100, 102, 97, 3, 0, 0, 31, 0, 15, 0};
+
+    ByteArrayInputStream bais( deflated, 13 );
+    InflaterInputStream iis( &bais );
+
+    int available;
+    for( int i = 0; i < 4; i++ ) {
+        iis.read();
+        available = iis.available();
+        if( available == 0 ) {
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "Expected no more bytes to read", -1, iis.read()
);
+        } else {
+            CPPUNIT_ASSERT_EQUAL_MESSAGE( "Bytes Available Should Return 1.", 1, available
);
+        }
+    }
+
+    iis.close();
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should have thrown an IOException",
+        iis.available(),
+        IOException );
+}
 
 ////////////////////////////////////////////////////////////////////////////////
 void InflaterInputStreamTest::testClose() {

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/InflaterInputStreamTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/InflaterInputStreamTest.h?rev=919468&r1=919467&r2=919468&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/InflaterInputStreamTest.h
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/decaf/util/zip/InflaterInputStreamTest.h
Fri Mar  5 16:23:58 2010
@@ -41,6 +41,8 @@
         CPPUNIT_TEST( testReadBIII3 );
         CPPUNIT_TEST( testReset );
         CPPUNIT_TEST( testClose );
+        CPPUNIT_TEST( testSkip );
+        CPPUNIT_TEST( testSkip2 );
         CPPUNIT_TEST_SUITE_END();
 
     private:
@@ -70,6 +72,9 @@
         void testReadBIII3();
         void testReset();
         void testClose();
+        void testAvailable();
+        void testSkip();
+        void testSkip2();
 
     };
 



Mime
View raw message