From f6f1900eb98cc1773a88a3ec309afa646438a384 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Wed, 31 Mar 2010 16:17:17 +0000 Subject: QPID-664: made changes suggested by Alan Conway, also moved 0-10 map/list codecs to common lib git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@929606 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/Address.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'cpp/src/tests/Address.cpp') diff --git a/cpp/src/tests/Address.cpp b/cpp/src/tests/Address.cpp index 01d8683efe..a0b87e25af 100644 --- a/cpp/src/tests/Address.cpp +++ b/cpp/src/tests/Address.cpp @@ -49,9 +49,9 @@ QPID_AUTO_TEST_CASE(testParseOptions) { Address address("my-topic; {a:bc, x:101, y:'a string'}"); BOOST_CHECK_EQUAL(std::string("my-topic"), address.getName()); - BOOST_CHECK_EQUAL(std::string("bc"), address.getOption("a").asString()); - BOOST_CHECK_EQUAL((uint16_t) 101, address.getOption("x").asInt64()); - BOOST_CHECK_EQUAL(std::string("a string"), address.getOption("y").asString()); + BOOST_CHECK_EQUAL(std::string("bc"), address.getOptions()["a"].asString()); + BOOST_CHECK_EQUAL((uint16_t) 101, address.getOptions()["x"].asInt64()); + BOOST_CHECK_EQUAL(std::string("a string"), address.getOptions()["y"].asString()); } QPID_AUTO_TEST_CASE(testParseSubjectAndOptions) @@ -59,9 +59,9 @@ QPID_AUTO_TEST_CASE(testParseSubjectAndOptions) Address address("my-topic/my-subject; {a:bc, x:101, y:'a string'}"); BOOST_CHECK_EQUAL(std::string("my-topic"), address.getName()); BOOST_CHECK_EQUAL(std::string("my-subject"), address.getSubject()); - BOOST_CHECK_EQUAL(std::string("bc"), address.getOption("a").asString()); - BOOST_CHECK_EQUAL((uint16_t) 101, address.getOption("x").asInt64()); - BOOST_CHECK_EQUAL(std::string("a string"), address.getOption("y").asString()); + BOOST_CHECK_EQUAL(std::string("bc"), address.getOptions()["a"].asString()); + BOOST_CHECK_EQUAL((uint16_t) 101, address.getOptions()["x"].asInt64()); + BOOST_CHECK_EQUAL(std::string("a string"), address.getOptions()["y"].asString()); } QPID_AUTO_TEST_CASE(testParseNestedOptions) @@ -70,8 +70,8 @@ QPID_AUTO_TEST_CASE(testParseNestedOptions) BOOST_CHECK_EQUAL(std::string("my-topic"), address.getName()); BOOST_CHECK_EQUAL((uint16_t) 202, address.getOptions()["a"].asMap()["p"].asInt64()); BOOST_CHECK_EQUAL(std::string("another string"), address.getOptions()["a"].asMap()["q"].asString()); - BOOST_CHECK_EQUAL((uint16_t) 101, address.getOption("x").asInt64()); - BOOST_CHECK_EQUAL(std::string("a string"), address.getOption("y").asString()); + BOOST_CHECK_EQUAL((uint16_t) 101, address.getOptions()["x"].asInt64()); + BOOST_CHECK_EQUAL(std::string("a string"), address.getOptions()["y"].asString()); } QPID_AUTO_TEST_CASE(testParseOptionsWithList) @@ -84,7 +84,7 @@ QPID_AUTO_TEST_CASE(testParseOptionsWithList) BOOST_CHECK_EQUAL((uint16_t) 202, i->asInt64()); BOOST_CHECK(++i != list.end()); BOOST_CHECK_EQUAL(std::string("another string"), i->asString()); - BOOST_CHECK_EQUAL((uint16_t) 101, address.getOption("x").asInt64()); + BOOST_CHECK_EQUAL((uint16_t) 101, address.getOptions()["x"].asInt64()); } QPID_AUTO_TEST_CASE(testParseQuotedNameAndSubject) -- cgit v1.2.1