aboutsummaryrefslogtreecommitdiff
path: root/src/unittest/test_threading.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unittest/test_threading.cpp')
-rw-r--r--src/unittest/test_threading.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/unittest/test_threading.cpp b/src/unittest/test_threading.cpp
index 8d4d814fd..76aff3fb0 100644
--- a/src/unittest/test_threading.cpp
+++ b/src/unittest/test_threading.cpp
@@ -23,8 +23,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "threading/semaphore.h"
#include "threading/thread.h"
-
-class TestThreading : public TestBase {
+class TestThreading : public TestBase
+{
public:
TestThreading() { TestManager::registerTestModule(this); }
const char *getName() { return "TestThreading"; }
@@ -44,11 +44,11 @@ void TestThreading::runTests(IGameDef *gamedef)
TEST(testAtomicSemaphoreThread);
}
-class SimpleTestThread : public Thread {
+class SimpleTestThread : public Thread
+{
public:
SimpleTestThread(unsigned int interval) :
- Thread("SimpleTest"),
- m_interval(interval)
+ Thread("SimpleTest"), m_interval(interval)
{
}
@@ -110,7 +110,6 @@ void TestThreading::testStartStopWait()
delete thread;
}
-
void TestThreading::testThreadKill()
{
SimpleTestThread *thread = new SimpleTestThread(300);
@@ -134,13 +133,11 @@ void TestThreading::testThreadKill()
delete thread;
}
-
-class AtomicTestThread : public Thread {
+class AtomicTestThread : public Thread
+{
public:
AtomicTestThread(std::atomic<u32> &v, Semaphore &trigger) :
- Thread("AtomicTest"),
- val(v),
- trigger(trigger)
+ Thread("AtomicTest"), val(v), trigger(trigger)
{
}
@@ -157,7 +154,6 @@ private:
Semaphore &trigger;
};
-
void TestThreading::testAtomicSemaphoreThread()
{
std::atomic<u32> val;
@@ -180,4 +176,3 @@ void TestThreading::testAtomicSemaphoreThread()
UASSERT(val == num_threads * 0x10000);
}
-