62 void testPortDataConnection();
63 void testPortBufferConnection();
64 void testPortDisconnected();
79 tc->ports()->addPort( *mw1 );
101 signalled_port = port;
104 #define ASSERT_PORT_SIGNALLING(code, read_port) do { \ 105 signalled_port = 0; \ 108 while (read_port != signalled_port && wait++ != 5) \ 110 BOOST_CHECK( read_port == signalled_port ); \ 113 #define wait_for( cond, times ) do { \ 114 bool wait_for_helper; \ 116 while( (wait_for_helper = !(cond)) && wait++ != times ) \ 118 if (wait_for_helper) BOOST_CHECK( cond ); \ 121 #define wait_for_equal( a, b, times ) do { \ 122 bool wait_for_helper; \ 124 while( (wait_for_helper = ((a) != (b))) && wait++ != times ) \ 126 if (wait_for_helper) BOOST_CHECK_EQUAL( a, b ); \ 133 BOOST_CHECK( mw1->connected() );
134 BOOST_CHECK( mr1->connected() );
139 BOOST_CHECK( !mr1->read(value) );
143 BOOST_CHECK( mr1->read(value) );
144 BOOST_CHECK_EQUAL( 1.0, value );
146 BOOST_CHECK( mr1->read(value) );
147 BOOST_CHECK_EQUAL( 2.0, value );
154 BOOST_CHECK( mw1->connected() );
155 BOOST_CHECK( mr1->connected() );
160 BOOST_CHECK( !mr1->read(value) );
168 BOOST_CHECK( mr1->read(value) );
169 BOOST_CHECK_EQUAL( 1.0, value );
170 BOOST_CHECK( mr1->read(value) );
171 BOOST_CHECK_EQUAL( 2.0, value );
172 BOOST_CHECK( mr1->read(value) );
173 BOOST_CHECK_EQUAL( 3.0, value );
174 BOOST_CHECK_EQUAL( mr1->read(value),
OldData );
179 BOOST_CHECK( !mw1->connected() );
180 BOOST_CHECK( !mr1->connected() );
199 policy.type = RTT::corba::CData;
201 policy.lock_policy = RTT::corba::CLockFree;
203 policy.data_size = 0;
205 corba::CDataFlowInterface_var ports = ts->server()->ports();
206 corba::CDataFlowInterface_var ports2 = tp->server()->ports();
212 policy.type = RTT::corba::CData;
215 BOOST_CHECK( ports->createConnection(
"mw", ports2,
"mr", policy) );
216 BOOST_CHECK( ports2->createConnection(
"mw", ports,
"mr", policy) );
217 testPortDataConnection();
218 ports->disconnectPort(
"mw");
219 ports2->disconnectPort(
"mw");
220 testPortDisconnected();
222 policy.type = RTT::corba::CData;
225 BOOST_CHECK( ports->createConnection(
"mw", ports2,
"mr", policy) );
226 BOOST_CHECK( ports2->createConnection(
"mw", ports,
"mr", policy) );
227 testPortDataConnection();
228 ports2->disconnectPort(
"mr");
229 ports->disconnectPort(
"mr");
230 testPortDisconnected();
232 policy.type = RTT::corba::CBuffer;
236 BOOST_CHECK( ports->createConnection(
"mw", ports2,
"mr", policy) );
237 BOOST_CHECK( ports2->createConnection(
"mw", ports,
"mr", policy) );
238 testPortBufferConnection();
239 ports->disconnectPort(
"mw");
240 ports2->disconnectPort(
"mw");
241 testPortDisconnected();
243 policy.type = RTT::corba::CBuffer;
247 BOOST_CHECK( ports->createConnection(
"mw", ports2,
"mr", policy) );
248 BOOST_CHECK( ports2->createConnection(
"mw", ports,
"mr", policy) );
249 testPortBufferConnection();
250 ports->disconnectPort(
"mw");
251 ports2->disconnectPort(
"mw");
252 testPortDisconnected();
corba::TaskContextServer * ts2
#define BOOST_FIXTURE_TEST_SUITE(suite_name, F)
void new_data_listener(base::PortInterface *port)
corba::TaskContextProxy * tp2
#define BOOST_AUTO_TEST_SUITE_END()
void testPortDisconnected()
InputPort< double > * mr1
#define ASSERT_PORT_SIGNALLING(code, read_port)
void testPortBufferConnection()
static TaskContextServer * Create(TaskContext *tc, bool use_naming=true, bool require_name_service=false)
OutputPort< double > * mw1
static TaskContextProxy * CreateFromFile(std::string filename)
BOOST_AUTO_TEST_CASE(testPortConnections)
RTT::corba::CConnPolicy toCORBA(RTT::ConnPolicy const &policy)
void testPortDataConnection()
base::PortInterface * signalled_port
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
static TaskContextProxy * Create(std::string name, bool is_ior=false)
#define ORO_MQUEUE_PROTOCOL_ID