activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r662060 - in /activemq/activemq-cpp/trunk/src/test/activemq/util: PrimitiveListTest.cpp PrimitiveListTest.h
Date Sat, 31 May 2008 18:28:44 GMT
Author: tabish
Date: Sat May 31 11:28:44 2008
New Revision: 662060

URL: http://svn.apache.org/viewvc?rev=662060&view=rev
Log: (empty)

Modified:
    activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp
    activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.h

Modified: activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp?rev=662060&r1=662059&r2=662060&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp Sat May 31 11:28:44
2008
@@ -115,6 +115,57 @@
     CPPUNIT_ASSERT( plist.getByteArray(0) == byteArray );
 }
 
+void PrimitiveListTest::testAdd(){
+
+    bool boolValue = true;
+    unsigned char byteValue = 65;
+    char charValue = 'A';
+    short shortValue = 32767;
+    int intValue = 65540;
+    long long longValue = 0xFFFFFFFFFFFFFFFFLL;
+    float floatValue = 5.55f;
+    double doubleValue = 687.021654;
+    std::string stringValue = "TEST";
+    std::vector<unsigned char> byteArrayValue;
+    byteArrayValue.push_back( 'a' );
+    byteArrayValue.push_back( 'b' );
+    byteArrayValue.push_back( 'c' );
+    byteArrayValue.push_back( 'd' );
+
+    PrimitiveList plist;
+    plist.add( boolValue );
+    plist.add( byteValue );
+    plist.add( charValue );
+    plist.add( shortValue );
+    plist.add( intValue );
+    plist.add( longValue );
+    plist.add( floatValue );
+    plist.add( doubleValue );
+    plist.add( stringValue );
+    plist.add( byteArrayValue );
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should Throw NoSuchElementException",
+        plist.getInt( 0 ),
+        decaf::lang::exceptions::NoSuchElementException );
+
+    CPPUNIT_ASSERT_THROW_MESSAGE(
+        "Should Throw IndexOutOfBoundsException",
+        plist.getInt( plist.size() ),
+        decaf::lang::exceptions::IndexOutOfBoundsException );
+
+    CPPUNIT_ASSERT( plist.get(0).getValueType() == BOOLEAN_TYPE );
+    CPPUNIT_ASSERT( plist.get(1).getValueType() == BYTE_TYPE );
+    CPPUNIT_ASSERT( plist.get(2).getValueType() == CHAR_TYPE );
+    CPPUNIT_ASSERT( plist.get(3).getValueType() == SHORT_TYPE );
+    CPPUNIT_ASSERT( plist.get(4).getValueType() == INTEGER_TYPE );
+    CPPUNIT_ASSERT( plist.get(5).getValueType() == LONG_TYPE );
+    CPPUNIT_ASSERT( plist.get(6).getValueType() == FLOAT_TYPE );
+    CPPUNIT_ASSERT( plist.get(7).getValueType() == DOUBLE_TYPE );
+    CPPUNIT_ASSERT( plist.get(8).getValueType() == STRING_TYPE );
+    CPPUNIT_ASSERT( plist.get(9).getValueType() == BYTE_ARRAY_TYPE );
+}
+
 void PrimitiveListTest::testRemove(){
 
     PrimitiveList plist;

Modified: activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.h?rev=662060&r1=662059&r2=662060&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.h (original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.h Sat May 31 11:28:44
2008
@@ -30,6 +30,7 @@
     {
         CPPUNIT_TEST_SUITE( PrimitiveListTest );
         CPPUNIT_TEST( testSetGet );
+        CPPUNIT_TEST( testAdd );
         CPPUNIT_TEST( testRemove );
         CPPUNIT_TEST( testCount );
         CPPUNIT_TEST( testClear );
@@ -44,6 +45,7 @@
 
         void testValueNode();
         void testSetGet();
+        void testAdd();
         void testRemove();
         void testCount();
         void testCopy();



Mime
View raw message