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/06 01:07:08 UTC
svn commit: r562982 - in /activemq/activemq-cpp/trunk/src/decaf/src:
main/decaf/util/UUID.cpp test/Makefile.am test/decaf/util/UUIDTest.cpp
test/testRegistry.cpp
Author: tabish
Date: Sun Aug 5 16:07:05 2007
New Revision: 562982
URL: http://svn.apache.org/viewvc?view=rev&rev=562982
Log:
http://issues.apache.org/activemq/browse/AMQCPP-103
Working on the UUID impl.
Modified:
activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/UUID.cpp
activemq/activemq-cpp/trunk/src/decaf/src/test/Makefile.am
activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/util/UUIDTest.cpp
activemq/activemq-cpp/trunk/src/decaf/src/test/testRegistry.cpp
Modified: activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/UUID.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/UUID.cpp?view=diff&rev=562982&r1=562981&r2=562982
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/UUID.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/main/decaf/util/UUID.cpp Sun Aug 5 16:07:05 2007
@@ -152,7 +152,7 @@
apr_uuid_t temp;
// Generate some random bytes.
- apr_generate_random_bytes( temp.data, 16 );
+ apr_uuid_get( &temp );
long long mostSigBits = 0;
long long leastSigBits = 0;
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=562982&r1=562981&r2=562982
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/Makefile.am Sun Aug 5 16:07:05 2007
@@ -36,6 +36,7 @@
decaf/util/Endian.cpp \
decaf/util/DateTest.cpp \
decaf/util/GuidTest.cpp \
+ decaf/util/UUIDTest.cpp \
decaf/util/RandomTest.cpp \
decaf/util/MapTest.cpp \
decaf/util/QueueTest.cpp \
@@ -67,6 +68,7 @@
decaf/util/Endian.h \
decaf/util/DateTest.h \
decaf/util/GuidTest.h \
+ decaf/util/UUIDTest.h \
decaf/util/RandomTest.h \
decaf/util/MapTest.h \
decaf/util/QueueTest.h \
Modified: activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/util/UUIDTest.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/util/UUIDTest.cpp?view=diff&rev=562982&r1=562981&r2=562982
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/util/UUIDTest.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/decaf/util/UUIDTest.cpp Sun Aug 5 16:07:05 2007
@@ -28,4 +28,14 @@
////////////////////////////////////////////////////////////////////////////////
void UUIDTest::test() {
+
+ UUID randId = UUID::randomUUID();
+ UUID bytesId = UUID::nameUUIDFromBytes( "ASDASFSADGSDGSDASFA" );
+
+ CPPUNIT_ASSERT( !( randId == bytesId ) );
+ CPPUNIT_ASSERT( !( randId.equals( bytesId ) ) );
+ CPPUNIT_ASSERT( randId.compareTo( bytesId ) != 0 );
+
+ CPPUNIT_ASSERT( randId.variant() == 2 );
+
}
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=562982&r1=562981&r2=562982
==============================================================================
--- activemq/activemq-cpp/trunk/src/decaf/src/test/testRegistry.cpp (original)
+++ activemq/activemq-cpp/trunk/src/decaf/src/test/testRegistry.cpp Sun Aug 5 16:07:05 2007
@@ -37,14 +37,14 @@
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::CharacterTest );
#include <decaf/lang/BooleanTest.h>
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::BooleanTest );
-#include <decaf/lang/ExceptionTest.h>
-CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ExceptionTest );
#include <decaf/lang/ShortTest.h>
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ShortTest );
#include <decaf/lang/IntegerTest.h>
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::IntegerTest );
#include <decaf/lang/LongTest.h>
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::LongTest );
+#include <decaf/lang/ExceptionTest.h>
+CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ExceptionTest );
#include <decaf/lang/ThreadTest.h>
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::lang::ThreadTest );
@@ -64,6 +64,8 @@
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::DateTest );
#include <decaf/util/GuidTest.h>
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::GuidTest );
+#include <decaf/util/UUIDTest.h>
+CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::UUIDTest );
#include <decaf/util/MapTest.h>
CPPUNIT_TEST_SUITE_REGISTRATION( decaf::util::MapTest );
#include <decaf/util/QueueTest.h>