Friday, February 5, 2010

CppUnit disable exception handing

By default C++ unit catches exceptions, this can make debugging a lot harder (as it often doesn't give you much information about the exception that was thrown or which line number it was thrown on). To disable the exception catching you need to remove the default protector:

// Normal test runner
CppUnit::TextUi::TestRunner runner;

// disable exceptions
runner.eventManager().popProtector();

1 comment:

Anonymous said...
This comment has been removed by a blog administrator.