From 24435b9c62976e0a4c0857f86057d3c93389b79f Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Tue, 4 Mar 2008 16:34:01 +0000 Subject: Completed holders, visitors and serialization for 0-10 commands and controls. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@633533 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/tests/apply.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'cpp/src/tests/apply.cpp') diff --git a/cpp/src/tests/apply.cpp b/cpp/src/tests/apply.cpp index 553026a35c..1b66d8e3b4 100644 --- a/cpp/src/tests/apply.cpp +++ b/cpp/src/tests/apply.cpp @@ -26,11 +26,15 @@ QPID_AUTO_TEST_SUITE(VisitorTestSuite) using namespace qpid::amqp_0_10; -struct GetCode { - typedef uint8_t result_type; +struct GetCode : public ConstApplyFunctor { template uint8_t operator()(const T&) const { return T::CODE; } }; +struct SetChannelMax : ApplyFunctor { + template void operator()(T&) const { BOOST_FAIL(""); } + void operator()(connection::Tune& t) const { t.channelMax=42; } +}; + struct TestFunctor { typedef bool result_type; bool operator()(const connection::Tune& tune) { @@ -57,6 +61,9 @@ BOOST_AUTO_TEST_CASE(testApply) { connection::Start start; p = &start; BOOST_CHECK(!apply(tf, *p)); + + apply(SetChannelMax(), tune); + BOOST_CHECK_EQUAL(tune.channelMax, 42); } struct VoidTestFunctor { -- cgit v1.2.1