diff options
| author | Alan Conway <aconway@apache.org> | 2008-03-04 16:34:01 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-03-04 16:34:01 +0000 |
| commit | 920ebd038170238ab4e77d25a77cf2c6730ba97b (patch) | |
| tree | c7e76744a7242d894da7e5f2207205a2904ae476 /qpid/cpp/src/tests/apply.cpp | |
| parent | 82ea7ae1ceeec4c9be409a744f63ec49113676f7 (diff) | |
| download | qpid-python-920ebd038170238ab4e77d25a77cf2c6730ba97b.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@633533 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/apply.cpp')
| -rw-r--r-- | qpid/cpp/src/tests/apply.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/qpid/cpp/src/tests/apply.cpp b/qpid/cpp/src/tests/apply.cpp index 553026a35c..1b66d8e3b4 100644 --- a/qpid/cpp/src/tests/apply.cpp +++ b/qpid/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 { |
