From 8e1f647a10024492e09a689e61128eb5f42c561e Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Fri, 15 Jan 2010 15:17:01 +0000 Subject: QPID-2323: add a Uuid type and allow it as the value of a Variant. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@899657 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/Uuid.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'cpp/src/tests/Uuid.cpp') diff --git a/cpp/src/tests/Uuid.cpp b/cpp/src/tests/Uuid.cpp index a6ddb9b5a5..6d6c07169f 100644 --- a/cpp/src/tests/Uuid.cpp +++ b/cpp/src/tests/Uuid.cpp @@ -18,6 +18,7 @@ #include "qpid/framing/Uuid.h" #include "qpid/framing/Buffer.h" +#include "qpid/messaging/Uuid.h" #include "qpid/sys/alloca.h" #include "unit_test.h" @@ -79,6 +80,34 @@ QPID_AUTO_TEST_CASE(testUuidEncodeDecode) { string(decoded.begin(), decoded.end())); } +QPID_AUTO_TEST_CASE(testMessagingUuid) +{ + //tests for the Uuid class in the messaging namespace (introduced + //to avoid pulling in dependencies from framing) + messaging::Uuid a; + messaging::Uuid b(true); + messaging::Uuid c(true); + messaging::Uuid d(b); + messaging::Uuid e; + e = c; + + BOOST_CHECK(!a); + BOOST_CHECK(b); + + BOOST_CHECK(a != b); + BOOST_CHECK(b != c); + + BOOST_CHECK_EQUAL(b, d); + BOOST_CHECK_EQUAL(c, e); + + ostringstream out; + out << b; + istringstream in(out.str()); + in >> a; + BOOST_CHECK(!in.fail()); + BOOST_CHECK_EQUAL(a, b); +} + QPID_AUTO_TEST_SUITE_END() }} // namespace qpid::tests -- cgit v1.2.1