Ste*_*eve 2 c++ multithreading boost unit-testing
我定义了以下非常简单的测试用例:
#define BOOST_TEST_MODULE thread_test_module
#include <boost/test/unit_test.hpp>
#include <thread>
void do_nothing() {}
BOOST_AUTO_TEST_CASE ( boost_thread_test )
{
std::thread t(do_nothing);
t.join();
}
Run Code Online (Sandbox Code Playgroud)
运行时,我收到以下错误:
unknown location(0): fatal error in "boost_thread_test": std::runtime_error: Operation not permitted
Run Code Online (Sandbox Code Playgroud)
根据这篇文章,它似乎应该有效.为什么不?