Question

I recently upgraded my laptop to Windows 8 so that I can develop for W8 and WP8. I had some projects that were created with Visual Studio 2010 that used Boost.Test for unit testing. I tried converting the projects to VS2012 projects, but ran into problems, so I just created fresh VS2012 projects using the same source code as before. However, every unit test suite throws an exception when I run it. I've debugged it and found that it's throwing the exception when it tries to make the report in the make_report method in results_reporter.ipp. The offending line is

case CONFIRMATION_REPORT:
    s_rr_impl().m_formatter->do_confirmation_report( framework::get<test_unit>( id ), *s_rr_impl().m_output );

Somewhere in the code there is a map object which has some bad memory, and hence the exception. I'm using Boost 1.50.0. I've also tried the most recent release, 1.52.0, but with the same results. Is VS2012 buggy, or is there some setting/configuration that I'm unaware of, or differences in developing on Windows 7 vs. 8?

Edit

Here is an example test that throws an exception in my environment with VS2012 and Boost 1.50.0:

#define BOOST_TEST_MODULE exception.test
#include <boost/test/unit_test.hpp>

BOOST_AUTO_TEST_SUITE(SuiteTest)

BOOST_AUTO_TEST_CASE(exceptionTest){
    BOOST_REQUIRE(true);
}

BOOST_AUTO_TEST_SUITE_END()
Was it helpful?

Solution

This was happening because of some global overrides of new and delete that was getting accidentally imported via another test class in my project.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top