summaryrefslogtreecommitdiff
path: root/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
commitd4be469092c558ca9031d82b963b8b845fa1e1bd (patch)
tree745ccfec0f180932ab2f3a9abe31a708a49c020c /cpp/src/tests/Uuid.cpp
parent90e275cc082f3ec71c4b879c2ea4d037d4128278 (diff)
downloadqpid-python-d4be469092c558ca9031d82b963b8b845fa1e1bd.tar.gz
Encode/decode for UUIDs.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@553083 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/Uuid.cpp')
-rw-r--r--cpp/src/tests/Uuid.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/cpp/src/tests/Uuid.cpp b/cpp/src/tests/Uuid.cpp
index 97e7518c85..43d1cbcbba 100644
--- a/cpp/src/tests/Uuid.cpp
+++ b/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);
+}