42 m0 = tc->provides(
"methods");
48 BOOST_CHECK_EQUAL( -1.0, m0() );
49 BOOST_CHECK_EQUAL( -2.0, m1(1) );
50 BOOST_CHECK_EQUAL( -3.0, m2(1, 2.0) );
51 BOOST_CHECK_EQUAL( -4.0, m3(1, 2.0,
true) );
52 BOOST_CHECK_EQUAL( -5.0, m4(1, 2.0,
true,
"hello") );
56 m1.setCaller( caller->engine() );
57 m2.setCaller( caller->engine() );
58 m3.setCaller( caller->engine() );
59 m4.setCaller( caller->engine() );
61 BOOST_CHECK_EQUAL( -1.0, m0() );
62 BOOST_CHECK_EQUAL( -2.0, m1(1) );
63 BOOST_CHECK_EQUAL( -3.0, m2(1, 2.0) );
64 BOOST_CHECK_EQUAL( -4.0, m3(1, 2.0,
true) );
65 BOOST_CHECK_EQUAL( -5.0, m4(1, 2.0,
true,
"hello") );
73 o0 = tc->provides(
"methods");
78 BOOST_REQUIRE( tc->isRunning() );
80 BOOST_REQUIRE( o0.
ready() );
81 BOOST_REQUIRE( o1.ready() );
82 BOOST_REQUIRE( o2.ready() );
83 BOOST_REQUIRE( o3.ready() );
85 BOOST_CHECK_EQUAL( -1.0, o0() );
86 BOOST_CHECK_EQUAL( -2.0, o1(1) );
87 BOOST_CHECK_EQUAL( -3.0, o2(1, 2.0) );
88 BOOST_CHECK_EQUAL( -4.0, o3(1, 2.0,
true) );
104 o1.setCaller( caller->engine() );
105 o2.setCaller( caller->engine() );
106 o3.setCaller( caller->engine() );
110 sh2 = o2.send(1,2.0);
111 sh3 = o3.send(1,2.0,
true);
118 BOOST_REQUIRE( caller->isRunning() );
119 BOOST_CHECK_EQUAL( -1.0, o0() );
120 BOOST_CHECK_EQUAL( -2.0, o1(1) );
121 BOOST_CHECK_EQUAL( -3.0, o2(1, 2.0) );
122 BOOST_CHECK_EQUAL( -4.0, o3(1, 2.0,
true) );
129 m0 = tc->provides(
"methods");
135 BOOST_REQUIRE( tc->isRunning() );
143 BOOST_CHECK_EQUAL(
SendSuccess, h0.collect(retn) );
144 BOOST_CHECK_EQUAL( retn, -1.0 );
146 BOOST_CHECK_EQUAL( retn, -2.0 );
148 BOOST_CHECK_EQUAL( retn, -3.0 );
150 BOOST_CHECK_EQUAL( retn, -4.0 );
152 BOOST_CHECK_EQUAL( retn, -5.0 );
155 BOOST_CHECK_EQUAL(
SendSuccess, h0.collectIfDone(retn) );
156 BOOST_CHECK_EQUAL( retn, -1.0 );
157 BOOST_CHECK_EQUAL(
SendSuccess, h1.collectIfDone(retn) );
158 BOOST_CHECK_EQUAL( retn, -2.0 );
159 BOOST_CHECK_EQUAL(
SendSuccess, h2.collectIfDone(retn) );
160 BOOST_CHECK_EQUAL( retn, -3.0 );
161 BOOST_CHECK_EQUAL(
SendSuccess, h3.collectIfDone(retn) );
162 BOOST_CHECK_EQUAL( retn, -4.0 );
163 BOOST_CHECK_EQUAL(
SendSuccess, h4.collectIfDone(retn) );
164 BOOST_CHECK_EQUAL( retn, -5.0 );
167 BOOST_CHECK_EQUAL( -1.0, h0.ret() );
168 BOOST_CHECK_EQUAL( -2.0, h1.ret(1) );
169 BOOST_CHECK_EQUAL( -3.0, h2.ret(1, 2.0) );
170 BOOST_CHECK_EQUAL( -4.0, h3.ret(1, 2.0,
true) );
171 BOOST_CHECK_EQUAL( -5.0, h4.ret(1, 2.0,
true,
"hello") );
172 BOOST_CHECK_EQUAL( -2.0, h1.ret() );
173 BOOST_CHECK_EQUAL( -3.0, h2.ret() );
174 BOOST_CHECK_EQUAL( -4.0, h3.ret() );
175 BOOST_CHECK_EQUAL( -5.0, h4.ret() );
179 m1.setCaller( caller->engine() );
180 m2.setCaller( caller->engine() );
181 m3.setCaller( caller->engine() );
182 m4.setCaller( caller->engine() );
184 BOOST_REQUIRE( caller->isRunning() );
185 BOOST_REQUIRE( tc->isRunning() );
188 h2 = m2.send(1, 2.0);
189 h3 = m3.send(1, 2.0,
true);
190 h4 = m4.send(1, 2.0,
true,
"hello");
193 BOOST_CHECK_EQUAL(
SendSuccess, h0.collect(retn) );
194 BOOST_CHECK_EQUAL( retn, -1.0 );
196 BOOST_CHECK_EQUAL( retn, -2.0 );
198 BOOST_CHECK_EQUAL( retn, -3.0 );
200 BOOST_CHECK_EQUAL( retn, -4.0 );
202 BOOST_CHECK_EQUAL( retn, -5.0 );
205 BOOST_CHECK_EQUAL(
SendSuccess, h0.collectIfDone(retn) );
206 BOOST_CHECK_EQUAL( retn, -1.0 );
207 BOOST_CHECK_EQUAL(
SendSuccess, h1.collectIfDone(retn) );
208 BOOST_CHECK_EQUAL( retn, -2.0 );
209 BOOST_CHECK_EQUAL(
SendSuccess, h2.collectIfDone(retn) );
210 BOOST_CHECK_EQUAL( retn, -3.0 );
211 BOOST_CHECK_EQUAL(
SendSuccess, h3.collectIfDone(retn) );
212 BOOST_CHECK_EQUAL( retn, -4.0 );
213 BOOST_CHECK_EQUAL(
SendSuccess, h4.collectIfDone(retn) );
214 BOOST_CHECK_EQUAL( retn, -5.0 );
217 BOOST_CHECK_EQUAL( -1.0, h0.ret() );
218 BOOST_CHECK_EQUAL( -2.0, h1.ret(1) );
219 BOOST_CHECK_EQUAL( -3.0, h2.ret(1, 2.0) );
220 BOOST_CHECK_EQUAL( -4.0, h3.ret(1, 2.0,
true) );
221 BOOST_CHECK_EQUAL( -5.0, h4.ret(1, 2.0,
true,
"hello") );
222 BOOST_CHECK_EQUAL( -2.0, h1.ret() );
223 BOOST_CHECK_EQUAL( -3.0, h2.ret() );
224 BOOST_CHECK_EQUAL( -4.0, h3.ret() );
225 BOOST_CHECK_EQUAL( -5.0, h4.ret() );
232 m0 = tc->provides(
"methods");
238 BOOST_REQUIRE( tc->isRunning() );
246 BOOST_CHECK_EQUAL(
SendSuccess, h0.collect(retn) );
247 BOOST_CHECK_EQUAL( retn, -1.0 );
249 BOOST_CHECK_EQUAL( retn, -2.0 );
251 BOOST_CHECK_EQUAL( retn, -3.0 );
253 BOOST_CHECK_EQUAL( retn, -4.0 );
255 BOOST_CHECK_EQUAL( retn, -5.0 );
258 BOOST_CHECK_EQUAL(
SendSuccess, h0.collectIfDone(retn) );
259 BOOST_CHECK_EQUAL( retn, -1.0 );
260 BOOST_CHECK_EQUAL(
SendSuccess, h1.collectIfDone(retn) );
261 BOOST_CHECK_EQUAL( retn, -2.0 );
262 BOOST_CHECK_EQUAL(
SendSuccess, h2.collectIfDone(retn) );
263 BOOST_CHECK_EQUAL( retn, -3.0 );
264 BOOST_CHECK_EQUAL(
SendSuccess, h3.collectIfDone(retn) );
265 BOOST_CHECK_EQUAL( retn, -4.0 );
266 BOOST_CHECK_EQUAL(
SendSuccess, h4.collectIfDone(retn) );
267 BOOST_CHECK_EQUAL( retn, -5.0 );
270 BOOST_CHECK_EQUAL( -1.0, h0.ret() );
271 BOOST_CHECK_EQUAL( -2.0, h1.ret(1) );
272 BOOST_CHECK_EQUAL( -3.0, h2.ret(1, 2.0) );
273 BOOST_CHECK_EQUAL( -4.0, h3.ret(1, 2.0,
true) );
274 BOOST_CHECK_EQUAL( -5.0, h4.ret(1, 2.0,
true,
"hello") );
275 BOOST_CHECK_EQUAL( -2.0, h1.ret() );
276 BOOST_CHECK_EQUAL( -3.0, h2.ret() );
277 BOOST_CHECK_EQUAL( -4.0, h3.ret() );
278 BOOST_CHECK_EQUAL( -5.0, h4.ret() );
282 m1.setCaller( caller->engine() );
283 m2.setCaller( caller->engine() );
284 m3.setCaller( caller->engine() );
285 m4.setCaller( caller->engine() );
287 BOOST_REQUIRE( caller->isRunning() );
288 BOOST_REQUIRE( tc->isRunning() );
291 h2 = m2.send(1, 2.0);
292 h3 = m3.send(1, 2.0,
true);
293 h4 = m4.send(1, 2.0,
true,
"hello");
296 BOOST_CHECK_EQUAL(
SendSuccess, h0.collect(retn) );
297 BOOST_CHECK_EQUAL( retn, -1.0 );
299 BOOST_CHECK_EQUAL( retn, -2.0 );
301 BOOST_CHECK_EQUAL( retn, -3.0 );
303 BOOST_CHECK_EQUAL( retn, -4.0 );
305 BOOST_CHECK_EQUAL( retn, -5.0 );
308 BOOST_CHECK_EQUAL(
SendSuccess, h0.collectIfDone(retn) );
309 BOOST_CHECK_EQUAL( retn, -1.0 );
310 BOOST_CHECK_EQUAL(
SendSuccess, h1.collectIfDone(retn) );
311 BOOST_CHECK_EQUAL( retn, -2.0 );
312 BOOST_CHECK_EQUAL(
SendSuccess, h2.collectIfDone(retn) );
313 BOOST_CHECK_EQUAL( retn, -3.0 );
314 BOOST_CHECK_EQUAL(
SendSuccess, h3.collectIfDone(retn) );
315 BOOST_CHECK_EQUAL( retn, -4.0 );
316 BOOST_CHECK_EQUAL(
SendSuccess, h4.collectIfDone(retn) );
317 BOOST_CHECK_EQUAL( retn, -5.0 );
320 BOOST_CHECK_EQUAL( -1.0, h0.ret() );
321 BOOST_CHECK_EQUAL( -2.0, h1.ret(1) );
322 BOOST_CHECK_EQUAL( -3.0, h2.ret(1, 2.0) );
323 BOOST_CHECK_EQUAL( -4.0, h3.ret(1, 2.0,
true) );
324 BOOST_CHECK_EQUAL( -5.0, h4.ret(1, 2.0,
true,
"hello") );
325 BOOST_CHECK_EQUAL( -2.0, h1.ret() );
326 BOOST_CHECK_EQUAL( -3.0, h2.ret() );
327 BOOST_CHECK_EQUAL( -4.0, h3.ret() );
328 BOOST_CHECK_EQUAL( -5.0, h4.ret() );
338 tc->provides(
"methods")->setOperationThread(
"o0",
ClientThread);
339 m0 = tc->provides(
"methods");
341 BOOST_REQUIRE( tc->isRunning() );
345 BOOST_CHECK_EQUAL(
SendSuccess, h0.collect(retn) );
346 BOOST_CHECK_EQUAL( retn, -1.0 );
349 tc->provides(
"methods")->setOperationThread(
"o0",
OwnThread);
350 m0 = tc->provides(
"methods");
352 BOOST_REQUIRE( tc->isRunning() );
356 BOOST_CHECK_EQUAL(
SendSuccess, h0.collect(retn) );
357 BOOST_CHECK_EQUAL( retn, -1.0 );
#define BOOST_FIXTURE_TEST_SUITE(suite_name, F)
BOOST_AUTO_TEST_CASE(testClientThreadCall)
#define BOOST_AUTO_TEST_SUITE_END()
void setCaller(ExecutionEngine *caller)
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.
basic_ostreams & endl(basic_ostreams &s)
SendStatus collect() const