summaryrefslogtreecommitdiff
path: root/cpp/tests
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2007-01-18 19:22:40 +0000
committerGordon Sim <gsim@apache.org>2007-01-18 19:22:40 +0000
commit93bddfd4c9260f958eab861a8a43db55bb836690 (patch)
treef1c88f0db979fc8aa51f4ca10e1ee4ed4ce3b655 /cpp/tests
parent5b6ca65abd333e0ea15790ec351bfb67a7013a5e (diff)
downloadqpid-python-93bddfd4c9260f958eab861a8a43db55bb836690.tar.gz
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
Diffstat (limited to 'cpp/tests')
-rw-r--r--cpp/tests/FramingTest.cpp24
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;