$search
00001 /*************************************************************************** 00002 tag: Peter Soetens Mon Jan 10 15:59:18 CET 2005 dispatch_test.hpp 00003 00004 dispatch_test.hpp - description 00005 ------------------- 00006 begin : Mon January 10 2005 00007 copyright : (C) 2005 Peter Soetens 00008 email : peter.soetens@mech.kuleuven.ac.be 00009 00010 *************************************************************************** 00011 * * 00012 * This program is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU General Public License as published by * 00014 * the Free Software Foundation; either version 2 of the License, or * 00015 * (at your option) any later version. * 00016 * * 00017 ***************************************************************************/ 00018 00019 00020 #ifndef DISPATCHTEST_H 00021 #define DISPATCHTEST_H 00022 00023 #include <scripting/Parser.hpp> 00024 #include <internal/CommandProcessor.hpp> 00025 #include <TaskContext.hpp> 00026 #include <string> 00027 #include <extras/SimulationActivity.hpp> 00028 00029 using namespace RTT; 00030 using namespace RTT::detail; 00031 00032 class DispatchTest 00033 { 00034 public: 00035 Parser parser; 00036 TaskContext gtc; 00037 TaskContext mtc; 00038 TaskContext ltc; 00039 00040 Service* createObject(std::string a, CommandProcessor* cp); 00041 00042 bool true_genCom() { return true; } 00043 bool false_genCom() { return false; } 00044 bool true_gen() const { return true; } 00045 bool false_gen() const { return false; } 00046 00047 bool bool_gen( bool b ) const { return b; } 00048 00049 bool assertBool( bool ); 00050 bool assertMsg( bool, const std::string& msg); 00051 void doDispatch( const std::string& prog, TaskContext* ); 00052 void finishDispatch( TaskContext* , std::string ); 00053 public: 00054 DispatchTest(); 00055 ~DispatchTest(){ tearDown();}; 00056 00057 void setUp(); 00058 void tearDown(); 00059 00060 void testParseDispatch(); 00061 void testDispatchCondition(); 00062 void testDispatchMany(); 00063 void testDispatchFailure(); 00064 void testDispatchAnd(); 00065 void testDispatchTry(); 00066 void testDispatchUntil(); 00067 void testDispatchUntilFail(); 00068 00069 }; 00070 00071 #endif