From 93bddfd4c9260f958eab861a8a43db55bb836690 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Thu, 18 Jan 2007 19:22:40 +0000 Subject: Initial implementation of AMQP content data type. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-9@497542 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/tests/FramingTest.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'cpp/tests') 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; -- cgit v1.2.1