diff options
author | Gordon Sim <gsim@apache.org> | 2010-01-15 15:17:01 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2010-01-15 15:17:01 +0000 |
commit | 8e1f647a10024492e09a689e61128eb5f42c561e (patch) | |
tree | 139169bc5eab35ab62d9c30f8009f4565603a50a /cpp/src/tests/Uuid.cpp | |
parent | 8455ba0b116208f47ce238b384d4af274fa0edb6 (diff) | |
download | qpid-python-8e1f647a10024492e09a689e61128eb5f42c561e.tar.gz |
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
Diffstat (limited to 'cpp/src/tests/Uuid.cpp')
-rw-r--r-- | cpp/src/tests/Uuid.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
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 |