Runtime error with Boost's unit test framework

Hi all, I'm a newbie using the boost unit test framework. I'm getting a run-time exception that presents itself with the following message: Unhandled exception at 0x61c3b130 (msvcr80d.dll) in test.exe: 0xC0000005: Access violation reading location 0xcccccccc. If I step through the code, the exception is thrown the 3rd time this line from Boost is invoked: unit_test_suite_impl.hpp:111 callback0<> const& test_func() const { return m_test_func; } I can't seem to uncover what the problem is - has anyone else had this problem? Might anyone have any insight to my possible misuse of it? I'm linking with libboost_program_options-vc80-mt-gd-1_41.lib. Running Visual Studio 2005 (VC8) Thanks! Joey

Joey Mink <joeymink <at> gmail.com> writes:
Hi all,I'm a newbie using the boost unit test framework. I'm getting a run-time exception that presents itself with the following message: Unhandled exception at 0x61c3b130 (msvcr80d.dll) in test.exe: 0xC0000005: Access violation reading location 0xcccccccc.
Please post an trimmed example illustrating the problem and also describe how you build both boost library and your test module. Gennadiy

Gennadiy Rozental wrote:
Joey Mink <joeymink <at> gmail.com> writes:
Hi all,I'm a newbie using the boost unit test framework. I'm getting a run-time exception that presents itself with the following message: Unhandled exception at 0x61c3b130 (msvcr80d.dll) in test.exe: 0xC0000005: Access violation reading location 0xcccccccc.
Please post an trimmed example illustrating the problem and also describe how you build both boost library and your test module.
As I - as also a newb - am having similar problems, trying to use boost. unit testing with wxWidgets, I'll jump in here as well, hoping you won't mind. As best as I can recall the building went something like: From: http://www.boost.org/doc/libs/1_41_0/more/getting_started/windows.html#get-b... From: |bootstrap .\bjam | My project files - under MSVC 2008 C++ Express =========== but86.cpp // but86.cpp : Defines the entry point for the console application. // #define BOOST_TEST_MAIN #include <boost/test/unit_test.hpp> =================== #include <boost/test/unit_test.hpp> #include "chip8X86Dllh.h" /* from http://www.boost.org/doc/libs/1_36_0/libs/test/doc/html/utf/user-guide/fixtu... */ #define BOOST_TEST_MODULE example // ------------------------------------------------------------- class F { public: F(); ~F(){ BOOST_TEST_MESSAGE( "teardown fixture" ); BOOST_TEST_MESSAGE( "Freeing DLL" ); FreeLibrary( hExeLib ); } HINSTANCE hExeLib; wchar_t *psz86DllName;// = ".\\dis8x86.dll"; }; F::F() { BOOST_TEST_MESSAGE( "setup fixture" ); BOOST_TEST_MESSAGE( "Loading DLL" ); psz86DllName = L"../chips/chipx86.dll"; <<<< the DLL I need to test BOOST_REQUIRE( hExeLib != NULL ); } // ------------------------------------------------------------- // test suite level fixture BOOST_FIXTURE_TEST_SUITE( s, F ) // ------------------------------------------------------------- BOOST_AUTO_TEST_CASE(TestProcSpecifics) { long lProcrSpecifics(4); BOOST_REQUIRE_EQUAL(4, lProcrSpecifics); processorSpecifics_t *psProcessorSpecifics; } BOOST_AUTO_TEST_SUITE_END() =============== After returning to this project now after a number of days, it seems to run with the code that is left right now ... but unless I single step through at least a part of it, I see nothing of the output, because it opens & shuts the console window so fast. Depending on how far I single step it seems to sometimes give me some access errors, other time it doesn't. If I single-step until I hit the point where the app returns to crt.exe, things look OK, but I don't want to single step all the way all the time ;-) The IDE output window does _not_ show the test output - neither during the run, nor afterwards. Thus my preference would be to build a GUI - using wxWidgets - but I can't work out how to call boost UTF from within a wxWidgets app. If any one has a solution for this problem, I'd greatly appreciate it. booster -- Fight Spam - report it with wxSR http://www.columbinehoney.net/wxSR.shtml

AMDG acorn12 wrote:
<snip> After returning to this project now after a number of days, it seems to run with the code that is left right now ... but unless I single step through at least a part of it, I see nothing of the output, because it opens & shuts the console window so fast.
You can either run it without the debugger or set a breakpoint at the end of main.
Depending on how far I single step it seems to sometimes give me some access errors, other time it doesn't.
If I single-step until I hit the point where the app returns to crt.exe, things look OK, but I don't want to single step all the way all the time ;-)
The IDE output window does _not_ show the test output - neither during the run, nor afterwards.
Thus my preference would be to build a GUI - using wxWidgets - but I can't work out how to call boost UTF from within a wxWidgets app.
If any one has a solution for this problem, I'd greatly appreciate it.
In Christ, Steven Watanabe
participants (4)
-
acorn12
-
Gennadiy Rozental
-
Joey Mink
-
Steven Watanabe