summaryrefslogtreecommitdiff
path: root/cpp/src/tests/apply.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-03-04 16:34:01 +0000
committerAlan Conway <aconway@apache.org>2008-03-04 16:34:01 +0000
commit24435b9c62976e0a4c0857f86057d3c93389b79f (patch)
treece9c88040f27fee8fc5f980e09c4ee487686cb4b /cpp/src/tests/apply.cpp
parent089d3974d9555658f79e4ef02232877dab4dcad3 (diff)
downloadqpid-python-24435b9c62976e0a4c0857f86057d3c93389b79f.tar.gz
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
Diffstat (limited to 'cpp/src/tests/apply.cpp')
-rw-r--r--cpp/src/tests/apply.cpp11
1 files changed, 9 insertions, 2 deletions
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<uint8_t> {
template <class T> uint8_t operator()(const T&) const { return T::CODE; }
};
+struct SetChannelMax : ApplyFunctor<void> {
+ template <class T> 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 {