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-boost

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/fixture/test-suite-shared.html
*/
#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