You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2007/08/03 16:09:58 UTC

svn commit: r562473 - in /activemq/activemq-cpp/trunk/src/decaf/src/test: Makefile.am decaf/lang/ByteTest.cpp decaf/lang/ByteTest.h testRegistry.cpp

Author: tabish
Date: Fri Aug  3 07:09:58 2007
New Revision: 562473

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

Adding in more Types wrappers

Added:
    activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ByteTest.cpp
    activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ByteTest.h
Modified:
    activemq/activemq-cpp/trunk/src/decaf/src/test/Makefile.am
    activemq/activemq-cpp/trunk/src/decaf/src/test/testRegistry.cpp

Modified: activemq/activemq-cpp/trunk/src/decaf/src/test/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/test/Makefile.am?view=diff&rev=562473&r1=562472&r2=562473
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/Makefile.am Fri Aug  3 07:09:58 2007
@@ -16,6 +16,7 @@
 # ---------------------------------------------------------------------------
 
 cc_sources = \
+  decaf/lang/ByteTest.cpp \
   decaf/lang/CharacterTest.cpp \
   decaf/lang/BooleanTest.cpp \
   decaf/lang/ShortTest.cpp \
@@ -46,6 +47,7 @@
   main.cpp
 
 h_sources = \
+  decaf/lang/ByteTest.h \
   decaf/lang/CharacterTest.h \
   decaf/lang/BooleanTest.h \
   decaf/lang/ShortTest.h \

Added: activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ByteTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ByteTest.cpp?view=auto&rev=562473
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ByteTest.cpp (added)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ByteTest.cpp Fri Aug  3 07:09:58 2007
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "ByteTest.h"
+
+using namespace decaf;
+using namespace decaf::lang;
+
+////////////////////////////////////////////////////////////////////////////////
+ByteTest::ByteTest(){
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ByteTest::test() {
+
+    Byte ubyte( 'b' );
+
+    CPPUNIT_ASSERT( ubyte < 'a' == false );
+    CPPUNIT_ASSERT( ubyte.compareTo( 'a' ) == 1 );
+    CPPUNIT_ASSERT( ubyte.compareTo( 'b' ) == 0 );
+    CPPUNIT_ASSERT( ubyte.compareTo( 'c' ) == -1 );
+
+    CPPUNIT_ASSERT( ubyte.parseByte( "60" ) == 60 );
+    CPPUNIT_ASSERT( ubyte.parseByte( "ff", 16 ) == 255 );
+
+    CPPUNIT_ASSERT( ubyte.toString( 60 ) == "60" );
+    CPPUNIT_ASSERT( ubyte.toString( 255 ) == "255" );
+
+    CPPUNIT_ASSERT( ubyte.decode( "0xFF" ) == 255 );
+    CPPUNIT_ASSERT( ubyte.decode( "255" ) == 255 );
+
+}

Added: activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ByteTest.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ByteTest.h?view=auto&rev=562473
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ByteTest.h (added)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ByteTest.h Fri Aug  3 07:09:58 2007
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef _DECAF_LANG_BYTETEST_H_
+#define _DECAF_LANG_BYTETEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <decaf/lang/Byte.h>
+
+namespace decaf{
+namespace lang{
+
+    class ByteTest : public CppUnit::TestFixture
+    {
+        CPPUNIT_TEST_SUITE( ByteTest );
+        CPPUNIT_TEST( test );
+        CPPUNIT_TEST_SUITE_END();
+
+    public:
+
+        ByteTest();
+        virtual ~ByteTest() {}
+
+        virtual void test();
+    };
+
+}}
+
+#endif /*_DECAF_LANG_BYTETEST_H_*/

Modified: activemq/activemq-cpp/trunk/src/decaf/src/test/testRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/test/testRegistry.cpp?view=diff&rev=562473&r1=562472&r2=562473
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/testRegistry.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/testRegistry.cpp Fri Aug  3 07:09:58 2007
@@ -17,7 +17,7 @@
 
 // All CPP Unit tests are registered in here so we can disable them and
 // enable them easily in one place.
-//
+
 #include <decaf/io/BufferedInputStreamTest.h>
 CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::BufferedInputStreamTest );
 #include <decaf/io/BufferedOutputStreamTest.h>
@@ -31,6 +31,8 @@
 #include <decaf/io/DataOutputStreamTest.h>
 CPPUNIT_TEST_SUITE_REGISTRATION( decaf::io::DataOutputStreamTest );
 
+#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>