From a0970a27bbac9300170ca19237f99da4aceb2969 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 17 Dec 2009 11:14:57 +0000 Subject: QPID-2289: Fixed copy constructor in qpid::messaging::Message, added in equality operator for qpid::messaging::Variant git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@891636 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/tests/Variant.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'qpid/cpp/src/tests/Variant.cpp') diff --git a/qpid/cpp/src/tests/Variant.cpp b/qpid/cpp/src/tests/Variant.cpp index 2d68bb842c..21005779f0 100644 --- a/qpid/cpp/src/tests/Variant.cpp +++ b/qpid/cpp/src/tests/Variant.cpp @@ -157,6 +157,22 @@ QPID_AUTO_TEST_CASE(testMap) BOOST_CHECK_EQUAL(std::string("now it's a string"), value.asMap()["my-key"].asString()); } +QPID_AUTO_TEST_CASE(testIsEqualTo) +{ + BOOST_CHECK_EQUAL(Variant("abc"), Variant("abc")); + BOOST_CHECK_EQUAL(Variant(1234), Variant(1234)); + + Variant a = Variant::Map(); + a.asMap()["colour"] = "red"; + a.asMap()["pi"] = 3.14f; + a.asMap()["my-key"] = 1234; + Variant b = Variant::Map(); + b.asMap()["colour"] = "red"; + b.asMap()["pi"] = 3.14f; + b.asMap()["my-key"] = 1234; + BOOST_CHECK_EQUAL(a, b); +} + QPID_AUTO_TEST_SUITE_END() }} // namespace qpid::tests -- cgit v1.2.1