4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief Jack unit tests */
26 //#include "Jack.test.hh"
27 //#include "Jack.test.ih"
32 #include "../Utils/auto_unit_test.hh"
33 #include <boost/test/test_tools.hpp>
36 ///////////////////////////////cc.p////////////////////////////////////////
40 class ActiveDummyForward
41 : public senf::ppi::module::Module
43 SENF_PPI_MODULE(ActiveDummyForward);
45 senf::ppi::connector::ActiveInput<> input;
46 senf::ppi::connector::PassiveOutput<> output;
49 { route(input, output); output.onRequest(&ActiveDummyForward::request); }
56 class PassiveDummyForward
57 : public senf::ppi::module::Module
59 SENF_PPI_MODULE(PassiveDummyForward);
61 senf::ppi::connector::PassiveInput<> input;
62 senf::ppi::connector::ActiveOutput<> output;
65 { route(input, output); input.onRequest(&PassiveDummyForward::request); }
75 senf::ppi::connector::ActiveInputJack<> input;
76 senf::ppi::connector::PassiveOutputJack<> output;
79 : input (forward.input), output (forward.output) {}
82 ActiveDummyForward forward;
88 senf::ppi::connector::PassiveInputJack<> input;
89 senf::ppi::connector::ActiveOutputJack<> output;
92 : input (forward.input), output (forward.output) {}
95 PassiveDummyForward forward;
100 BOOST_AUTO_UNIT_TEST(jacks)
104 senf::ppi::module::debug::PassiveSource source;
105 senf::ppi::module::debug::ActiveSink sink;
107 senf::ppi::connect(source, group);
108 senf::ppi::connect(group, sink);
112 senf::Packet p (senf::DataPacket::create());
115 BOOST_CHECK(p == sink.request());
120 senf::ppi::module::debug::ActiveSource source;
121 senf::ppi::module::debug::PassiveSink sink;
123 senf::ppi::connect(source, group);
124 senf::ppi::connect(group, sink);
128 senf::Packet p (senf::DataPacket::create());
131 BOOST_CHECK(p == sink.front());
135 ///////////////////////////////cc.e////////////////////////////////////////
142 // comment-column: 40
143 // c-file-style: "senf"
144 // indent-tabs-mode: nil
145 // ispell-local-dictionary: "american"
146 // compile-command: "scons -u test"