doudou / orocos-rtt forked from psoetens/orocos-rtt

Orocos Real-Time Toolkit

This URL has Read+Write access

Janosch Machowinski (author)
Wed Nov 26 07:50:12 -0800 2008
Sylvain Joyeux (committer)
Fri Dec 19 07:31:38 -0800 2008
orocos-rtt / tests / tasks_test.hpp
100644 103 lines (73 sloc) 2.802 kb
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: Peter Soetens Mon Jan 10 15:59:18 CET 2005 tasks_test.hpp
 
tasks_test.hpp - description
-------------------
begin : Mon January 10 2005
copyright : (C) 2005 Peter Soetens
email : peter.soetens@mech.kuleuven.ac.be
 
***************************************************************************
* *
* 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 TASKSTEST_H
#define TASKSTEST_H
 
#include <cppunit/extensions/HelperMacros.h>
 
#include <RTT.hpp>
#include <PeriodicActivity.hpp>
#include <SimulationActivity.hpp>
#include <NonPeriodicActivity.hpp>
 
using namespace RTT;
using namespace RTT::detail;
 
struct TestRunnableInterface;
struct TestSelfRemove;
 
class ActivitiesTest : public CppUnit::TestFixture
{
    CPPUNIT_TEST_SUITE( ActivitiesTest );
    // Periodic Thread Test :
    CPPUNIT_TEST( testThreads );
 
    // Periodic Overrun Thread Test :
    // Does not work in GNU/Linux nor RAI
    //CPPUNIT_TEST( testOverrun );
 
    // Start - Stop Test :
    CPPUNIT_TEST( testStartStop );
 
    // Runnable Interface Test :
    CPPUNIT_TEST( testRunnableInterface );
    CPPUNIT_TEST( testFailInit );
 
    // Allocation Test : [disabled, kills RTAI/LXRT]
    CPPUNIT_TEST( testAddAllocate );
 
    // Self Removal Test :
    CPPUNIT_TEST( testSelfRemove );
 
    // non periodic Test :
    CPPUNIT_TEST( testNonPeriodic );
 
    CPPUNIT_TEST_SUITE_END();
 
    PeriodicActivity* t_task_prio;
 
    TestRunnableInterface* t_run_int_prio;
    TestRunnableInterface* t_run_int_fail;
 
    RunnableInterface* t_run_allocate;
    TestSelfRemove* t_self_remove;
 
public:
 
    void setUp();
    void tearDown();
 
    void testThreads();
    void testOverrun();
 
    void testStartStop();
    void testStart();
    void testPause();
    void testStop();
 
    void testSelfRemove();
 
    void testNonPeriodic();
 
    void testAllocation();
    void testRemoveAllocate();
    void testAddAllocate();
 
    void testFailInit();
    void testRunnableInterface();
    void testAddRunnableInterface();
    void testRunnableInterfaceInit();
    void testRunnableInterfaceExecution();
    void testRemoveRunnableInterface();
 
};
 
#endif