diff options
| author | Gordon Sim <gsim@apache.org> | 2011-07-01 12:00:56 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2011-07-01 12:00:56 +0000 |
| commit | 8546ea37875a557e5c7229661592628d1f0ce512 (patch) | |
| tree | acb6763c93179d3ad4f65b132392af8e3f49aabc /qpid/cpp/src/tests/Address.cpp | |
| parent | dbf9444ffcf031fc8436953fa05f1b9de1549213 (diff) | |
| download | qpid-python-8546ea37875a557e5c7229661592628d1f0ce512.tar.gz | |
QPID-3330: Corrected handling of empty strings (using patch from Anthony Foglia) and added test case
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1141910 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/Address.cpp')
| -rw-r--r-- | qpid/cpp/src/tests/Address.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/Address.cpp b/qpid/cpp/src/tests/Address.cpp index f41f27b6df..0fd3585958 100644 --- a/qpid/cpp/src/tests/Address.cpp +++ b/qpid/cpp/src/tests/Address.cpp @@ -119,6 +119,17 @@ QPID_AUTO_TEST_CASE(testParseQuotedNameAndSubject) BOOST_CHECK_EQUAL(std::string("my subject with ; in it"), address.getSubject()); } +QPID_AUTO_TEST_CASE(testParseOptionsWithEmptyStringAsValue) +{ + Address address("my-topic; {a:'', x:101}"); + BOOST_CHECK_EQUAL(std::string("my-topic"), address.getName()); + Variant a = address.getOptions()["a"]; + BOOST_CHECK_EQUAL(VAR_STRING, a.getType()); + std::string aVal = a; + BOOST_CHECK(aVal.size() == 0); + BOOST_CHECK_EQUAL((uint16_t) 101, address.getOptions()["x"].asInt64()); +} + QPID_AUTO_TEST_SUITE_END() }} |
