From 126554830aea4a6faffdce172affeaa6551a649c Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Thu, 7 Jan 2021 17:10:38 +0000 Subject: No need to test std::this_thread::sleep --- fastos/src/tests/CMakeLists.txt | 7 ----- fastos/src/tests/thread_sleep_test.cpp | 52 ---------------------------------- 2 files changed, 59 deletions(-) delete mode 100644 fastos/src/tests/thread_sleep_test.cpp diff --git a/fastos/src/tests/CMakeLists.txt b/fastos/src/tests/CMakeLists.txt index 89b820d1482..34007afb8d5 100644 --- a/fastos/src/tests/CMakeLists.txt +++ b/fastos/src/tests/CMakeLists.txt @@ -19,13 +19,6 @@ vespa_add_executable(fastos_thread_stats_test_app TEST fastos ) vespa_add_test(NAME fastos_thread_stats_test_app NO_VALGRIND COMMAND fastos_thread_stats_test_app) -vespa_add_executable(fastos_thread_sleep_test_app TEST - SOURCES - thread_sleep_test.cpp - DEPENDS - fastos -) -vespa_add_test(NAME fastos_thread_sleep_test_app NO_VALGRIND COMMAND fastos_thread_sleep_test_app) vespa_add_executable(fastos_thread_joinwait_test_app TEST SOURCES thread_joinwait_test.cpp diff --git a/fastos/src/tests/thread_sleep_test.cpp b/fastos/src/tests/thread_sleep_test.cpp deleted file mode 100644 index 209b7d3f880..00000000000 --- a/fastos/src/tests/thread_sleep_test.cpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -#include "tests.h" -#include "job.h" -#include "thread_test_base.hpp" - -class Thread_Sleep_Test : public ThreadTestBase -{ - int Main () override; - - void CreateSingleThread () - { - TestHeader("Create Single Thread Test"); - - FastOS_ThreadPool *pool = new FastOS_ThreadPool(128*1024); - - if(Progress(pool != nullptr, "Allocating ThreadPool")) - { - bool rc = (nullptr != pool->NewThread(this, nullptr)); - Progress(rc, "Creating Thread"); - - Progress(true, "Sleeping 3 seconds"); - std::this_thread::sleep_for(3s); - } - - Progress(true, "Closing threadpool..."); - pool->Close(); - - Progress(true, "Deleting threadpool..."); - delete(pool); - PrintSeparator(); - } -}; - -int Thread_Sleep_Test::Main () -{ - printf("grep for the string '%s' to detect failures.\n\n", failString); - time_t before = time(0); - - CreateSingleThread(); - { time_t now = time(0); printf("[%ld seconds]\n", now-before); before = now; } - - printf("END OF TEST (%s)\n", _argv[0]); - return allWasOk() ? 0 : 1; -} - -int main (int argc, char **argv) -{ - Thread_Sleep_Test app; - setvbuf(stdout, nullptr, _IOLBF, 8192); - return app.Entry(argc, argv); -} -- cgit v1.2.3