#160 A TestSuite with a long name will crash in constructor

1.10.2
open
nobody
5
2006-04-17
2006-04-17
Ou Liu
No

Following lines will crash: (You just need add this
line in a main function, just this line is enought to
cause crash)
(Code/CppUnitTest was compiled under VC7)

CppUnit::TestSuite *suiteOfTests = new
CppUnit::TestSuite( "ComplexNumberTest" );

However if you set the name to "ComplexNumber", there
is no problem. If you change the TestSuite's
constructor prototype to (const string& name) instead
of (string name), there is no problem.

Any idea?

Thanks
Ou

Discussion

  • Ou Liu
    Ou Liu
    2006-04-17

    Logged In: YES
    user_id=1504079

    Another crash under windows (still builds with VC7)

    Use the following code:
    class ComplexNumberTest : public CppUnit::TestFixture {
    CPPUNIT_TEST_SUITE( ComplexNumberTest );
    CPPUNIT_TEST( testEquality );
    CPPUNIT_TEST( testAddition );
    CPPUNIT_TEST_SUITE_END();

    as specified in Cookbook, then when I am trying to do
    registry.makeTest(). It crashes again when trying to free
    string's memory.

     
  • Ou Liu
    Ou Liu
    2006-04-17

    Logged In: YES
    user_id=1504079

    Ok, now I recompile everything under VC6 and there are
    still crash, although now the crash happens when the
    program is going to exit.

    Just a little bit curious, is this version ever tested
    under windows? Or is there any stable, almost no bug
    version for windows?

    Thanks
    Ou

     
  • Ou Liu
    Ou Liu
    2006-04-17

    Logged In: YES
    user_id=1504079

    Sorry, I made stupid mistakes. I forgot to set C Runtime
    dll to Multiple thread debug dll. After I did that,
    everything works fine.

    Sorry
    Ou