From b8e1dc2e53b9d19df26a87686dfd435b3b346f9c Mon Sep 17 00:00:00 2001 From: Gavin Andresen Date: Fri, 3 May 2013 10:45:00 -0400 Subject: [PATCH] Remove flaky util thread unit tests --- src/test/util_tests.cpp | 58 ----------------------------------------- 1 file changed, 58 deletions(-) diff --git a/src/test/util_tests.cpp b/src/test/util_tests.cpp index 2d05794cc..1b0ccad51 100644 --- a/src/test/util_tests.cpp +++ b/src/test/util_tests.cpp @@ -323,62 +323,4 @@ BOOST_AUTO_TEST_CASE(util_seed_insecure_rand) } } -static int nCounter = 0; - -static void Count() -{ - ++nCounter; - MilliSleep(10); -} - -static void CountWithArg(int arg) -{ - nCounter += arg; - MilliSleep(10); -} - -BOOST_AUTO_TEST_CASE(util_loop_forever1) -{ - boost::thread_group threadGroup; - - threadGroup.create_thread(boost::bind(&LoopForever, "count", &Count, 1)); - MilliSleep(1); - threadGroup.interrupt_all(); - BOOST_CHECK_EQUAL(nCounter, 1); - nCounter = 0; -} - -BOOST_AUTO_TEST_CASE(util_loop_forever2) -{ - boost::thread_group threadGroup; - - boost::function f = boost::bind(&CountWithArg, 11); - threadGroup.create_thread(boost::bind(&LoopForever >, "count11", f, 11)); - MilliSleep(1); - threadGroup.interrupt_all(); - BOOST_CHECK_EQUAL(nCounter, 11); - nCounter = 0; -} - -BOOST_AUTO_TEST_CASE(util_threadtrace1) -{ - boost::thread_group threadGroup; - - threadGroup.create_thread(boost::bind(&TraceThread, "count11", &Count)); - threadGroup.join_all(); - BOOST_CHECK_EQUAL(nCounter, 1); - nCounter = 0; -} - -BOOST_AUTO_TEST_CASE(util_threadtrace2) -{ - boost::thread_group threadGroup; - - boost::function f = boost::bind(&CountWithArg, 11); - threadGroup.create_thread(boost::bind(&TraceThread >, "count11", f)); - threadGroup.join_all(); - BOOST_CHECK_EQUAL(nCounter, 11); - nCounter = 0; -} - BOOST_AUTO_TEST_SUITE_END()