简体   繁体   English

为什么使用Boost测试-单头变体崩溃?

[英]Why does this usage of boost test - single header variant crash?

I use the boost Unit Test Framework (version 1.59) using the Single Header Variant. 我使用带有单头变体的boost单元测试框架(版本1.59)。 By running the code underneath in Visual Studio 2013 I get a debug assertion. 通过在Visual Studio 2013中运行下面的代码,我得到了一个调试断言。 (Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) Any idea why? (表达式:_BLOCK_TYPE_IS_VALID(pHead-> nBlockUse)知道为什么吗?

http://www.boost.org/doc/libs/1_59_0/libs/test/doc/html/boost_test/adv_scenarios/single_header_customizations/entry_point.html http://www.boost.org/doc/libs/1_59_0/libs/test/doc/html/boost_test/adv_scenarios/single_header_customizations/entry_point.html

#define BOOST_TEST_MODULE MyTest
#define BOOST_TEST_NO_MAIN
#define BOOST_TEST_ALTERNATIVE_INIT_API
#include <boost/test/included/unit_test.hpp>

BOOST_AUTO_TEST_CASE(boo)
{
}

int main(int argc, char* argv[])
{
  return boost::unit_test::unit_test_main(init_unit_test, argc, argv);
}

So I left a command line parameter in the Project's Configuration Properties. 因此,我在项目的配置属性中保留了命令行参数。 For some reason the boost unit test framework crashes when running this program with command line parameter 'boo'... 由于某些原因,使用命令行参数“ boo”运行此程序时,boost单元测试框架会崩溃...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM