Subject: [Boost-bugs] [Boost C++ Libraries] #6004: boost thread unit test module bug on Microsoft Visual Studio debug mode
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-10-10 20:01:04
#6004: boost thread unit test module bug on Microsoft Visual Studio debug mode
------------------------------------+---------------------------------------
Reporter: gilgil1973@⦠| Owner: anthonyw
Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
Version: Boost 1.47.0 | Severity: Problem
Keywords: thread BOOST_CHECK bug |
------------------------------------+---------------------------------------
Hi, glad to see you.
I've figured out the bug of unit test on MSVC debug mode.
if I use BOOST_CHECK in working thread, it does not work correctly.
You can download source codes and video clip at
http://www.gilgil.net/10328 .
Thank you.
-------------------- source code --------------------
#define BOOST_TEST_MODULE MyUnitTest
#include <boost/test/unit_test.hpp>
#include <boost/thread.hpp>
BOOST_AUTO_TEST_SUITE ( MySuite );
void func()
{
BOOST_CHECK ( true );
}
BOOST_AUTO_TEST_CASE( ThreadTest )
{
static const int THREAD_CNT = 1000;
boost::thread* t[THREAD_CNT];
for (int i = 0; i < THREAD_CNT; i++)
{
t[i] = new boost::thread(func);
}
for (int i = 0; i < THREAD_CNT; i++)
{
t[i]->join();
}
for (int i = 0; i < THREAD_CNT; i++)
{
delete t[i];
}
}
BOOST_AUTO_TEST_SUITE_END (); // MySuite
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6004> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC