generictask_test.hpp
Go to the documentation of this file.
00001 /***************************************************************************
00002   tag: Peter Soetens  Mon Jun 26 13:26:02 CEST 2006  generictask_test.hpp
00003 
00004                         generictask_test.hpp -  description
00005                            -------------------
00006     begin                : Mon June 26 2006
00007     copyright            : (C) 2006 Peter Soetens
00008     email                : peter.soetens@fmtc.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 GENERIC_TASK_H
00021 #define GENERIC_TASK_H
00022 
00023 
00024 #include <TaskContext.hpp>
00025 #include <string>
00026 
00027 using namespace RTT;
00028 using namespace RTT::detail;
00029 
00030 class Generic_TaskTest
00031 {
00032 public:
00033     TaskContext* tc;
00034     ActivityInterface* tsim;
00035     Service* createOperationCallerFactory();
00036 
00037     // ref/const-ref tests:
00038     double ret;
00039     double& m0r() { return ret; }
00040     const double& m0cr() { return ret; }
00041 
00042     // test const std::string& argument for command_ds
00043     bool comstr(const std::string& cs) { return !cs.empty(); }
00044 
00045     double m1r(double& a) { a = 2*a; return a; }
00046     double m1cr(const double& a) { return a; }
00047 
00048     // plain argument tests:
00049     double m0() { return -d0(); }
00050     double m1(int i) { return -d1(i); }
00051     double m2(int i, double d) { return -d2(i,d); }
00052     double m3(int i, double d, bool c) { return -d3(i,d,c); }
00053     double m4(int i, double d, bool c, std::string s) { return -d4(i,d,c,s); }
00054 
00055     double d0() const { return 1.0; }
00056     double d1(int i) const { return 2.0; }
00057     double d2(int i, double d) const { return 3.0; }
00058     double d3(int i, double d, bool c) const { return 4.0; }
00059     double d4(int i, double d, bool c, std::string s) const { return 5.0; }
00060 
00061     bool assertBool( bool );
00062 public:
00063         Generic_TaskTest(){ setUp(); };
00064         ~Generic_TaskTest(){ tearDown(); };
00065 
00066     void setUp();
00067     void tearDown();
00068 
00069     void testOperationCallersC();
00070     void testRemoteOperationCaller();
00071     void testAddOperationCaller();
00072     void testCROperationCaller();
00073     void testOperationCaller();
00074     void testOperationCallerFromDS();
00075     void testOperationCallerFactory();
00076     void testDSOperationCaller();
00077 };
00078 
00079 #endif


rtt
Author(s): RTT Developers
autogenerated on Mon Oct 6 2014 03:13:36