diff options
| author | Ken Giusti <kgiusti@apache.org> | 2010-10-28 21:33:52 +0000 |
|---|---|---|
| committer | Ken Giusti <kgiusti@apache.org> | 2010-10-28 21:33:52 +0000 |
| commit | da8e6aa1aac9f4dfe1656a002ca886543ad479e2 (patch) | |
| tree | 58597637361766aeba3bf863ef4534cc74756643 /cpp/src/tests/FramingTest.cpp | |
| parent | a4f39ba773623ae3fdf55609d4ff5491c35e6968 (diff) | |
| download | qpid-python-da8e6aa1aac9f4dfe1656a002ca886543ad479e2.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/qpid@1028501 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/FramingTest.cpp')
| -rw-r--r-- | cpp/src/tests/FramingTest.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cpp/src/tests/FramingTest.cpp b/cpp/src/tests/FramingTest.cpp index 3d0fa0c0de..f8795316cc 100644 --- a/cpp/src/tests/FramingTest.cpp +++ b/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 |
