summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/Uuid.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-07-04 05:26:26 +0000
committerAlan Conway <aconway@apache.org>2007-07-04 05:26:26 +0000
commitc8523699bbc6c5a58972070b5a53638686d0a1a9 (patch)
tree34f4c0e120dd1946cd2ae75255274747cf8d2b71 /qpid/cpp/src/tests/Uuid.cpp
parent032a2badd732b039635361f800d7b2a710256374 (diff)
downloadqpid-python-c8523699bbc6c5a58972070b5a53638686d0a1a9.tar.gz
Encode/decode for UUIDs.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@553083 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/Uuid.cpp')
-rw-r--r--qpid/cpp/src/tests/Uuid.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/Uuid.cpp b/qpid/cpp/src/tests/Uuid.cpp
index 97e7518c85..43d1cbcbba 100644
--- a/qpid/cpp/src/tests/Uuid.cpp
+++ b/qpid/cpp/src/tests/Uuid.cpp
@@ -17,6 +17,7 @@
*/
#include "qpid/framing/Uuid.h"
+#include "qpid/framing/Buffer.h"
#define BOOST_AUTO_TEST_MAIN
#include <boost/test/auto_unit_test.hpp>
@@ -58,3 +59,13 @@ BOOST_AUTO_TEST_CASE(testUuidOstream) {
BOOST_CHECK(out.good());
BOOST_CHECK_EQUAL(out.str(), sampleStr);
}
+
+BOOST_AUTO_TEST_CASE(testUuidEncodeDecode) {
+ Buffer buf(Uuid::size());
+ Uuid uuid;
+ uuid.encode(buf);
+ buf.flip();
+ Uuid decoded;
+ decoded.decode(buf);
+ BOOST_CHECK(uuid==decoded);
+}