diff options
Diffstat (limited to 'qpid/cpp/src/tests/Variant.cpp')
-rw-r--r-- | qpid/cpp/src/tests/Variant.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/qpid/cpp/src/tests/Variant.cpp b/qpid/cpp/src/tests/Variant.cpp index d2394bfbad..d6605f9fe5 100644 --- a/qpid/cpp/src/tests/Variant.cpp +++ b/qpid/cpp/src/tests/Variant.cpp @@ -18,14 +18,16 @@ * under the License. * */ -#include <iostream> -#include "qpid/types/Variant.h" -#include "qpid/amqp_0_10/Codecs.h" #include "unit_test.h" +#include "qpid/types/Variant.h" +#include "qpid/amqp_0_10/Codecs.h" +#include <boost/assign.hpp> +#include <iostream> using namespace qpid::types; using namespace qpid::amqp_0_10; +using boost::assign::list_of; namespace qpid { namespace tests { @@ -807,6 +809,22 @@ QPID_AUTO_TEST_CASE(parse) BOOST_CHECK(a.getType()==types::VAR_DOUBLE); } +QPID_AUTO_TEST_CASE(described) +{ + Variant a; + BOOST_CHECK(!a.isDescribed()); + a.getDescriptors().push_back("foo"); + BOOST_CHECK(a.isDescribed()); + BOOST_CHECK_EQUAL(a.getDescriptors(), list_of<Variant>("foo")); + a = 42; + BOOST_CHECK(a.isDescribed()); + BOOST_CHECK_EQUAL(a.getDescriptors(), list_of<Variant>("foo")); + a.getDescriptors().push_back(33); + BOOST_CHECK_EQUAL(a.getDescriptors(), list_of<Variant>("foo")(33)); + a.getDescriptors().clear(); + BOOST_CHECK(!a.isDescribed()); +} + QPID_AUTO_TEST_SUITE_END() }} // namespace qpid::tests |