diff options
Diffstat (limited to 'cpp/tests/FramingTest.cpp')
-rw-r--r-- | cpp/tests/FramingTest.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/cpp/tests/FramingTest.cpp b/cpp/tests/FramingTest.cpp index 268963f7b8..b081b5822b 100644 --- a/cpp/tests/FramingTest.cpp +++ b/cpp/tests/FramingTest.cpp @@ -55,6 +55,8 @@ class FramingTest : public CppUnit::TestCase CPPUNIT_TEST(testResponseBodyFrame); CPPUNIT_TEST(testRequester); CPPUNIT_TEST(testResponder); + CPPUNIT_TEST(testInlineContent); + CPPUNIT_TEST(testContentReference); CPPUNIT_TEST_SUITE_END(); private: @@ -175,6 +177,28 @@ class FramingTest : public CppUnit::TestCase CPPUNIT_ASSERT(decoded); } + void testInlineContent() { + Content content(INLINE, "MyData"); + CPPUNIT_ASSERT(content.isInline()); + content.encode(buffer); + buffer.flip(); + Content recovered; + recovered.decode(buffer); + CPPUNIT_ASSERT(recovered.isInline()); + CPPUNIT_ASSERT_EQUAL(content.getValue(), recovered.getValue()); + } + + void testContentReference() { + Content content(REFERENCE, "MyRef"); + CPPUNIT_ASSERT(content.isReference()); + content.encode(buffer); + buffer.flip(); + Content recovered; + recovered.decode(buffer); + CPPUNIT_ASSERT(recovered.isReference()); + CPPUNIT_ASSERT_EQUAL(content.getValue(), recovered.getValue()); + } + void testRequester() { Requester r; AMQRequestBody::Data q; |