45 tc->ports()->addPort( *mw1 );
49 t2->ports()->addPort( *mw2 );
74 signalled_port = port;
78 #define ASSERT_PORT_SIGNALLING(code, read_port) do { \ 82 BOOST_CHECK( read_port == signalled_port ); \ 89 BOOST_CHECK( mw1->connected() );
90 BOOST_CHECK( mr2->connected() );
95 BOOST_CHECK( !mr2->read(value) );
99 BOOST_CHECK( mr2->read(value) );
100 BOOST_CHECK_EQUAL( 1.0, value );
102 BOOST_CHECK( mr2->read(value) );
103 BOOST_CHECK_EQUAL( 2.0, value );
110 BOOST_CHECK( mw1->connected() );
111 BOOST_CHECK( mr2->connected() );
116 BOOST_CHECK( !mr2->read(value) );
124 BOOST_CHECK( mr2->read(value) );
125 BOOST_CHECK_EQUAL( 1.0, value );
126 BOOST_CHECK( mr2->read(value) );
127 BOOST_CHECK_EQUAL( 2.0, value );
128 BOOST_CHECK( mr2->read(value) );
129 BOOST_CHECK_EQUAL( 3.0, value );
130 BOOST_CHECK_EQUAL( mr2->read(value),
OldData );
135 BOOST_CHECK( !mw1->connected() );
136 BOOST_CHECK( !mr2->connected() );
147 ts = corba::TaskContextServer::Create( tc,
false );
148 ts2 = corba::TaskContextServer::Create( t2,
false );
152 policy.type = RTT::corba::CData;
154 policy.lock_policy = RTT::corba::CLockFree;
156 policy.data_size = 0;
158 corba::CDataFlowInterface_var ports = ts->server()->ports();
159 corba::CDataFlowInterface_var ports2 = ts2->server()->ports();
162 BOOST_CHECK( t2->start() );
167 policy.type = RTT::corba::CData;
170 BOOST_CHECK( ports->createConnection(
"mw", ports2,
"mr", policy) );
172 testPortDataConnection();
173 ports->disconnectPort(
"mw");
174 testPortDisconnected();
176 policy.type = RTT::corba::CData;
179 BOOST_CHECK( ports->createConnection(
"mw", ports2,
"mr", policy) );
181 testPortDataConnection();
182 ports2->disconnectPort(
"mr");
183 testPortDisconnected();
187 policy.type = RTT::corba::CBuffer;
191 BOOST_CHECK( ports->createConnection(
"mw", ports2,
"mr", policy) );
192 testPortBufferConnection();
193 ports->disconnectPort(
"mw");
194 testPortDisconnected();
196 policy.type = RTT::corba::CBuffer;
200 BOOST_CHECK( ports->createConnection(
"mw", ports2,
"mr", policy) );
201 testPortBufferConnection();
202 ports->disconnectPort(
"mw");
203 testPortDisconnected();
#define BOOST_FIXTURE_TEST_SUITE(suite_name, F)
BOOST_AUTO_TEST_CASE(testPortConnections)
#define BOOST_AUTO_TEST_SUITE_END()
int usleep(unsigned int us)
void new_data_listener(base::PortInterface *port)
void testPortBufferConnection()
void testPortDataConnection()
RTT::corba::CConnPolicy toCORBA(RTT::ConnPolicy const &policy)
void testPortDisconnected()
#define ASSERT_PORT_SIGNALLING(code, read_port)
#define ORO_MQUEUE_PROTOCOL_ID