dev_test.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  tag: Peter Soetens Mon Jan 10 15:59:51 CET 2005 dev_test.cpp
3 
4  dev_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 #include "unit.hpp"
20 
21 #include "dev_test.hpp"
22 #include "FakeAnalogDevice.hpp"
23 #include "FakeDigitalDevice.hpp"
28 
29 
30 #include <iostream>
31 
32 using namespace std;
33 using namespace RTT;
34 
35 void
37 {
38 }
39 
40 
41 void
43 {
44 }
45 
46 BOOST_FIXTURE_TEST_SUITE( DevTestSuite, DevTest )
47 
48 BOOST_AUTO_TEST_CASE( testClasses)
49 {
50  bool din_state = true;
51  DigitalInput din(din_state, false); // init, invert
52  DigitalOutput dout(false); // init.
53  AnalogInput ain(0,0);
54  AnalogOutput aout(0,0);
55 
56 
57  BOOST_CHECK( din.isOn() );
58 
59  BOOST_CHECK( dout.isOn() == false);
60  dout.setBit(true);
61  BOOST_CHECK( dout.isOn() == true);
62  dout.setBit(false);
63  BOOST_CHECK( dout.isOn() == false);
64 }
65 
67 {
68 
69  FakeAnalogDevice fad;
71 
72  AnalogInInterface* aii = AnalogInInterface::nameserver.getObject("FakeAnalogDevice");
73  AnalogOutInterface* aoi = AnalogOutInterface::nameserver.getObject("FakeAnalogDevice");
74 
75  DigitalInInterface* dii = DigitalInInterface::nameserver.getObject("FakeDigitalDevice");
76  DigitalOutInterface* doi = DigitalOutInterface::nameserver.getObject("FakeDigitalDevice");
77 
78  BOOST_CHECK( aii );
79  BOOST_CHECK( aoi );
80  BOOST_CHECK( dii );
81  BOOST_CHECK( doi );
82 
83 }
#define BOOST_FIXTURE_TEST_SUITE(suite_name, F)
void tearDown()
Definition: dev_test.cpp:42
#define BOOST_AUTO_TEST_SUITE_END()
void setBit(bool on_off)
Definition: mystd.hpp:163
BOOST_AUTO_TEST_CASE(testClasses)
Definition: dev_test.cpp:48
void setUp()
Definition: dev_test.cpp:36
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
Definition: Activity.cpp:53


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