program_test.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  tag: Peter Soetens Mon Jan 10 15:59:51 CET 2005 program_test.cpp
3 
4  program_test.cpp - description
5  -------------------
6  begin : Mon January 10 2005
7  copyright : (C) 2005 Peter Soetens
8  email : peter.soetens@mech.kuleuven.ac.be
9 
10  ***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 
20 #include "unit.hpp"
21 
22 #include <iostream>
23 #include <sstream>
24 #include <string>
25 
26 #include <scripting/Parser.hpp>
31 #include <Service.hpp>
32 
33 #include <TaskContext.hpp>
34 #include <OperationCaller.hpp>
35 #include "operations_fixture.hpp"
36 
37 using namespace RTT;
38 using namespace RTT::detail;
39 using namespace std;
40 
41 
42 
44 {
45 public:
46  Parser parser;
48  int var_i;
49  int const_i;
51 
52  void doProgram( const std::string& prog, TaskContext*, bool test=true );
53  void finishProgram( TaskContext* , std::string );
54  void loopProgram( ProgramInterfacePtr );
55 
57  : parser(tc->engine()), sa( ScriptingService::Create(tc) )
58  {
59  tc->stop();
60  BOOST_REQUIRE( tc->setActivity(new SimulationActivity(0.01)) );
61  BOOST_REQUIRE( tc->start() );
62  tc->provides()->addService( sa );
63  tc->provides()->addAttribute("tvar_i", var_i);
64  tc->provides()->addAttribute("tss", tss);
65  tc->provides()->addConstant("tconst_i", const_i);
66  // ltc has a test object
67 
68  const_i = -1;
69  var_i = -1;
70  i = 0;
71  tss = SendNotReady;
73  }
74 
76  {
77  }
78 
79 };
80 
81 BOOST_FIXTURE_TEST_SUITE( ProgramTestSuite, ProgramTest )
82 // Registers the fixture into the 'registry'
83 
84 BOOST_AUTO_TEST_CASE(testEmptyProgram)
85 {
86  string prog = "";
87  Parser::ParsedPrograms pg_list;
88  try {
89  pg_list = parser.parseProgram( prog, tc );
90  }
91  catch( const file_parse_exception& /*exc*/ )
92  {
93  BOOST_CHECK( false );
94  }
95  if ( !pg_list.empty() )
96  {
97  BOOST_CHECK( false );
98  }
99 }
100 
101 BOOST_AUTO_TEST_CASE(testReturnProgram)
102 {
103  string prog = "program x { return \n }";
104  this->doProgram( prog, tc );
105  this->finishProgram( tc, "x");
106 }
107 
108 // check that loading a faulty program causes an exception
109 // and that the program is not present as a service in tc
110 BOOST_AUTO_TEST_CASE(testProgramError)
111 {
112  string prog = "program x { not_exist = 10\n }";
113  Parser::ParsedPrograms pg_list;
114  BOOST_CHECK_THROW(pg_list = parser.parseProgram( prog, tc ),file_parse_exception);
115  BOOST_CHECK( pg_list.empty() );
116  BOOST_REQUIRE( tc->provides()->hasService("x") == false);
117 
118  BOOST_CHECK( sa->runScript(prog) == false);
119  BOOST_REQUIRE( tc->provides()->hasService("x") == false);
120 }
121 
122 // same as above, but with runScript
123 BOOST_AUTO_TEST_CASE(testrunScriptError)
124 {
125  string prog = "tvar_i = 33\n program x { not_exist = 10\n } \n tvar_i = 66\n";
126  BOOST_CHECK( sa->eval(prog) == false);
127  BOOST_CHECK_EQUAL( var_i, 33 );
128  BOOST_REQUIRE( tc->provides()->hasService("x") == false);
129 }
130 
131 // tests if the text is properly saved
132 BOOST_AUTO_TEST_CASE(test_getProgramText)
133 {
134  // a program which should never fail
135  // test this methods.
136  string prog = string("/** This is the test_getProgramText to parse */\nprogram x { \n")
137  + " true\n"
138  + "}";
139 
140  this->doProgram( prog, tc );
141  BOOST_CHECK_EQUAL( sa->getProgramText("x"), prog );
142  this->finishProgram( tc, "x");
143 }
144 
145 // tests if the text is properly saved in runScript
146 BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(test_getProgramText_runScript, 1)
147 BOOST_AUTO_TEST_CASE(test_getProgramText_runScript)
148 {
149  // a program which should never fail
150  // test this methods.
151  string prog = string("/** This is the test_getProgramText_runScript to parse */\nprogram x { \n")
152  + " true\n"
153  + "}\n";
154 
155  string evaled = string("tvar_i = 33\n") + prog + "tvar_i = 66\n";
156 
157  BOOST_CHECK( sa->eval(evaled) == true);
158  BOOST_CHECK_EQUAL( sa->getProgramText("x"), evaled + "\n" );
159 }
160 
161 BOOST_AUTO_TEST_CASE(testParseProgram)
162 {
163  // a program which should never fail
164  // test this methods.
165  string prog = string("program x { \n")
166  + " do true\n"
167  + " do test.assert( true )\n"
168  + " do test.increase()\n"
169  + " do test.resetI()\n"
170  + " do test.assert( test.isTrue( true ) )\n"
171  + " do test.assert( test.i == 0 )\n"
172  + " do test.increase()\n"
173  + " do test.assert( test.i == 1 )\n"
174  + " do test.resetI()\n"
175  + " do test.assert( test.i == 0 )\n"
176  + " if test.increase() + test.increase() + test.increase() != 6 then \n "
177  + " do test.assert( false )\n"
178  + " do test.assert( test.isTrue( true ) )\n"
179  + " do test.resetI()\n"
180  + " do test.assert( test.i == 0 )\n"
181  + " if test.increase() + test.increase() + test.increase() != 6 then \n "
182  + " do test.assert( false )\n"
183  + " if true then\n"
184  + " return\n"
185  + " do test.assert(false)" // do not reach
186  + "}";
187 
188  this->doProgram( prog, tc );
189  this->finishProgram( tc, "x");
190 }
191 
192 BOOST_AUTO_TEST_CASE(testProgramFailure)
193 {
194  //also small test for program without newlines
195  string prog = string("program x { do test.fail();}");
196 
197  this->doProgram( prog, tc, false );
198 
199  BOOST_CHECK( sa->getProgramStatus("x") == ProgramInterface::Status::error );
200 
201  this->finishProgram( tc, "x");
202 }
203 BOOST_AUTO_TEST_CASE(testProgramCondition)
204 {
205  // see if checking a remote condition works
206  string prog = string("program x { \n")
207  + "if test.isTrue(true) then \n"
208  + " do test.good() \n"
209  + "else \n"
210  + " do test.fail() \n"
211  + "if test.isTrue(false) then \n"
212  + " do test.fail() \n"
213  + "else \n"
214  + " do test.good() \n"
215  + "if test.isTrue(true) then \n" //10
216  + " if test.isTrue(true) then \n"
217  + " if test.isTrue(false) then \n"
218  + " do test.fail() \n"
219  + " else \n"
220  + " if test.isTrue(false) then \n"
221  + " do test.fail() \n"
222  + " else \n"
223  + " do test.good() \n"
224  + " else \n"
225  + " do test.fail() \n" //20
226  + "else \n"
227  + " do test.fail() \n"
228  + "var bool trig = false \n"
229  + "do test.resetI()\n"
230  + "while test.increase() != 100 && !trig \n"
231  + " if test.i == 50 then \n"
232  + " set trig = true \n"
233  + "if test.i != 51 then \n" // the test.increase() will first increment i to 51, and then we detect trig.
234  + " do test.fail() \n"
235  + "do test.resetI()\n" //30
236  + "set trig = false\n"
237  + "for (var int j = 0; j != 100 && !trig ; set j = test.increase() )\n"
238  + " if j == 50 then \n"
239  + " set trig = true \n"
240 // + "if test.i != 51 then \n" // require same result as with ISO C
241 // + " do test.fail() \n"
242  + "return "
243  + "}";
244  this->doProgram( prog, tc );
245  this->finishProgram( tc, "x");
246 }
247 
248 BOOST_AUTO_TEST_CASE(testProgramBreak)
249 {
250  // see if break statement works
251  string prog = string("program x { \n")
252  + "do test.resetI()\n"
253  + "while (test.increase() != 100)\n"
254  + " if test.i == 50 then {\n"
255  + " break\n"
256  + " do test.fail() \n" // do not reach.
257  + " }\n"
258  + "if test.i != 50 then \n" // break on 50
259  + " do test.fail() \n"
260  + "do test.resetI()\n"
261  + "for (var int j = 0; j != 100 ; set j = test.increase() )\n"
262  + " if j != 50 then \n"
263  + " do nothing \n"
264  + " else {\n"
265  + " break \n"
266  + " do test.fail() \n" // do not reach.
267  + " }\n"
268  + "if test.i != 50 then \n" // break on 50
269  + " do test.fail() \n"
270  + "do test.resetI()\n"
271  + "while test.increase() != 100 {\n"
272  + " while test.increase() != 100 \n"
273  + " if test.i == 50 then {\n"
274  + " break \n"
275  + " do test.fail() \n" // do not reach.
276  + " }\n"
277  + " if test.i != 50 then \n" // break on 50
278  + " do test.fail() \n"
279  + " if test.i == 50 then \n"
280  + " break \n"
281  + " do test.fail() \n" // do not reach.
282  + " }\n"
283  + "if test.i != 50 then \n" // break on 50
284  + " do test.fail() \n"
285  + "return \n"
286  + "}";
287  this->doProgram( prog, tc );
288  this->finishProgram( tc, "x");
289 }
290 
291 BOOST_AUTO_TEST_CASE(testProgramLoops)
292 {
293  // see if (nested) loop statements work
294  string prog = string("program x { \n")
295  + "do test.resetI()\n"
296  // single while loop
297  + "while (test.increase() != 100) {\n"
298  + "}\n"
299  + "if test.i != 100 then \n"
300  + " do test.fail() \n"
301  + "do test.resetI()\n"
302  // double while loop
303  + "while (test.increase() != 200) {\n"
304  + " while (test.i < 100) {\n"
305  + " test.increase()\n"
306  + " }\n"
307  + " if test.i < 100 then \n"
308  + " do test.fail() \n"
309  + "}\n"
310  + "if test.i != 200 then \n"
311  + " do test.fail() \n"
312  + "do test.resetI()\n"
313  // single for loop
314  + "for (var int j = 0; j != 100 ; j = test.increase() ) {\n"
315  + "}\n"
316  + "if test.i != 100 then \n" // 20
317  + " do test.fail() \n"
318  + "if j != 100 then \n"
319  + " do test.fail() \n"
320  + "do test.resetI()\n"
321  // double for loop
322  + "for ( j = 0; j != 100 ; j = test.increase() ) {\n"
323  + " for (var int j2 = 0; j2 != 100 ; j2 = j2 + 1 ) {\n"
324  + " }\n"
325  + " if j2 != 100 then \n"
326  + " do test.fail() \n"
327  + "}\n"
328  + "if test.i != 100 then \n"
329  + " do test.fail() \n"
330  + "if j != 100 then \n"
331  + " do test.fail() \n"
332  + "if j2 != 100 then \n"
333  + " do test.fail() \n"
334  + "do test.resetI()\n"
335  // for loop in while loop
336  + "while (test.increase() != 200) {\n"
337  + " for (var int j3 = 0; j3 != 100 ; j3 = j3 + 1 ) {\n"
338  + " }\n" // 40
339  + "}\n"
340  + "if test.i != 200 then \n"
341  + " do test.fail() \n"
342  + "if j3 != 100 then \n"
343  + " do test.fail() \n"
344  + "do test.resetI()\n"
345  // for loop in while loop + break in for
346  + "while (test.increase() != 200) {\n"
347  + " for (var int j3b = 0; j3b != 100 ; j3b = j3b + 1 ) {\n"
348  + " if j3b == 50 then break \n"
349  + " }\n"
350  + " if j3b != 50 then \n"
351  + " do test.fail() \n"
352  + "}\n"
353  + "if test.i != 200 then \n"
354  + " do test.fail() \n"
355  + "if j3b != 50 then \n"
356  + " do test.fail() \n"
357  + "do test.resetI()\n"
358  // while loop in for loop
359  + "for (var int j4 = 0; j4 != 100 ; j4 = j4 + 1 ) {\n"
360  + " test.resetI()\n" // 60
361  + " while (test.increase() != 200) {\n"
362  + " }\n"
363  + "}\n"
364  + "if test.i != 200 then \n"
365  + " do test.fail() \n"
366  + "if j4 != 100 then \n"
367  + " do test.fail() \n"
368  + "do test.resetI()\n"
369  // while loop in for loop + break in while
370  + "for (var int j5 = 0; j5 != 100 ; j5 = j5 + 1 ) {\n"
371  + " test.resetI()\n"
372  + " while (test.increase() != 200) {\n"
373  + " if test.i == 50 then break \n"
374  + " }\n"
375  + " if test.i != 50 then test.fail() \n"
376  + "}\n"
377  + "if test.i != 50 then \n"
378  + " do test.fail() \n"
379  + "if j5 != 100 then {\n"
380  + " do test.print(\" j5 is:\" + j5 ) \n"
381  + " do test.fail() \n" // 80
382  + " }\n"
383  + "do test.resetI()\n"
384  + "}";
385  this->doProgram( prog, tc );
386  this->finishProgram( tc, "x");
387 }
388 
389 BOOST_AUTO_TEST_CASE(testProgramAnd)
390 {
391  // see if checking a remote condition works
392  string prog = string("program x { do test.good()\n")
393  + " && test.good() \n"
394  + " && test.good() \n"
395  + " }";
396  this->doProgram( prog, tc );
397  this->finishProgram( tc, "x");
398 }
399 
400 BOOST_AUTO_TEST_CASE(testProgramTry)
401 {
402  // see if checking a remote condition works
403  string prog = string("program progtry { try test.fail()\n")
404  + "try test.good() \n"
405  + " && test.fail() \n"
406  + " && test.good() \n"
407  + "try test.good() \n"
408  + " && test.fail() \n"
409  + "try test.good() \n"
410  + " && test.fail() \n"
411  + " && test.fail() catch { \n"
412  + " try test.good() \n"
413  + " && test.good() \n"
414  + " && test.good() catch {\n"
415  + " do test.fail()\n"
416  + " }\n"
417  + "}\n"
418  + "do test.resetI() \n"
419  + "try test.good() \n"
420  + " && test.fail() \n"
421  + " && test.good() catch { \n"
422  + " do test.increase()\n"
423  + "}\n"
424  + "if test.i == 0 then\n" // check if catch was reached
425  + " do test.fail()\n"
426  + "}";
427  this->doProgram( prog, tc );
428  this->finishProgram( tc, "progtry");
429 }
430 
431 BOOST_AUTO_TEST_CASE(testProgramToProgram)
432 {
433  // test a program which starts/stops another program.
434  string prog = string("program y { do test.good() \n")
435  + " do test.resetI()\n"
436  + " do test.assert( test.i == 0 )\n"
437  + "}";
438 
439  string prog2 = string("program x {\n")
440  + " do test.assert( test.i == 0 )\n"
441  + " do test.increase()\n"
442  + " do test.assert( test.i == 1 )\n"
443  + " do y.start()\n" // test start-stop
444  + " do yield\n"
445  + " do test.assert( test.i == 0 )\n"
446  + " do y.stop()\n"
447  + " do test.increase()\n"
448  + " do y.pause()\n" // test pause-step // 10
449  + " do yield\n"
450  + " do test.assert( y.isPaused() )\n"
451  + " do test.assert( test.i == 1 )\n"
452  + " do y.step()\n"
453  + " do yield\n"
454  + " do test.assert( test.i == 1 )\n"
455  + " do y.step()\n"
456  + " do yield\n"
457  + " do test.assertEqual( test.i, 0 )\n" // if this fails, stepping is broken
458  + " do y.step()\n"
459  + " do yield\n"
460  + " do y.step()\n" // 20
461  + " do yield\n"
462  + " do test.assert( !y.isRunning() )\n"
463  + "}";
464 
465  this->doProgram( prog, tc );
466  this->doProgram( prog2, tc );
467  this->finishProgram( tc, "x");
468  this->finishProgram( tc, "y");
469 }
470 
471 BOOST_AUTO_TEST_CASE(testProgramCallFoo)
472 {
473  // see if modifying an attribute works.
474  string prog = string("export function foo {\n")
475  + " do test.assert( tvar_i == +2 ) \n"
476  + " do test.assert( tvar_i != tconst_i ) \n"
477  + " set tvar_i = +4\n"
478  + " do test.assert( tvar_i == +4 ) \n"
479  + "}\n"
480  + "program x { \n"
481  + "do test.assert( tvar_i == -1 ) \n"
482  + "do test.assert( tvar_i == tconst_i ) \n"
483  + "set tvar_i = +2\n"
484  + "do test.assert( tvar_i == +2 )\n"
485  + "call foo()\n"
486  + "do test.assert( tvar_i == +4 ) \n"
487  + "}";
488  this->doProgram( prog, tc );
489  BOOST_REQUIRE_EQUAL( 4, var_i );
490  this->finishProgram( tc, "x");
491 }
492 
493 BOOST_AUTO_TEST_CASE(testProgramSendFoo)
494 {
495  // see if modifying an attribute works.
496  string prog = string("export function foo(int arg) {\n")
497  + " do test.assert( tvar_i == arg ) \n"
498  + " do test.assert( tvar_i != tconst_i ) \n"
499  + " set tvar_i = tvar_i+2\n"
500  + " do test.assert( tvar_i == arg + 2 ) \n"
501  + "}\n"
502  + "program x { \n"
503  + "do test.assert( tvar_i == -1 ) \n"
504  + "do test.assert( tvar_i == tconst_i ) \n"
505  + "set tvar_i = +2\n" // 10
506  + "var SendHandle sh\n"
507  + "sh = foo.send(tvar_i)\n"
508  + "while(sh.collectIfDone() != SendSuccess)\n"
509  + " yield\n"
510  + "do test.assert( sh.collectIfDone() == SendSuccess )\n"
511  + "do test.assert( tvar_i == +4 )\n"
512 
513  // test parallel send
514  + "var SendHandle sh1, sh2\n"
515  + "sh1 = foo.send(tvar_i)\n"
516  + "sh2 = foo.send(tvar_i + 2)\n"
517  + "while(sh2.collectIfDone() != SendSuccess)\n"
518  + " yield\n"
519  + "do test.assert( tvar_i == +8 )\n"
520  + "do test.assert( sh1.collectIfDone() == SendSuccess )\n"
521  + "do test.assert( sh2.collectIfDone() == SendSuccess )\n"
522  + "do test.assert( tvar_i == +8 )\n"
523  + "}";
524  this->doProgram( prog, tc );
525  BOOST_REQUIRE_EQUAL( 8, var_i );
526  this->finishProgram( tc, "x");
527 }
528 
529 BOOST_AUTO_TEST_CASE(testProgramCmdFoo)
530 {
531  // see if modifying an attribute works.
532  string prog = string("export function foo(int arg) {\n")
533  + " do test.assert( tvar_i == arg ) \n"
534  + " do test.assert( tvar_i != tconst_i ) \n"
535  + " set tvar_i = tvar_i+2\n"
536  + " do test.assert( tvar_i == arg + 2 ) \n"
537  + "}\n"
538  + "program x { \n"
539  + "do test.assert( tvar_i == -1 ) \n"
540  + "do test.assert( tvar_i == tconst_i ) \n"
541  + "set tvar_i = +2\n" // 10
542  + "while (tvar_i != +6) {\n"
543  + " tss = foo.cmd(tvar_i)\n"
544  + " do test.assert( tss == SendSuccess )\n"
545  + "}\n"
546  + "do test.assert( tvar_i == +6 )\n"
547  + "tss = foo.cmd(tvar_i)\n"
548  + "do test.assert( tvar_i == +8 )\n"
549  + "do test.assert( tss == SendSuccess )\n"
550  + "}";
551  this->doProgram( prog, tc );
552  BOOST_REQUIRE_EQUAL( 8, var_i );
553  this->finishProgram( tc, "x");
554 }
555 
557 {
558  // see if modifying an attribute works.
559  string prog = string("")
560  + "program x { \n"
561  + "test.assertEqual( test.i, 0 )\n"
562  + "test.increaseCmd.send() \n"
563  + "yield \n"
564  + "test.assertEqual( test.i, 1 )\n"
565  + "yield \n" // make sure that increaseCmd is not evaluated twice!
566  + "test.assertEqual( test.i, 1 )\n"
567 
568  + "var SendHandle sh\n"
569  + "set sh = test.increaseCmd.send()\n"
570  + "test.assertEqual( test.i, 1 )\n" // not yet send
571  + "var int r = 0\n"
572  //+ "sh.collect(r)\n" // hangs
573  + "while (sh.collectIfDone(r) != SendSuccess)\n"
574  + " yield \n"
575  + "test.assertEqual( r , 2 )\n"
576  + "test.assertEqual( test.i, 2 )\n"
577 
578  + "set sh = test.increaseCmd.send()\n"
579  //+ "sh.collect(tvar_i)\n" // hangs
580  + "while (sh.collectIfDone(tvar_i) != SendSuccess)\n"
581  + " yield \n"
582  + "test.assertEqual( tvar_i, 3 )\n" // i is 3 but r isn't.
583  + "}";
584  this->doProgram( prog, tc );
585  BOOST_REQUIRE_EQUAL( i, 3 );
586  BOOST_REQUIRE_EQUAL( var_i, 3 );
587  this->finishProgram( tc, "x");
588 }
589 
591 {
592  // see if modifying an attribute works.
593  string prog = string("")
594  + "program x { \n"
595  + "test.assertEqual( test.i, 0 )\n"
596  + "var SendStatus ss\n"
597  + "tss = test.increaseCmd.cmd() \n"
598  + "test.assert( tss == SendSuccess )\n"
599  + "test.assertEqual( test.i, 1 )\n"
600  + "ss = test.increaseCmd.cmd()\n"
601  + "test.assert( ss == SendSuccess )\n"
602  + "test.assertEqual( test.i , 2 )\n"
603 
604  + "tss = methods.vo0.cmd() \n"
605  + "test.assert( tss == SendSuccess )\n"
606  + "ss = methods.vo0.cmd()\n"
607  + "test.assert( ss == SendSuccess )\n"
608  + "}";
609  this->doProgram( prog, tc );
610  BOOST_REQUIRE( tss == SendSuccess );
611  BOOST_CHECK_EQUAL( i, 2 );
612  this->finishProgram( tc, "x");
613 }
614 
616 
617 void ProgramTest::doProgram( const std::string& prog, TaskContext* tc, bool test )
618 {
619  BOOST_CHECK( tc->engine() );
620 
621  Parser::ParsedPrograms pg_list;
622  try {
623  pg_list = parser.parseProgram( prog, tc );
624  }
625  catch( const file_parse_exception& exc )
626  {
627  BOOST_REQUIRE_MESSAGE( false, exc.what() );
628  }
629  if ( pg_list.empty() )
630  {
631  BOOST_REQUIRE_MESSAGE( false, "No program could be found by the parser." );
632  }
633  ProgramInterfacePtr pi = *pg_list.begin();
634 
635  sa->loadProgram( pi );
636  BOOST_CHECK( pi->start() );
637  BOOST_CHECK( SimulationThread::Instance()->run(1000) );
638 
639  if (test ) {
640  stringstream errormsg;
641  errormsg << " on line " << pi->getLineNumber() <<"."<<endl;
642  BOOST_REQUIRE_MESSAGE( pi->getStatus() != ProgramInterface::Status::error , "Runtime error encountered" + errormsg.str());
643  BOOST_CHECK_MESSAGE( pi->getStatus() == ProgramInterface::Status::stopped , "Program stalled " + errormsg.str());
644 
645  // Xtra test, only do it if all previous went ok :
646  loopProgram( pi );
647  }
648 }
649 
651 {
652  //std::cerr <<std::endl<< "Looping " << f->getName();
653  // especially handy for performance testing :
654  // This bypasses the processor however, does not
655  // measure its performance.
656  int loops = 100;
657  f->reset();
658  while ( loops-- != 0 ) {
659  while ( !f->isStopped() && !f->inError() )
660  f->execute();
661  f->reset();
662  //std::cerr << ".";
663  }
664 }
665 
666 
667 void ProgramTest::finishProgram(TaskContext* tc, std::string prog_name)
668 {
669  BOOST_REQUIRE( sa->getProgram(prog_name) );
670  BOOST_CHECK( sa->getProgram( prog_name )->stop() );
671  BOOST_CHECK( sa->unloadProgram( prog_name ) );
672 
673 }
const std::string what() const
#define BOOST_FIXTURE_TEST_SUITE(suite_name, F)
boost::shared_ptr< ScriptingService > shared_ptr
void loopProgram(ProgramInterfacePtr)
#define BOOST_AUTO_TEST_SUITE_END()
SendStatus tss
Definition: mystd.hpp:163
void finishProgram(TaskContext *, std::string)
ScriptingService::shared_ptr sa
boost::shared_ptr< ProgramInterface > ProgramInterfacePtr
SendStatus
Definition: SendStatus.hpp:53
static SimulationThreadPtr Instance(double period=0.001)
#define BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES(test_name, n)
std::vector< ProgramInterfacePtr > ParsedPrograms
Definition: Parser.hpp:101
BOOST_AUTO_TEST_CASE(testEmptyProgram)
basic_ostreams & endl(basic_ostreams &s)
Definition: rtstreams.cpp:110
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:53
A SimulationActivity is a PeriodicActivity which is used for simulation.


rtt
Author(s): RTT Developers
autogenerated on Tue Jun 25 2019 19:33:26