[Cppunit-cvs] cppunit2/src/cpput testinfo.cpp,1.2,1.3
Brought to you by:
blep
From: Baptiste L. <bl...@us...> - 2004-11-19 23:05:31
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1230/src/cpput Modified Files: testinfo.cpp Log Message: * added aborting assertion mode to optional carry a string containing the properties in the exception. Index: testinfo.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testinfo.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testinfo.cpp 19 Nov 2004 21:39:14 -0000 1.2 --- testinfo.cpp 19 Nov 2004 23:05:21 -0000 1.3 *************** *** 1,3 **** --- 1,4 ---- #include <cpput/testinfo.h> + #include <cpput/thread.h> namespace { *************** *** 34,46 **** AssertionType assertionType_; CompactLocation assertionLocation_; }; namespace TestInfo { ! static TestInfoDataPtr staticData( new TestInfoData() ); ! static const TestInfoDataPtr &dataPtr() { ! return staticData; } --- 35,55 ---- AssertionType assertionType_; CompactLocation assertionLocation_; + AbortingAssertionMode abortingAssertionMode_; }; namespace TestInfo { ! // static TestInfoDataPtr staticData( new TestInfoData() ); ! ThreadLocalStorage<TestInfoDataPtr> staticData; ! static TestInfoDataPtr dataPtr() { ! const TestInfoDataPtr &data = staticData.get(); ! if ( !data ) ! { ! staticData.set( TestInfoDataPtr( new TestInfoData() ) ); ! return staticData.get(); ! } ! return data; } *************** *** 116,120 **** if ( data().assertionType_ == abortingAssertion ) ! throw AbortingAssertionException( "" ); } --- 125,134 ---- if ( data().assertionType_ == abortingAssertion ) ! { ! std::string message; ! if ( data().abortingAssertionMode_ != fastAbortingAssertion ) ! message = data().result_.toString(); ! throw AbortingAssertionException( message ); ! } } *************** *** 155,158 **** --- 169,177 ---- } + void setAbortingAssertionMode( AbortingAssertionMode mode ) + { + data().abortingAssertionMode_ = mode; + } + } // namespace TestInfo |