-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcorba_test.hpp
103 lines (79 loc) · 2.98 KB
/
corba_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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/***************************************************************************
tag: The SourceWorks Tue Sep 7 00:54:57 CEST 2010 corba_test.hpp
corba_test.hpp - description
-------------------
begin : Tue September 07 2010
copyright : (C) 2010 The SourceWorks
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 CORBA_TEST_H
#define CORBA_TEST_H
#include <transports/corba/corba.h>
#include <rtt/InputPort.hpp>
#include <rtt/OutputPort.hpp>
#include <rtt/TaskContext.hpp>
#include <transports/corba/TaskContextServer.hpp>
#include <transports/corba/TaskContextProxy.hpp>
#include <string>
using namespace RTT;
using namespace RTT::detail;
class CorbaTest
{
public:
CorbaTest() { this->setUp(); }
~CorbaTest() { this->tearDown(); }
TaskContext* tc;
TaskContext* t2;
TaskContext* tp;
corba::TaskContextServer* ts;
TaskContext* tp2;
corba::TaskContextServer* ts2;
Service* createOperationCallerFactory();
base::PortInterface* signalled_port;
void new_data_listener(base::PortInterface* port);
// Ports
InputPort<double>* mi1;
OutputPort<double>* mo1;
InputPort<double>* mi2;
OutputPort<double>* mo2;
// ref/const-ref tests:
double ret;
double& m0r() { return ret; }
const double& m0cr() { return ret; }
// test const std::string& argument for command_ds
bool comstr(const std::string& cs) { return !cs.empty(); }
double m1r(double& a) { a = 2*a; return a; }
double m1cr(const double& a) { return a; }
// plain argument tests:
double m0() { return -1.0; }
double m1(int i) { return -2.0; }
double m2(int i, double d) { return -3.0; }
double m3(int i, double d, bool c) { return -4.0; }
double m4(int i, double d, bool c, std::string s) { return -5.0; }
// void(void) function test:
void vm0(void) { ; }
bool assertBool( bool );
void setupCorba();
void cleanupCorba();
void setUp();
void tearDown();
void testRemoteOperationCallerC();
void testRemoteOperationCaller();
void testAnyOperationCaller();
void testDataFlowInterface();
void testPortConnections();
void testPortProxying();
void testHalfs();
// helper test functions
void testPortDataConnection();
void testPortBufferConnection();
void testPortDisconnected();
};
#endif