c++boostboost-unit-test-framework

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. By running the code underneath in Visual Studio 2013 I get a debug assertion. (Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse) Any idea why?

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);
}

Solution

  • 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'...