diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-01-07 17:10:38 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-01-07 17:10:38 +0000 |
commit | 126554830aea4a6faffdce172affeaa6551a649c (patch) | |
tree | fef393a909f81ca7de6b8f07e65e7f1abb438d8c /fastos | |
parent | 1969e5c0ff6ff19fcd87d12b6c738f1d49e0035b (diff) |
No need to test std::this_thread::sleep
Diffstat (limited to 'fastos')
-rw-r--r-- | fastos/src/tests/CMakeLists.txt | 7 | ||||
-rw-r--r-- | fastos/src/tests/thread_sleep_test.cpp | 52 |
2 files changed, 0 insertions, 59 deletions
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); -} |