From commits-return-6748-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Thu Aug 02 20:34:41 2007 Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 88279 invoked from network); 2 Aug 2007 20:34:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Aug 2007 20:34:40 -0000 Received: (qmail 1766 invoked by uid 500); 2 Aug 2007 20:34:40 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 1740 invoked by uid 500); 2 Aug 2007 20:34:40 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 1731 invoked by uid 99); 2 Aug 2007 20:34:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 13:34:40 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Aug 2007 20:34:40 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E7F0C1A981C; Thu, 2 Aug 2007 13:34:19 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r562245 - /activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ShortTest.cpp Date: Thu, 02 Aug 2007 20:34:19 -0000 To: commits@activemq.apache.org From: tabish@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070802203419.E7F0C1A981C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tabish Date: Thu Aug 2 13:34:18 2007 New Revision: 562245 URL: http://svn.apache.org/viewvc?view=rev&rev=562245 Log: http://issues.apache.org/activemq/browse/AMQCPP-103 Adding in more Types wrappers Modified: activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/lang/ShortTest.cpp 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=562245&r1=562244&r2=562245 ============================================================================== --- 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 Thu Aug 2 13:34:18 2007 @@ -45,5 +45,36 @@ CPPUNIT_ASSERT( Short::reverseBytes( (short)0xDE00 ) == (short)0x00DE ); CPPUNIT_ASSERT( Short::reverseBytes( (short)0x00AB ) == (short)0xAB00 ); + Short short2( 255 ); + + // Comparison functions + CPPUNIT_ASSERT( short2.compareTo( 256 ) == -1 ); + CPPUNIT_ASSERT( short2.compareTo( 255 ) == 0 ); + CPPUNIT_ASSERT( short2.compareTo( 254 ) == 1 ); + CPPUNIT_ASSERT( short2.equals( Short( 255 ) ) == true ); + CPPUNIT_ASSERT( short2.compareTo( Short( 255 ) ) == 0 ); + CPPUNIT_ASSERT( short2 == Short( 255 ) ); + + // decode + CPPUNIT_ASSERT( short2 == Short::decode( "255" ) ); + CPPUNIT_ASSERT( short2 == Short::decode( "0xFF" ) ); + CPPUNIT_ASSERT( short2 == Short::decode( "255" ) ); + CPPUNIT_ASSERT( Short::decode( "-255" ) == -255 ); + + // parseInt + CPPUNIT_ASSERT( Short::parseShort( "255") == 255 ); + CPPUNIT_ASSERT( Short::parseShort( "255", 10 ) == 255 ); + CPPUNIT_ASSERT( Short::parseShort( "255", 11 ) != 255 ); + CPPUNIT_ASSERT( Short::parseShort( "FF", 16 ) == 255 ); + + // valueOf + CPPUNIT_ASSERT( Short::valueOf( 255 ) == 255 ); + CPPUNIT_ASSERT( Short::valueOf( "255" ) == 255 ); + CPPUNIT_ASSERT( Short::valueOf( "255", 10 ) == 255 ); + CPPUNIT_ASSERT( (Short::valueOf( "255", 11 )).shortValue() != 255 ); + CPPUNIT_ASSERT( Short::valueOf( "FF", 16 ) == 255 ); + + CPPUNIT_ASSERT( Short::toString( 255 ) == "255" ); + }