summaryrefslogtreecommitdiff
path: root/src/unittest
diff options
context:
space:
mode:
authorSebastien Marie <semarie@users.noreply.github.com>2020-09-10 12:19:18 +0200
committerGitHub <noreply@github.com>2020-09-10 12:19:18 +0200
commit3fb1f45301880a3aa901b752af1ecc912efe5915 (patch)
tree58545af949274d8d7560337755760b3eb5019a1b /src/unittest
parent0683bea283d456253de343f37720789382ece6b2 (diff)
downloadminetest-3fb1f45301880a3aa901b752af1ecc912efe5915.tar.gz
minetest-3fb1f45301880a3aa901b752af1ecc912efe5915.tar.bz2
minetest-3fb1f45301880a3aa901b752af1ecc912efe5915.zip
Remove Thread::kill() and related unittest (#10317)
Closes: #6065
Diffstat (limited to 'src/unittest')
-rw-r--r--src/unittest/test_threading.cpp25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/unittest/test_threading.cpp b/src/unittest/test_threading.cpp
index 8d4d814fd..65ef7c02d 100644
--- a/src/unittest/test_threading.cpp
+++ b/src/unittest/test_threading.cpp
@@ -31,7 +31,6 @@ public:
void runTests(IGameDef *gamedef);
void testStartStopWait();
- void testThreadKill();
void testAtomicSemaphoreThread();
};
@@ -40,7 +39,6 @@ static TestThreading g_test_instance;
void TestThreading::runTests(IGameDef *gamedef)
{
TEST(testStartStopWait);
- TEST(testThreadKill);
TEST(testAtomicSemaphoreThread);
}
@@ -111,29 +109,6 @@ void TestThreading::testStartStopWait()
}
-void TestThreading::testThreadKill()
-{
- SimpleTestThread *thread = new SimpleTestThread(300);
-
- UASSERT(thread->start() == true);
-
- // kill()ing is quite violent, so let's make sure our victim is sleeping
- // before we do this... so we don't corrupt the rest of the program's state
- sleep_ms(100);
- UASSERT(thread->kill() == true);
-
- // The state of the thread object should be reset if all went well
- UASSERT(thread->isRunning() == false);
- UASSERT(thread->start() == true);
- UASSERT(thread->stop() == true);
- UASSERT(thread->wait() == true);
-
- // kill() after already waiting should fail.
- UASSERT(thread->kill() == false);
-
- delete thread;
-}
-
class AtomicTestThread : public Thread {
public: