diff options
author | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-10-28 21:33:52 +0000 |
---|---|---|
committer | Kenneth Anthony Giusti <kgiusti@apache.org> | 2010-10-28 21:33:52 +0000 |
commit | 7da23f2ec7b60e6a68e0a735b7aa3e1910605ffd (patch) | |
tree | 12d8dfc445e2ed1732d19fddeb77006fe61c39d8 /qpid/cpp/src/tests/FramingTest.cpp | |
parent | a6bb93082956780c68c34a0f44a73911a463ae42 (diff) | |
download | qpid-python-7da23f2ec7b60e6a68e0a735b7aa3e1910605ffd.tar.gz |
QPID-2916: throw an exception when a data value cannot be encoded correctly as its type.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1028501 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/FramingTest.cpp')
-rw-r--r-- | qpid/cpp/src/tests/FramingTest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/FramingTest.cpp b/qpid/cpp/src/tests/FramingTest.cpp index 3d0fa0c0de..f8795316cc 100644 --- a/qpid/cpp/src/tests/FramingTest.cpp +++ b/qpid/cpp/src/tests/FramingTest.cpp @@ -151,6 +151,17 @@ QPID_AUTO_TEST_CASE(testMessageCancelBodyFrame) BOOST_CHECK_EQUAL(tostring(in), tostring(out)); } +QPID_AUTO_TEST_CASE(badStrings) { + char data[(65535 + 2) + (255 + 1)]; + Buffer b(data, sizeof(data)); + BOOST_CHECK_THROW(b.putShortString(std::string(256, 'X')), + Exception); + BOOST_CHECK_THROW(b.putMediumString(std::string(65536, 'X')), + Exception); + b.putShortString(std::string(255, 'X')); + b.putMediumString(std::string(65535, 'X')); +} + QPID_AUTO_TEST_SUITE_END() }} // namespace qpid::tests |