public
Fork of psoetens/orocos-rtt
Description: Orocos Real-Time Toolkit
Homepage: www.orocos.org/rtt
Clone URL: git://github.com/doudou/orocos-rtt.git
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 / taskthread_test.hpp
100644 87 lines (65 sloc) 2.485 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
/***************************************************************************
tag: Peter Soetens Tue Apr 5 16:53:26 CEST 2005 taskthread_test.hpp
 
taskthread_test.hpp - description
-------------------
begin : Tue April 05 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 TASKSTHREADTEST_H
#define TASKSTHREADTEST_H
 
#include <cppunit/extensions/HelperMacros.h>
 
#include <PeriodicActivity.hpp>
#include <SimulationActivity.hpp>
#include <SlaveActivity.hpp>
 
using namespace RTT;
 
template<class T>
struct TestActivity;
 
 
/**
* Tests task-thread relationships.
*/
class ActivitiesThreadTest : public CppUnit::TestFixture
{
    CPPUNIT_TEST_SUITE( ActivitiesThreadTest );
    // Configuration Test :
    CPPUNIT_TEST( testThreadConfig );
    CPPUNIT_TEST( testPeriodic );
    CPPUNIT_TEST( testNonPeriodic );
    CPPUNIT_TEST( testSlave );
    CPPUNIT_TEST( testSequential );
    CPPUNIT_TEST( testScheduler );
 
#ifndef ORO_EMBEDDED
    CPPUNIT_TEST( testExceptionRecovery );
#endif
 
    // Allocation Test : [disabled, kills RTAI/LXRT]
    //CPPUNIT_TEST( testAddAllocate );
 
    CPPUNIT_TEST_SUITE_END();
 
    TestActivity<PeriodicActivity>* t_task_np;
    TestActivity<PeriodicActivity>* t_task_np_bad;
    TestActivity<PeriodicActivity>* t_task_p;
    TestActivity<SlaveActivity>* t_task_slave;
 
    RunnableInterface* t_run_allocate;
public:
 
    void setUp();
    void tearDown();
 
#ifndef ORO_EMBEDDED
    void testExceptionRecovery();
#endif
    void testThreadConfig();
    void testPeriodic();
    void testNonPeriodic();
    void testSlave();
    void testSequential();
 
    void testScheduler();
 
    void testAllocation();
    void testRemoveAllocate();
    void testAddAllocate();
};
 
#endif