Menu

Test registration fails in Visual Studio 2005

Help
thrams
2005-12-22
2013-04-22
  • thrams

    thrams - 2005-12-22

    We are currently using MS Visual Studio 2005, trial edition. We are unable to run our CPPUnit test suites on VS 2005, which have been all OK on VS 2003.

    The same problem shows up both with CPPUnit 1.10.2 and 1.11.4.

    CPPUNIT_TEST_SUITE_REGISTRATION always throws an unhandled Microsoft C++ exception: "std::bad_alloc at memory location..."
    The exception is thrown at:
    file:  dbgheap.c
    method: _nh_malloc_dbg()
    statement: pvBlk = _heap_alloc_dbg(nSize, nBlockUse, szFileName, nLine);

    ... where szFileName is a "bad pointer".

    I'm wondering if this is caused by some setup problem with VS 2005.  Any hint would be appreciated.
    Thanks!
    T.T.

     
    • Tom Plunket

      Tom Plunket - 2005-12-22

      Look at the various stack frames to see where szFilename is set, and try to figure out where the data is coming from that is incorrect.  Do this by clicking on the various functions in the Call Stack debug window and examining the variables that are being passed around.

      It could simply be that whatever's supposed to be resolving to the name of the filename requesting the allocation isn't working properly.

       
    • thrams

      thrams - 2005-12-23

      Never mind,- I'm embarrassed! Now, I found out the problem was caused by an MS V7.1 runtime library that was still creeping in underneath the cppunit assembly. Got it to work once any path references to   VS 2003 got removed, ensuring that only MS V8.0 is used.

      Thanks to Tom for the quick reply, anyhow! I tried analyze the call stack, as you said. But the stack itself got kind of corrupt because of the wrong library.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.