activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r560267 - in /activemq/activemq-cpp/trunk/src/decaf/src: main/decaf/lang/Short.cpp main/decaf/lang/Short.h test/decaf/lang/ShortTest.cpp
Date Fri, 27 Jul 2007 15:07:44 GMT
Author: tabish
Date: Fri Jul 27 08:07:42 2007
New Revision: 560267

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

Implementing the Primitive Wrappers fully

Modified:
    activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Short.cpp
    activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Short.h
    activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ShortTest.cpp

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Short.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Short.cpp?view=diff&rev=560267&r1=560266&r2=560267
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Short.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Short.cpp Fri Jul 27 08:07:42
2007
@@ -36,6 +36,18 @@
 }
 
 ////////////////////////////////////////////////////////////////////////////////
+std::string Short::toString() const {
+    // TODO
+    return "";
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string Short::toString( short value ) {
+    // TODO
+    return "";
+}
+
+////////////////////////////////////////////////////////////////////////////////
 short Short::parseShort( const std::string& s, int radix )
     throw ( exceptions::NumberFormatException ) {
 

Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Short.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Short.h?view=diff&rev=560267&r1=560266&r2=560267
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Short.h (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/lang/Short.h Fri Jul 27 08:07:42
2007
@@ -83,6 +83,11 @@
         }
 
         /**
+         * @returns this Short Object as a String Representation
+         */
+        std::string toString() const;
+
+        /**
          * Answers the double value which the receiver represents
          * @return double the value of the receiver.
          */
@@ -132,6 +137,11 @@
 
     public:   // statics
 
+    	/**
+    	 * @returns a string representing the primitive value as Base 10
+    	 */
+    	static std::string toString( short value );
+    	
         /**
          * Decodes a String into a Short. Accepts decimal, hexadecimal, and octal
          * numbers given by the following grammar:

Modified: activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ShortTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ShortTest.cpp?view=diff&rev=560267&r1=560266&r2=560267
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ShortTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ShortTest.cpp Fri Jul 27 08:07:42
2007
@@ -30,7 +30,15 @@
 
     Short short1( 65 );
 
+    CPPUNIT_ASSERT( short1.byteValue() == 65 );
     CPPUNIT_ASSERT( short1.shortValue() == 65 );
+    CPPUNIT_ASSERT( short1.intValue() == 65 );
+    CPPUNIT_ASSERT( short1.longValue() == 65 );
+    CPPUNIT_ASSERT( short1.floatValue() == 65.0f );
+    CPPUNIT_ASSERT( short1.doubleValue() == 65.0 );
+
+    //CPPUNIT_ASSERT( short1.toString() == "65" );
+    //CPPUNIT_ASSERT( short1.toString( 99 ) == "99" );
 
 }
 



Mime
View raw message