Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
icl_core
src
ts
icl_core_thread
ts_Thread.cpp
Go to the documentation of this file.
1
// this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2
3
// -- BEGIN LICENSE BLOCK ----------------------------------------------
4
// This file is part of FZIs ic_workspace.
5
//
6
// This program is free software licensed under the LGPL
7
// (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8
// You can find a copy of this license in LICENSE folder in the top
9
// directory of the source code.
10
//
11
// © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12
//
13
// -- END LICENSE BLOCK ------------------------------------------------
14
15
//----------------------------------------------------------------------
22
//----------------------------------------------------------------------
23
#include <boost/test/unit_test.hpp>
24
#include <
icl_core_thread/Thread.h
>
25
26
using
icl_core::thread::Thread
;
27
28
class
TestThread
:
public
Thread
29
{
30
public
:
31
TestThread
()
32
:
Thread
(
"Test Thread"
),
33
m_has_run
(false)
34
{ }
35
36
virtual
~TestThread
()
37
{ }
38
39
virtual
void
run
()
40
{
41
m_has_run
=
true
;
42
}
43
44
bool
hasRun
()
const
{
return
m_has_run
; }
45
46
private
:
47
bool
m_has_run
;
48
};
49
50
BOOST_AUTO_TEST_SUITE(ts_Thread)
51
52
BOOST_AUTO_TEST_CASE
(RunThread)
53
{
54
TestThread
test_thread;
55
56
BOOST_CHECK(!test_thread.
hasRun
());
57
58
test_thread.
start
();
59
test_thread.
stop
();
60
test_thread.
join
();
61
62
BOOST_CHECK(test_thread.
hasRun
());
63
}
64
65
BOOST_AUTO_TEST_SUITE_END()
TestThread::hasRun
bool hasRun() const
Definition:
ts_Thread.cpp:44
icl_core::thread::Thread::start
bool start()
Definition:
icl_core_thread/Thread.cpp:176
TestThread::m_has_run
bool m_has_run
Definition:
ts_Thread.cpp:47
TestThread::~TestThread
virtual ~TestThread()
Definition:
ts_Thread.cpp:36
icl_core::thread::Thread
Definition:
icl_core_thread/Thread.h:77
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(RunThread)
Definition:
ts_Thread.cpp:52
TestThread::TestThread
TestThread()
Definition:
ts_Thread.cpp:31
TestThread
Definition:
ts_Thread.cpp:28
Thread.h
Contains icl_core::thread::Thread.
TestThread::run
virtual void run()
Definition:
ts_Thread.cpp:39
icl_core::thread::Thread::join
void join()
Definition:
icl_core_thread/Thread.cpp:138
icl_core::thread::Thread::stop
void stop()
Definition:
icl_core_thread/Thread.h:189
fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58