Re: [Cppunit-devel] Core dump using CPPUNIT_ASSERT_EQUAL on strings
Brought to you by:
blep
From: Dave D. <da...@dr...> - 2002-06-02 15:20:53
|
On Sat, Jun 01, 2002 at 01:05:17PM +0200, Baptiste Lepilleur wrote: > From the stack trace, it seems that > TestAssert.h:46 > static std::string toString( const T& x ) > { > OStringStream ost; > ost << x; > return ost.str(); // << throw an exception... > } > > Could you: > - dump the exception Sorry for my ignorance, but how do you do that? :) I tried doing this: void Suite2::test_case1() { try { string a = "2a"; string b = "2b"; CHECK_EQUALS(a, b); } catch(std::exception & e) { cerr << "Caught exception: " << e.what() << endl; } } But a SIGABRT still happens in CHECK_EQUALS() and the catch block never runs. > - tell me what are the value of > CPPUNIT_HAVE_SSTREAM > CPPUNIT_HAVE_CLASS_STRSTREAM > CPPUNIT_HAVE_STRSTREAM > in the generated config file cppunit/config-auto.h. #define CPPUNIT_HAVE_SSTREAM 1 #define CPPUNIT_HAVE_CLASS_STRSTREAM 1 #define CPPUNIT_HAVE_STRSTREAM 1 > The problem is likely an OStringStream issue that depend on your > configuration. If I remember ostringstream's weren't in GCC 2.95. But Red Hat's 2.96 is a bastard child somewhere between 2.95 and 3.0.x. -Dave |