I've made some unit tests with boost test before without issue, but on my latest rather ordinary test, I've been able to get Boost test to crash the executable in debug and release mode when boost test is making a report before terminating.
That's the default report_level of 'confirm'
If I use report_level=short or detailed, I get a similar crash:
Here's the get() method:
get( test_unit_id id, test_unit_type t )
test_unit* res = impl::s_frk_state().m_test_units[id];
BOOST_TEST_I_ASSRT( (res->p_type & t) != 0, internal_error( "Invalid test unit type" ) );
Crash occurs on line 2 of the function. I logged 'res' each time the function is called and many times its valid, but when it runs this one test (by itself or with others), 'res' always ends up being NULL.
id seems to always be '1', and t is TUT_ANY (17) if generating a confirmation report or TUT_SUITE (16) if generating a short or detailed report.
If I use the option '--report_level=no', then execution does complete fine.
I followed through on some process of elimination and it seems to be related to using a fixture?
Having no test body still causes the crash. It wasn't until I removed the fixture (and its usage in the body of the test) did the executable not crash.
I ensured that I was using the standard fixture model found here:
OS is Win 7 w/ VS2015
boost is 1.64.0 and was built with: b2 toolset=msvc-14.0 link=static runtime-link=static variant=debug address-model=64 --without-atomic --without-container --without-context --without-coroutine --without-coroutine2 --without-graph --without-graph_parallel --without-iostreams --without-locale --without-math --without-mpi --without-serialization --without-signals --without-type_erasure --without-wave -j4 --abbreviate-paths --without-python -d2
Any help would of something to look at or change would be appreciated.
Thanks for your time,