47 BOOST_TEST_MESSAGE(
"[ENTER] MasterComponent::updateHook()" );
48 if (activity) activity->execute();
49 BOOST_TEST_MESSAGE(
"[EXIT] MasterComponent::updateHook()" );
54 this->activity = activity;
65 , own_thread_operation_called_counter(0)
68 slave_operation_caller.setCaller(this->engine());
73 BOOST_TEST_MESSAGE(
"[ENTER] SlaveComponent::ownThreadOperation()" );
74 own_thread_operation_called_counter++;
76 if (slave_operation_caller.ready()) {
77 slave_operation_caller();
79 BOOST_TEST_MESSAGE(
"[EXIT] SlaveComponent::ownThreadOperation()" );
91 , callback_operation_called_counter(0)
95 slave_operation_caller.setCaller(this->engine());
100 BOOST_TEST_MESSAGE(
"[ENTER] ClientComponent::callSlaveOperation()" );
101 BOOST_REQUIRE(slave_operation_caller.ready());
102 slave_operation_caller();
103 BOOST_TEST_MESSAGE(
"[EXIT] ClientComponent::callSlaveOperation()" );
108 BOOST_TEST_MESSAGE(
"[ENTER] ClientComponent::callbackOperation()" );
109 callback_operation_called_counter++;
110 BOOST_TEST_MESSAGE(
"[EXIT] ClientComponent::callbackOperation()" );
129 master.execute(slave.getActivity());
130 client.slave_operation_caller = slave.getOperation(
"ownThreadOperation");
149 BOOST_REQUIRE( callSlaveOperation.
ready() );
154 while( !handle.collectIfDone() && wait-- ) {
157 BOOST_CHECK( handle.collectIfDone() );
158 BOOST_CHECK_EQUAL( slave.own_thread_operation_called_counter, 1 );
159 BOOST_CHECK_EQUAL( client.callback_operation_called_counter, 0 );
166 BOOST_REQUIRE( callSlaveOperation.
ready() );
169 slave.slave_operation_caller = client.getOperation(
"callbackOperation");
170 BOOST_REQUIRE( slave.slave_operation_caller.ready() );
175 while( !handle.collectIfDone() && wait-- ) {
178 BOOST_CHECK( handle.collectIfDone() );
179 BOOST_CHECK_EQUAL( slave.own_thread_operation_called_counter, 1 );
180 BOOST_CHECK_EQUAL( client.callback_operation_called_counter, 1 );
#define BOOST_FIXTURE_TEST_SUITE(suite_name, F)
void callSlaveOperation()
void execute(RTT::base::ActivityInterface *activity)
#define BOOST_AUTO_TEST_SUITE_END()
RTT::base::ActivityInterface * activity
The SendHandle is used to collect the result values of an asynchronous invocation. The template argument Signature must have the same type as the method being invoked.
void ownThreadOperation()
Interface to start/stop and query a Activity.
BOOST_AUTO_TEST_CASE(testSlaveOperationCall)
unsigned int own_thread_operation_called_counter
unsigned int callback_operation_called_counter
unsigned int sleep(unsigned int s)
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
RTT::OperationCaller< void()> slave_operation_caller
RTT::OperationCaller< void()> slave_operation_caller