-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdispatch_test.hpp
88 lines (71 loc) · 2.83 KB
/
dispatch_test.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/***************************************************************************
tag: Peter Soetens Mon Jan 10 15:59:18 CET 2005 dispatch_test.hpp
dispatch_test.hpp - description
-------------------
begin : Mon January 10 2005
copyright : (C) 2005 Peter Soetens
email : [email protected]
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef DISPATCHTEST_H
#define DISPATCHTEST_H
#include <cppunit/extensions/HelperMacros.h>
#include <execution/Parser.hpp>
#include <execution/CommandProcessor.hpp>
#include <execution/TaskContext.hpp>
#include <execution/Factories.hpp>
#include <string>
#include <corelib/TaskSimulation.hpp>
using namespace ORO_CoreLib;
using namespace ORO_Execution;
class DispatchTest : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( DispatchTest );
CPPUNIT_TEST( testParseDispatch );
CPPUNIT_TEST( testDispatchFailure );
CPPUNIT_TEST( testDispatchCondition );
CPPUNIT_TEST( testDispatchAnd );
CPPUNIT_TEST( testDispatchTry );
CPPUNIT_TEST( testDispatchUntil );
CPPUNIT_TEST( testDispatchUntilFail );
CPPUNIT_TEST_SUITE_END();
//CPPUNIT_TEST( testSendDispatch );
Parser parser;
TaskContext gtc;
TaskContext mtc;
TaskContext ltc;
TaskSimulation gtask;
TaskSimulation mtask;
TaskSimulation ltask;
MethodFactoryInterface* createMethodFactory();
CommandFactoryInterface* createCommandFactory();
DataSourceFactoryInterface* createDataSourceFactory();
bool true_genCom() { return true; }
bool false_genCom() { return false; }
bool true_gen() const { return true; }
bool false_gen() const { return false; }
bool bool_gen( bool b ) const { return b; }
bool assertBool( bool );
bool assertMsg( bool, const std::string& msg);
void doDispatch( const std::string& prog, TaskContext* );
void finishDispatch( TaskContext* , std::string );
public:
DispatchTest();
void setUp();
void tearDown();
void testParseDispatch();
void testDispatchCondition();
void testSendDispatch();
void testDispatchFailure();
void testDispatchAnd();
void testDispatchTry();
void testDispatchUntil();
void testDispatchUntilFail();
};
#endif