cppunit-cvs Mailing List for CppUnit - C++ port of JUnit (Page 12)
Brought to you by:
blep
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(94) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
(114) |
Mar
(80) |
Apr
|
May
|
Jun
(36) |
Jul
(67) |
Aug
(37) |
Sep
(33) |
Oct
(28) |
Nov
(91) |
Dec
(16) |
2006 |
Jan
(1) |
Feb
(7) |
Mar
(45) |
Apr
|
May
|
Jun
(36) |
Jul
(7) |
Aug
|
Sep
(32) |
Oct
(3) |
Nov
|
Dec
|
2007 |
Jan
(29) |
Feb
(11) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(35) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
(14) |
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
(13) |
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
(15) |
From: Baptiste L. <bl...@us...> - 2005-12-11 17:16:16
|
Update of /cvsroot/cppunit/cppunit2/include/cpptl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29225/include/cpptl Modified Files: intrusiveptr.h Added Files: cpptl_autolink.h Log Message: * rough sketch of a working OpenTest driver with CppUT adaptor for TestRunner. --- NEW FILE: cpptl_autolink.h --- #ifndef CPPTL_AUTOLINK_H_INCLUDED # define CPPTL_AUTOLINK_H_INCLUDED # if !defined(CPPTL_NO_AUTOLINK) && !defined(CPPTL_DLL_BUILD) # define CPPTL_AUTOLINK_NAME "cpptl" # undef CPPTL_AUTOLINK_DLL # ifdef CPPTL_DLL # define CPPTL_AUTOLINK_DLL # endif # include "autolink.h" # endif #endif // CPPTL_AUTOLINK_H_INCLUDED Index: intrusiveptr.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/intrusiveptr.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** intrusiveptr.h 13 Nov 2005 11:00:41 -0000 1.3 --- intrusiveptr.h 11 Dec 2005 17:16:08 -0000 1.4 *************** *** 135,138 **** --- 135,168 ---- } + bool operator ==( const ThisType &other ) const + { + return p_ == other.p_; + } + + bool operator !=( const ThisType &other ) const + { + return !(*this == other ); + } + + bool operator <( const ThisType &other ) const + { + return p_ < other.p_; + } + + bool operator <=( const ThisType &other ) const + { + return p_ <= other.p_; + } + + bool operator >=( const ThisType &other ) const + { + return p_ >= other.p_; + } + + bool operator >( const ThisType &other ) const + { + return p_ > other.p_; + } + private: PointeeType *p_; *************** *** 207,210 **** --- 237,324 ---- + namespace CppTL { + + template<class DataType> + class SharedDataPtr + { + public: + typedef SharedDataPtr<DataType> ThisType; + typedef DataType Data; + + SharedDataPtr() + { + } + + SharedDataPtr( const Data &data ) + : shared_( new CountedData( data ) ) + { + } + + SharedDataPtr( const ThisType &other ) + : shared_( other.shared_ ) + { + } + + ~SharedDataPtr() + { + } + + Data *get() const + { + CountedData *data = shared_.get(); + return data ? &(data->data_) : 0; + } + + void swap( ThisType &other ) + { + shared_.swap( other.shared_ ); + } + + ThisType &operator =( const ThisType &other ) + { + ThisType tmp( other ); + swap( tmp ); + return *this; + } + + DataType &operator *() const + { + // assert( p_ != 0 ) + return shared_->data_; + } + + DataType *operator ->() const + { + return &(shared_->data_); + } + + operator bool() const + { + return shared_; + } + + bool operator !() const + { + return !shared_; + } + + private: + class CountedData : public IntrusiveCount + { + public: + CountedData( const Data &data ) + : data_( data ) + { + } + + Data data_; + }; + + IntrusivePtr<CountedData> shared_; + }; + + + } // namespace CppTL + #endif // CPPTL_INTRUSIVEPTR_H_INCLUDED |
From: Baptiste L. <bl...@us...> - 2005-12-11 17:10:00
|
Update of /cvsroot/cppunit/cppunit2/examples/opentest_demo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28358/examples/opentest_demo Log Message: Directory /cvsroot/cppunit/cppunit2/examples/opentest_demo added to the repository |
From: Baptiste L. <bl...@us...> - 2005-11-27 18:32:39
|
Update of /cvsroot/cppunit/cppunit/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25051/doc Modified Files: cookbook.dox Log Message: * doc/cookbook.dox: fixed type (patch #1334567) Index: cookbook.dox =================================================================== RCS file: /cvsroot/cppunit/cppunit/doc/cookbook.dox,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** cookbook.dox 5 Jul 2005 20:10:19 -0000 1.7 --- cookbook.dox 27 Nov 2005 18:32:31 -0000 1.8 *************** *** 148,152 **** Once we have this fixture, we can add the complex ! addition test case any any others that we need over the course of our development. --- 148,152 ---- Once we have this fixture, we can add the complex ! addition test case and any others that we need over the course of our development. *************** *** 521,523 **** Original version by Michael Feathers. Doxygen conversion and update by Baptiste Lepilleur. ! */ \ No newline at end of file --- 521,523 ---- Original version by Michael Feathers. Doxygen conversion and update by Baptiste Lepilleur. ! */ |
From: Baptiste L. <bl...@us...> - 2005-11-27 18:32:39
|
Update of /cvsroot/cppunit/cppunit In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25051 Modified Files: ChangeLog Log Message: * doc/cookbook.dox: fixed type (patch #1334567) Index: ChangeLog =================================================================== RCS file: /cvsroot/cppunit/cppunit/ChangeLog,v retrieving revision 1.242 retrieving revision 1.243 diff -C2 -d -r1.242 -r1.243 *** ChangeLog 6 Nov 2005 16:58:20 -0000 1.242 --- ChangeLog 27 Nov 2005 18:32:30 -0000 1.243 *************** *** 1,2 **** --- 1,5 ---- + 2005-11-27 Baptiste Lepilleur <gai...@fr...> + * doc/cookbook.dox: fixed type (patch #1334567) + 2005-11-06 Baptiste Lepilleur <gai...@fr...> * include/cppunit/config/SourcePrefix.h: disable warning #4996 |
From: Baptiste L. <bl...@us...> - 2005-11-14 21:28:17
|
Update of /cvsroot/cppunit/cppunit2/src/opentest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv576/src/opentest Modified Files: interfaces.cpp Log Message: - simplified interface a bit Index: interfaces.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/opentest/interfaces.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** interfaces.cpp 24 Jun 2005 19:43:22 -0000 1.1 --- interfaces.cpp 14 Nov 2005 21:28:09 -0000 1.2 *************** *** 112,117 **** ResultLog::serialize( Stream &stream ) const { ! return stream << log_ ! << logSpecific_; } --- 112,116 ---- ResultLog::serialize( Stream &stream ) const { ! return stream << log_; } *************** *** 119,124 **** ResultLog::unserialize( Stream &stream ) { ! return stream >> log_ ! >> logSpecific_; } --- 118,122 ---- ResultLog::unserialize( Stream &stream ) { ! return stream >> log_; } *************** *** 128,134 **** return stream << assertionType_ << assertionFormat_ ! << message_ ! << expectedSpecific_ ! << actualSpecific_; } --- 126,132 ---- return stream << assertionType_ << assertionFormat_ ! << message_ ! << specific_ ! << isIgnoredFailure_; } *************** *** 139,144 **** >> assertionFormat_ >> message_ ! >> expectedSpecific_ ! >> actualSpecific_; } --- 137,142 ---- >> assertionFormat_ >> message_ ! >> specific_ ! >> isIgnoredFailure_; } *************** *** 167,171 **** { return stream << status_ - << subStatus_ << statusSpecific_ << statistics_; --- 165,168 ---- *************** *** 176,180 **** { return stream >> status_ - >> subStatus_ >> statusSpecific_ >> statistics_; --- 173,176 ---- |
From: Baptiste L. <bl...@us...> - 2005-11-14 21:28:17
|
Update of /cvsroot/cppunit/cppunit2/include/opentest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv576/include/opentest Modified Files: interfaces.h Log Message: - simplified interface a bit Index: interfaces.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/opentest/interfaces.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** interfaces.h 8 Nov 2005 20:25:49 -0000 1.5 --- interfaces.h 14 Nov 2005 21:28:08 -0000 1.6 *************** *** 127,132 **** { public: ! String log_; ! Json::Value logSpecific_; Stream &serialize( Stream &stream ) const; --- 127,131 ---- { public: ! Json::Value log_; Stream &serialize( Stream &stream ) const; *************** *** 140,145 **** String assertionFormat_; String message_; ! Json::Value expectedSpecific_; ! Json::Value actualSpecific_; Stream &serialize( Stream &stream ) const; --- 139,144 ---- String assertionFormat_; String message_; ! Json::Value specific_; ! bool isIgnoredFailure_; Stream &serialize( Stream &stream ) const; *************** *** 164,170 **** public: String status_; - String subStatus_; - Json::Value statusSpecific_; Json::Value statistics_; Stream &serialize( Stream &stream ) const; --- 163,168 ---- public: String status_; Json::Value statistics_; + Json::Value statusSpecific_; Stream &serialize( Stream &stream ) const; |
From: Baptiste L. <bl...@us...> - 2005-11-13 23:02:30
|
Update of /cvsroot/cppunit/cppunit2/doc/fake_stl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7919/doc/fake_stl Added Files: deque map set stdexcept string vector Log Message: - added fake_stl so that doxygen can figure out that runtime_error is in std namespace - improved documentation --- NEW FILE: map --- #ifndef FAKESTL_MAP_INCLUDED # define FAKESTL_MAP_INCLUDED /// \cond fakestl namespace std { template<typename T> class allocator; template< typename value_type, typename alloc=allocator<value_type> > class map { }; template< typename value_type, typename alloc=allocator<value_type> > class multimap { }; } // namespace std /// \endcond fakestl #endif // FAKESTL_MAP_INCLUDED --- NEW FILE: set --- #ifndef FAKESTL_SET_INCLUDED # define FAKESTL_SET_INCLUDED /// \cond fakestl namespace std { template<typename T> class allocator; template< typename value_type, typename alloc=allocator<value_type> > class set { }; template< typename value_type, typename alloc=allocator<value_type> > class multiset { }; } // namespace std /// \endcond #endif // FAKESTL_SET_INCLUDED --- NEW FILE: string --- #ifndef FAKESTL_STRING_INCLUDED # define FAKESTL_STRING_INCLUDED /// \cond fakestl namespace std { template<typename T> class allocator; template<typename T> class char_traits; template< typename char_type, typename traits=char_traits<char_type>, typename alloc=allocator<char_type> > class basic_string { }; typedef basic_string<char> string; } // namespace std /// \endcond #endif // FAKESTL_STRING_INCLUDED --- NEW FILE: deque --- #ifndef FAKESTL_DEQUE_INCLUDED # define FAKESTL_DEQUE_INCLUDED /// \cond fakestl namespace std { template<typename T> class allocator; template< typename value_type, typename alloc=allocator<value_type> > class deque { }; } // namespace std /// \endcond #endif // FAKESTL_DEQUE_INCLUDED --- NEW FILE: stdexcept --- #ifndef FAKESTL_STDEXCEPT_INCLUDED # define FAKESTL_STDEXCEPT_INCLUDED /// \cond fakestl namespace std { class exception { public: virtual ~exception() throw() {} }; class runtime_error : public exception { public: virtual ~runtime_error() throw() {} }; } // namespace std /// \endcond #endif // FAKESTL_STDEXCEPT_INCLUDED --- NEW FILE: vector --- #ifndef FAKESTL_VECTOR_INCLUDED # define FAKESTL_VECTOR_INCLUDED /// \cond fakestl namespace std { template<typename T> class allocator; template< typename value_type, typename alloc=allocator<value_type> > class vector { }; } // namespace std /// \endcond #endif // FAKESTL_VECTOR_INCLUDED |
From: Baptiste L. <bl...@us...> - 2005-11-13 23:02:30
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7919/include/cpput Modified Files: assertcommon.h testinfo.h Log Message: - added fake_stl so that doxygen can figure out that runtime_error is in std namespace - improved documentation Index: testinfo.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testinfo.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** testinfo.h 12 Nov 2005 20:55:46 -0000 1.19 --- testinfo.h 13 Nov 2005 23:02:16 -0000 1.20 *************** *** 19,22 **** --- 19,26 ---- { } + + virtual ~AbortingAssertionException() throw() + { + } }; *************** *** 30,33 **** --- 34,41 ---- { } + + virtual ~SkipTestException() throw() + { + } }; Index: assertcommon.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/assertcommon.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** assertcommon.h 13 Nov 2005 10:12:01 -0000 1.1 --- assertcommon.h 13 Nov 2005 23:02:16 -0000 1.2 *************** *** 450,457 **** * * \code ! * CPPUT_IGNORE_FAILURE(( CPPUT_ASSERT_EQUAL( 1, 2 )); * \endcode * ! * \warning Be sure to always use double brace around the macro parameter to avoid * preprocessor mess. */ --- 450,457 ---- * * \code ! * CPPUT_IGNORE_FAILURE(( CPPUT_ASSERT_EQUAL( 1, 2 ) )); * \endcode * ! * \warning Be sure to always use <b>double braces</b> around the macro parameter to avoid * preprocessor mess. */ |
From: Baptiste L. <bl...@us...> - 2005-11-13 23:02:30
|
Update of /cvsroot/cppunit/cppunit2/makefiles/vs71 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7919/makefiles/vs71 Modified Files: cpput_lib.vcproj Log Message: - added fake_stl so that doxygen can figure out that runtime_error is in std namespace - improved documentation Index: cpput_lib.vcproj =================================================================== RCS file: /cvsroot/cppunit/cppunit2/makefiles/vs71/cpput_lib.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cpput_lib.vcproj 7 Nov 2005 22:43:07 -0000 1.2 --- cpput_lib.vcproj 13 Nov 2005 23:02:17 -0000 1.3 *************** *** 143,151 **** </File> </Filter> <File RelativePath="..\..\src\cpput\assert.cpp"> </File> <File ! RelativePath="..\..\include\cpput\assert.h"> </File> <File --- 143,158 ---- </File> </Filter> + <Filter + Name="doc" + Filter=""> + <File + RelativePath="..\..\doc\cpput.dox"> + </File> + </Filter> <File RelativePath="..\..\src\cpput\assert.cpp"> </File> <File ! RelativePath="..\..\include\cpput\assertcommon.h"> </File> <File |
From: Baptiste L. <bl...@us...> - 2005-11-13 23:02:28
|
Update of /cvsroot/cppunit/cppunit2/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7919/doc Modified Files: cpput.dox doxyfile Log Message: - added fake_stl so that doxygen can figure out that runtime_error is in std namespace - improved documentation Index: doxyfile =================================================================== RCS file: /cvsroot/cppunit/cppunit2/doc/doxyfile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** doxyfile 13 Nov 2005 10:12:01 -0000 1.3 --- doxyfile 13 Nov 2005 23:02:16 -0000 1.4 *************** *** 74,78 **** # configuration options related to the input files #--------------------------------------------------------------------------- ! INPUT = ../include/cpptl ../include/cpput ../include/json ../src/cpptl ../src/cpput . # ../src/opentest ../include/opentest FILE_PATTERNS = *.h *.cpp *.inl *.dox --- 74,78 ---- # configuration options related to the input files #--------------------------------------------------------------------------- ! INPUT = ../include/cpptl ../include/cpput ../include/json ../src/cpptl ../src/cpput ./fake_stl . # ../src/opentest ../include/opentest FILE_PATTERNS = *.h *.cpp *.inl *.dox Index: cpput.dox =================================================================== RCS file: /cvsroot/cppunit/cppunit2/doc/cpput.dox,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** cpput.dox 12 Nov 2005 20:55:46 -0000 1.2 --- cpput.dox 13 Nov 2005 23:02:16 -0000 1.3 *************** *** 6,14 **** This is a *very early* documenation release and is very incomplete (including this page). ! \section _intro Introduction CppUnit 2 is a test framework for C++. ! \section _features Features - support aborting and non-aborting assertions - rich collection of assertions --- 6,27 ---- This is a *very early* documenation release and is very incomplete (including this page). ! \section section_toc Table of Contents ! ! - \ref section_intro ! - \ref section_features ! - \ref section_writing_test ! - \ref section_assertions ! - \ref section_ignore_assertion_failure ! - \ref section_logevent ! - \ref section_skippingtest ! - \ref section_projectlinks ! - \ref section_license ! ! ! \section section_intro Introduction CppUnit 2 is a test framework for C++. ! \section section_features Features - support aborting and non-aborting assertions - rich collection of assertions *************** *** 20,30 **** - ... ! \section _plinks Project links - <a HREF="http://cppunit.sourceforge.net">cppunit home</a> - <a HREF="http://www.sourceforge.net/projects/cppunit">cppunit sourceforge project</a> \section _rlinks Related links - <a HREF="http://www.json.org/">JSON</a> Specification and alternate language implementations. --- 33,194 ---- - ... + \section section_writing_test Writing tests + \subsection section_assertions Making assertions + When writing unit test, you check that the tested code behave as expected using + assertions. In CppUnit 2 each assertion is provides in two forms: + - as an aborting assertion + - as a non-aborting assertion (a.k.a. checking assertion) + The difference between aborting and non-aborting assertions is that if an aborting + assertion fails then the test is aborted, while if a non-aborting assertion failed, + then the assertion is logged and the test continue. In CppUnit 1 only aborting assertion + were provided. ! When an aborting assertion failed, it throws the exception ! CppUT::AbortingAssertionException to abort the test. You must ensure that your test ! let this exception pass through (notes that it subclasses std::runtime_error). ! ! All assertions are macros (to capture source location). By convention, ! the following naming prefix are used do distinguish aborting and non-aborting assertion: ! - CPPUT_ASSERT : aborting assertion ! - CPPUT_CHECK : non-arborting assertion ! ! In the table below, all supported assertions without the above prefix will be listed. ! ! <table> ! <tr><td>Suffix</td> <td>Parameters</td> <td>Asserts that...</td> ! <tr><td></td> ! <td>\c expression, [\c message]</td> ! <td> \c expression is \c true </td> ! </tr> ! <tr><td>_EXPR</td> ! <td>\c expression</td> ! <td> \c expression is \c true </td> ! </tr> ! <tr><td>_FALSE</td> ! <td>\c expression, [\c message]</td> ! <td>\c expression is \c false</td> ! </tr> ! <tr><td>_EXPR_FALSE</td> ! <td>\c expression</td> ! <td>\c expression is \c false</td> ! </tr> ! <tr><td>_EQUAL</td> ! <td>\c expected_value, \c actual_value, [\c message]</td> ! <td>\c expected_value == \c actual_value</td> ! </tr> ! <tr><td>_NOT_EQUAL</td> ! <td>\c expected_value, \c actual_value, [\c message]</td> ! <td>\c expected_value != \c actual_value</td> ! </tr> ! <tr><td>_DOUBLE_EQUAL</td> ! <td>\c expected_value, \c actual_value, \c tolerance, [\c message]</td> ! <td>\c fabs(\c expected_value - \c actual_value) <= \c tolerance</td> ! </tr> ! <tr><td>_THROW</td> ! <td>\c expression, \c ExpectedExceptionType</td> ! <td>\c expression throws an exception of type ExpectedExceptionType</td> ! </tr> ! <tr><td>_NO_THROW</td> ! <td>\c expression</td> ! <td>\c expression does not throw any exceptions</td> ! </tr> ! <tr><td>_ASSERTION_FAIL_MESSAGE</td> ! <td>\c assertion, \c message</td> ! <td>\c assertion fails</td> ! </tr> ! <tr><td>_ASSERTION_FAIL</td> ! <td>\c assertion</td> ! <td>\c assertion fails</td> ! </tr> ! <tr><td>_ASSERTION_PASS_MESSAGE</td> ! <td>\c assertion, \c message</td> ! <td>\c assertion passes</td> ! </tr> ! <tr><td>_ASSERTION_PASS</td> ! <td>\c assertion</td> ! <td>\c assertion passes</td> ! </tr> ! <tr><td>STR_START</td> ! <td>\c pattern, \c actual_string</td> ! <td>\c actual_string starts with \c pattern</td> ! </tr> ! <tr><td>STR_END</td> ! <td>\c pattern, \c actual_string</td> ! <td>\c actual_string ends with \c pattern</td> ! </tr> ! <tr><td>STR_END</td> ! <td>\c pattern, \c actual_string</td> ! <td>\c actual_string ends with \c pattern</td> ! </tr> ! <tr><td>STR_CONTAIN</td> ! <td>\c pattern, \c actual_string</td> ! <td>\c actual_string contains \c pattern</td> ! </tr> ! <tr><td>STR_EQUAL</td> ! <td>\c pattern, \c actual_string</td> ! <td>\c actual_string contains \c pattern</td> ! </tr> ! <tr><td>_SEQUENCE_EQUAL</td> ! <td>\c expected_ordered_sequence, \c actual_ordered_sequence</td> ! <td>\c expected_ordered_sequence and \c actual_ordered_sequence contains ! the same value in the same order.</td> ! </tr> ! <tr><td>_SET_EQUAL</td> ! <td>\c expected_unordered, \c actual_unordered_sequence</td> ! <td>\c expected_ordered_sequence and \c actual_ordered_sequence contains ! the same value regardless of the order.</td> ! </tr> ! <tr><td>_STL_SEQUENCE_EQUAL</td> ! <td>\c expected_ordered_sequence, \c actual_ordered_sequence</td> ! <td>\c expected_ordered_sequence and \c actual_ordered_sequence contains ! the same value in the same order.</td> ! </tr> ! <tr><td>_STL_SET_EQUAL</td> ! <td>\c expected_unordered, \c actual_unordered_sequence</td> ! <td>\c expected_ordered_sequence and \c actual_ordered_sequence contains ! the same value regardless of the order.</td> ! </tr> ! </table> ! ! See module \ref group_assertions for the list of assertion macros. ! ! [[notes: add double brace warning about macro parameter]] ! ! \subsection section_ignore_assertion_failure Ignoring specific assertion failures ! ! During a test, it is also possible to ignore an assertion failure. This is useful ! for example when doing some large refactoring that takes days and cause some test to break ! temporarily. With this feature, it is possible to indicate that some assertions are expected ! to fail and the test should not be considered to have failed. The assertion failure is ! still logged. ! ! Use CPPUT_IGNORE_FAILURE() to ignore an assertion failure. See ignore_failure_demo for ! an example. ! ! \subsection section_logevent Loggin events ! ! Often the same set of assertions is used in a loop over some input data. If a failure ! occurs, it is not possible to know on which iteration the failure occurred (unless the ! iteration was specified in the optional \c message parameter of the assertion). ! ! CppUT::log() can be used to log a context. The list of log events and assertion failures ! is seen as a single test event sequence. See log_demo for an example. ! ! \subsection section_skippingtest Skipping a test ! ! It is possible to force a test to be skipped using CPPUT_SKIP_TEST. The test status will ! be set to CppUT::TestStatus::skipped unless a failure occurred before. ! ! Notes that a SkipTestException exception (a subclass of std::runtime_error) is thrown ! to abort the test. ! ! \section section_projectlinks Project links - <a HREF="http://cppunit.sourceforge.net">cppunit home</a> - <a HREF="http://www.sourceforge.net/projects/cppunit">cppunit sourceforge project</a> + + \section _rlinks Related links - <a HREF="http://www.json.org/">JSON</a> Specification and alternate language implementations. *************** *** 32,38 **** - <a HREF="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode FAQ</a>. ! \section _license License ! This documentation is in public domain. The CppTL library is in public domain. The CppUT and OpenTest library are under the LGPL with run-time exception. --- 196,203 ---- - <a HREF="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode FAQ</a>. ! ! \section section_license License The CppTL library is in public domain. + The CppUT and OpenTest library are under the LGPL with run-time exception. *************** *** 42,46 **** /*! \defgroup group_assertions Assertions ! */ /*! \defgroup group_custom_assertions Creating new assertions --- 207,211 ---- /*! \defgroup group_assertions Assertions ! */ /*! \defgroup group_custom_assertions Creating new assertions |
From: Baptiste L. <bl...@us...> - 2005-11-13 22:04:10
|
Update of /cvsroot/cppunit/cppunit2/doc/fake_stl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29996/fake_stl Log Message: Directory /cvsroot/cppunit/cppunit2/doc/fake_stl added to the repository |
From: Baptiste L. <bl...@us...> - 2005-11-13 11:00:49
|
Update of /cvsroot/cppunit/cppunit2/include/cpptl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18861/include/cpptl Modified Files: intrusiveptr.h Log Message: - inlined IntrusivePtrBase in IntrusivePtr. Index: intrusiveptr.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/intrusiveptr.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** intrusiveptr.h 13 Nov 2005 10:12:01 -0000 1.2 --- intrusiveptr.h 13 Nov 2005 11:00:41 -0000 1.3 *************** *** 44,104 **** namespace CppTL { - /// \cond implementation_detail - namespace Impl { - - /// Smart-pointer base class - class IntrusivePtrBase - { - public: - operator bool() const - { - return p_ != 0; - } - - bool operator !() const - { - return p_ == 0; - } - protected: - IntrusivePtrBase() - : p_( 0 ) - { - } - - IntrusivePtrBase( void *p ) - : p_( p ) - { - } - - IntrusivePtrBase( const IntrusivePtrBase &other ) - : p_( other.p_ ) - { - } - - void swap( IntrusivePtrBase &other ) - { - CppTL::swap( p_, other.p_ ); - } - - void *get() const - { - return p_; - } - - void *deref() const - { - // assert( p_ != 0 ) - return p_; - } - - //private: // Friend template function is not well supported - // Private access required by function staticPointerCast<> - public: - void *p_; - }; - - } // namespace Impl - /// \endcond - inline void instrusivePtrAddRef( IntrusiveCount *p ) { --- 44,47 ---- *************** *** 111,128 **** } - /// \todo inline Impl::IntrusivePtrBase into this class: it makes debugging more complex template<class PointeeType> ! class IntrusivePtr : public Impl::IntrusivePtrBase { public: typedef IntrusivePtr<PointeeType> ThisType; - typedef Impl::IntrusivePtrBase SuperClass; IntrusivePtr() { } IntrusivePtr( PointeeType *p ) ! : SuperClass( p ) { if ( p ) --- 54,70 ---- } template<class PointeeType> ! class IntrusivePtr { public: typedef IntrusivePtr<PointeeType> ThisType; IntrusivePtr() + : p_( 0 ) { } IntrusivePtr( PointeeType *p ) ! : p_( p ) { if ( p ) *************** *** 131,138 **** IntrusivePtr( const ThisType &other ) ! : Impl::IntrusivePtrBase( other ) { if ( p_ ) ! instrusivePtrAddRef( get() ); } --- 73,80 ---- IntrusivePtr( const ThisType &other ) ! : p_( other.p_ ) { if ( p_ ) ! instrusivePtrAddRef( p_ ); } *************** *** 140,144 **** { if ( p_ ) ! intrusivePtrRelease( get() ); } --- 82,86 ---- { if ( p_ ) ! intrusivePtrRelease( p_ ); } *************** *** 157,169 **** PointeeType *get() const { ! return static_cast<PointeeType *>( IntrusivePtrBase::get() ); } ! void swap( IntrusivePtr &other ) { ! SuperClass::swap( other ); } ! ThisType &operator =( const IntrusivePtr &other ) { ThisType tmp( other ); --- 99,111 ---- PointeeType *get() const { ! return p_; } ! void swap( ThisType &other ) { ! CppTL::swap( p_, other.p_ ); } ! ThisType &operator =( const ThisType &other ) { ThisType tmp( other ); *************** *** 175,185 **** { // assert( p_ != 0 ) ! return *( static_cast<PointeeType *>( p_ ) ); } PointeeType *operator ->() const { ! return static_cast<PointeeType *>( SuperClass::deref() ); } }; --- 117,140 ---- { // assert( p_ != 0 ) ! return *p_; } PointeeType *operator ->() const { ! return p_; } + + operator bool() const + { + return p_ != 0; + } + + bool operator !() const + { + return p_ == 0; + } + + private: + PointeeType *p_; }; |
From: Baptiste L. <bl...@us...> - 2005-11-13 10:18:06
|
Update of /cvsroot/cppunit/cppunit2/examples/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11676/examples/common Modified Files: examplecommon.h Log Message: - renamed include/cpput/assert.h to include/cpput/assertion.h Index: examplecommon.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/examples/common/examplecommon.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** examplecommon.h 8 Aug 2005 22:07:58 -0000 1.1 --- examplecommon.h 13 Nov 2005 10:17:57 -0000 1.2 *************** *** 5,9 **** #include <cpput/lighttestrunner.h> //#include <cpput/testrunner.h> // cppunit2 testrunner for opentest ! #include <cpput/assert.h> inline int runExampleTests( int argc, --- 5,9 ---- #include <cpput/lighttestrunner.h> //#include <cpput/testrunner.h> // cppunit2 testrunner for opentest ! #include <cpput/assertcommon.h> inline int runExampleTests( int argc, |
From: Baptiste L. <bl...@us...> - 2005-11-13 10:18:05
|
Update of /cvsroot/cppunit/cppunit2/examples/parametrized_test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11676/examples/parametrized_test Modified Files: main.cpp Log Message: - renamed include/cpput/assert.h to include/cpput/assertion.h Index: main.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/examples/parametrized_test/main.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** main.cpp 8 Aug 2005 22:07:58 -0000 1.2 --- main.cpp 13 Nov 2005 10:17:57 -0000 1.3 *************** *** 1,5 **** #include <examples/common/examplecommon.h> #include <cpput/testcase.h> - #include <cpput/assert.h> --- 1,4 ---- |
From: Baptiste L. <bl...@us...> - 2005-11-13 10:12:12
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10041/src/cpputtest Modified Files: assertstringtest.h commandlineoptionstest.h enumeratortest.h reflectiontest.h registrytest.h testbasicassertion.cpp testexceptionguard.cpp testfixturetest.h testfunctor.cpp testfunctor3.cpp testinfotest.cpp testtestcase.cpp testtestrunresult.cpp testtestsuite.cpp Log Message: - renamed include/cpput/assert.h to include/cpput/assertcommon.h. This avoid clash with include <assert.h> in doxygen documentation - most Impl namespaces are now hidden from documentation using \cond and \endcond. Index: testtestrunresult.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestrunresult.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testtestrunresult.cpp 20 Nov 2004 12:17:52 -0000 1.5 --- testtestrunresult.cpp 13 Nov 2005 10:12:01 -0000 1.6 *************** *** 1,4 **** #include <cpput/testrunresult.h> ! #include <cpput/assert.h> #include <cpput/resultexception.h> #include <cpput/test.h> --- 1,4 ---- #include <cpput/testrunresult.h> ! #include <cpput/assertcommon.h> #include <cpput/resultexception.h> #include <cpput/test.h> Index: reflectiontest.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/reflectiontest.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** reflectiontest.h 3 Mar 2005 08:15:54 -0000 1.1 --- reflectiontest.h 13 Nov 2005 10:12:01 -0000 1.2 *************** *** 2,6 **** # define CPPUT_REFLECTIONTEST_H ! # include <cpput/assert.h> # include <cpput/testfixture.h> --- 2,6 ---- # define CPPUT_REFLECTIONTEST_H ! # include <cpput/assertcommon.h> # include <cpput/testfixture.h> Index: testtestsuite.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestsuite.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** testtestsuite.cpp 10 Aug 2005 21:34:29 -0000 1.9 --- testtestsuite.cpp 13 Nov 2005 10:12:01 -0000 1.10 *************** *** 1,3 **** ! #include <cpput/assert.h> #include <cpput/testcase.h> #include <cpput/testsuite.h> --- 1,3 ---- ! #include <cpput/assertcommon.h> #include <cpput/testcase.h> #include <cpput/testsuite.h> Index: testexceptionguard.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testexceptionguard.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testexceptionguard.cpp 11 Nov 2005 20:54:15 -0000 1.3 --- testexceptionguard.cpp 13 Nov 2005 10:12:01 -0000 1.4 *************** *** 1,3 **** ! #include <cpput/assert.h> #include <cpput/exceptionguard.h> #include <cpptl/functor.h> --- 1,3 ---- ! #include <cpput/assertcommon.h> #include <cpput/exceptionguard.h> #include <cpptl/functor.h> Index: commandlineoptionstest.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/commandlineoptionstest.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** commandlineoptionstest.h 27 Feb 2005 10:17:06 -0000 1.3 --- commandlineoptionstest.h 13 Nov 2005 10:12:01 -0000 1.4 *************** *** 2,6 **** #define CPPUT_COMMANDLINEOPTIONS_H_INCLUDED ! # include <cpput/assert.h> # include <cpput/testfixture.h> # include <cpput/registry.h> --- 2,6 ---- #define CPPUT_COMMANDLINEOPTIONS_H_INCLUDED ! # include <cpput/assertcommon.h> # include <cpput/testfixture.h> # include <cpput/registry.h> Index: assertstringtest.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/assertstringtest.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** assertstringtest.h 27 Jan 2004 20:34:36 -0000 1.1.1.1 --- assertstringtest.h 13 Nov 2005 10:12:01 -0000 1.2 *************** *** 2,6 **** # define CPPUT_ASSERTSTRINGTEST_H_INCLUDED ! # include <cpput/assert.h> # include <cpput/testfixture.h> --- 2,6 ---- # define CPPUT_ASSERTSTRINGTEST_H_INCLUDED ! # include <cpput/assertcommon.h> # include <cpput/testfixture.h> Index: enumeratortest.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/enumeratortest.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** enumeratortest.h 22 Oct 2004 06:20:07 -0000 1.3 --- enumeratortest.h 13 Nov 2005 10:12:01 -0000 1.4 *************** *** 2,6 **** # define CPPUT_ENUMERATORTEST_H ! # include <cpput/assert.h> # include <cpput/testfixture.h> # include <cpptl/enumerator.h> --- 2,6 ---- # define CPPUT_ENUMERATORTEST_H ! # include <cpput/assertcommon.h> # include <cpput/testfixture.h> # include <cpptl/enumerator.h> Index: testinfotest.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testinfotest.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testinfotest.cpp 11 Nov 2005 23:25:09 -0000 1.1 --- testinfotest.cpp 13 Nov 2005 10:12:01 -0000 1.2 *************** *** 1,3 **** ! #include <cpput/assert.h> #include <cpput/testcase.h> #include <cpput/assertenum.h> --- 1,3 ---- ! #include <cpput/assertcommon.h> #include <cpput/testcase.h> #include <cpput/assertenum.h> Index: testfixturetest.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfixturetest.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testfixturetest.h 8 Nov 2005 23:25:31 -0000 1.7 --- testfixturetest.h 13 Nov 2005 10:12:01 -0000 1.8 *************** *** 2,6 **** #define CPPUTTEST_TESTFIXTURETEST_H_INCLUDED ! # include <cpput/assert.h> # include <cpput/testfixture.h> --- 2,6 ---- #define CPPUTTEST_TESTFIXTURETEST_H_INCLUDED ! # include <cpput/assertcommon.h> # include <cpput/testfixture.h> Index: registrytest.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/registrytest.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** registrytest.h 8 Nov 2005 23:25:31 -0000 1.5 --- registrytest.h 13 Nov 2005 10:12:01 -0000 1.6 *************** *** 3,7 **** # include <cpptl/sharedptr.h> ! # include <cpput/assert.h> # include <cpput/testfixture.h> # include <cpput/registry.h> --- 3,7 ---- # include <cpptl/sharedptr.h> ! # include <cpput/assertcommon.h> # include <cpput/testfixture.h> # include <cpput/registry.h> Index: testfunctor3.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfunctor3.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testfunctor3.cpp 26 Feb 2005 11:40:58 -0000 1.1 --- testfunctor3.cpp 13 Nov 2005 10:12:01 -0000 1.2 *************** *** 1,3 **** ! #include <cpput/assert.h> #include <cpptl/functor.h> #include <iostream> --- 1,3 ---- ! #include <cpput/assertcommon.h> #include <cpptl/functor.h> #include <iostream> Index: testbasicassertion.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testbasicassertion.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** testbasicassertion.cpp 10 Aug 2005 21:34:29 -0000 1.10 --- testbasicassertion.cpp 13 Nov 2005 10:12:01 -0000 1.11 *************** *** 1,3 **** ! #include <cpput/assert.h> #include <stdio.h> #include <stdexcept> --- 1,3 ---- ! #include <cpput/assertcommon.h> #include <stdio.h> #include <stdexcept> Index: testtestcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testtestcase.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** testtestcase.cpp 8 Nov 2005 21:44:55 -0000 1.18 --- testtestcase.cpp 13 Nov 2005 10:12:01 -0000 1.19 *************** *** 1,3 **** ! #include <cpput/assert.h> #include <cpput/testcase.h> #include <stdio.h> --- 1,3 ---- ! #include <cpput/assertcommon.h> #include <cpput/testcase.h> #include <stdio.h> Index: testfunctor.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpputtest/testfunctor.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** testfunctor.cpp 10 Aug 2005 21:34:29 -0000 1.11 --- testfunctor.cpp 13 Nov 2005 10:12:01 -0000 1.12 *************** *** 1,3 **** ! #include <cpput/assert.h> #include <cpptl/functor.h> #include <stdio.h> --- 1,3 ---- ! #include <cpput/assertcommon.h> #include <cpptl/functor.h> #include <stdio.h> |
From: Baptiste L. <bl...@us...> - 2005-11-13 10:12:09
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10041/include/cpput Modified Files: assertenum.h assertstring.h equality.h stringize.h testfixture.h Added Files: assertcommon.h Removed Files: assert.h Log Message: - renamed include/cpput/assert.h to include/cpput/assertcommon.h. This avoid clash with include <assert.h> in doxygen documentation - most Impl namespaces are now hidden from documentation using \cond and \endcond. Index: assertenum.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/assertenum.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** assertenum.h 11 Nov 2005 23:23:48 -0000 1.11 --- assertenum.h 13 Nov 2005 10:12:01 -0000 1.12 *************** *** 2,6 **** # define CPPUT_ASSERTENUM_H_INCLUDED ! # include <cpput/assert.h> # include <cpptl/enumerator.h> # include <functional> --- 2,6 ---- # define CPPUT_ASSERTENUM_H_INCLUDED ! # include <cpput/assertcommon.h> # include <cpptl/enumerator.h> # include <functional> *************** *** 55,58 **** --- 55,59 ---- + /// \cond implementation_detail namespace Impl { *************** *** 119,122 **** --- 120,124 ---- } // namespace Impl + /// \endcond template<class ExpectedEnumerator --- assert.h DELETED --- Index: testfixture.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testfixture.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** testfixture.h 11 Nov 2005 23:23:48 -0000 1.13 --- testfixture.h 13 Nov 2005 10:12:01 -0000 1.14 *************** *** 43,46 **** --- 43,47 ---- + /// \cond implementation_detail namespace Impl { *************** *** 92,95 **** --- 93,97 ---- }; } // namespace Impl + /// \endcond implementation_detail Index: stringize.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/stringize.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** stringize.h 12 Nov 2005 20:55:46 -0000 1.10 --- stringize.h 13 Nov 2005 10:12:01 -0000 1.11 *************** *** 160,163 **** --- 160,164 ---- #endif + /// \cond implementation_detail namespace Impl { *************** *** 187,190 **** --- 188,193 ---- } // namespace Impl + /// \endcond implementation_detail + /*! \ingroup group_assertions_support Index: assertstring.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/assertstring.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** assertstring.h 11 Nov 2005 23:23:48 -0000 1.4 --- assertstring.h 13 Nov 2005 10:12:01 -0000 1.5 *************** *** 2,6 **** # define CPPUT_ASSERTSTRING_H_INCLUDED ! # include <cpput/assert.h> namespace CppUT { --- 2,6 ---- # define CPPUT_ASSERTSTRING_H_INCLUDED ! # include <cpput/assertcommon.h> namespace CppUT { --- NEW FILE: assertcommon.h --- #ifndef CPPUT_ASSERT_H_INCLUDED # define CPPUT_ASSERT_H_INCLUDED # include <cpput/equality.h> # include <cpput/message.h> # include <cpput/stringize.h> # include <cpput/testinfo.h> # include <cpput/translate.h> # include <cpptl/typename.h> namespace CppUT { void CPPUT_API fail( const Message &message = translate( "Assertion failed." ) ); void CPPUT_API checkTrue( bool shouldBeTrue, const Message &message = Message() ); void CPPUT_API checkFalse( bool shouldBeFalse, const Message &message = Message() ); void CPPUT_API checkAssertionFail( bool assertionFailed, const Message &message = Message() ); void CPPUT_API checkAssertionPass( bool assertionFailed, const Message &message = Message() ); Message CPPUT_API buildEqualityFailedMessage( const std::string &expected, const std::string &actual, const Message &message = Message() ); template<typename FirstType ,typename SecondType> Message makeEqualityFailedMessage( const FirstType &expected, const SecondType &actual, const Message &message = Message() ) { std::string strExpected = stringize( expected ); std::string strActual = stringize( actual ); return buildEqualityFailedMessage( strExpected, strActual, message ); } template<typename FirstType ,typename SecondType ,typename EqualityFunctorType> void checkEquals( const FirstType &expected, const SecondType &actual, EqualityFunctorType equality, const Message &message ) { if ( equality( expected, actual ) ) return; fail( makeEqualityFailedMessage( expected, actual, message ) ); } template<typename FirstType ,typename SecondType> void checkEquals( const FirstType &expected, const SecondType &actual, const Message &message = Message() ) { if ( equalityTest( expected, actual ) ) return; fail( makeEqualityFailedMessage( expected, actual, message ) ); } Message CPPUT_API buildUnequalityFailedMessage( const std::string &expected, const std::string &actual, const Message &message = Message() ); template<typename FirstType ,typename SecondType> Message makeUnequalityFailedMessage( const FirstType &expected, const SecondType &actual, const Message &message = Message() ) { std::string strExpected = stringize( expected ); std::string strActual = stringize( actual ); return buildUnequalityFailedMessage( strExpected, strActual, message ); } template<typename FirstType ,typename SecondType ,typename EqualityFunctorType> void checkNotEquals( const FirstType &expected, const SecondType &actual, EqualityFunctorType equality, const Message &message ) { if ( !( equality( expected, actual ) ) ) return; fail( makeUnequalityFailedMessage( expected, actual, message ) ); } template<typename FirstType ,typename SecondType> void checkNotEquals( const FirstType &expected, const SecondType &actual, const Message &message = Message() ) { if ( !( equalityTest( expected, actual ) ) ) return; fail( makeUnequalityFailedMessage( expected, actual, message ) ); } void CPPUT_API checkDoubleEquals( double expected, double actual, double tolerance, const Message &message = Message() ); void CPPUT_API skipCurrentTest(); } // namespace CppUT /*! Starts either an aborting assertion or a checking assertion macro. * \ingroup group_custom_assertions * \internal * __func__ should contains the current fonction name on many compiler (C99 compiler extension). See: * http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.vacpp7a.doc/language/ref/clrc02predefined_identifiers.htm * Available if __C99__FUNC__ is defined: * http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.vacpp7a.doc/language/ref/clrapxaix_macros.htm */ # define CPPUT_CHECK_POINT( assertionType ) \ ::CppUT::TestInfo::threadInstance().newAssertion( ::CppUT::assertionType, \ __FILE__, \ __LINE__ ) /*! Starts an aborting assertion macro. * \ingroup group_custom_assertions */ # define CPPUT_BEGIN_ASSERTION_MACRO() \ CPPUT_CHECK_POINT( abortingAssertion ), /*! Starts a checking assertion macro. * \ingroup group_custom_assertions */ # define CPPUT_BEGIN_CHECKING_MACRO() \ CPPUT_CHECK_POINT( checkingAssertion ), // basic assertions /*! \brief Always fails with the given message. * \ingroup group_assertions * \see CppUT::fail */ # define CPPUT_FAIL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::fail /*! \brief Asserts that an expression evaluate to true. * \ingroup group_assertions * \see CppUT::checkTrue */ # define CPPUT_ASSERT \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkTrue /*! \brief Checks that an expression evaluate to true. * \ingroup group_assertions * \see CppUT::checkTrue */ # define CPPUT_CHECK \ CPPUT_BEGIN_CHECKING_MACRO() \ ::CppUT::checkTrue /*! \brief Asserts that an expression evaluate to true. * \ingroup group_assertions * The expression source code is written in the assertion diagnostic in case of failure. * \see CppUT::checkTrue */ # define CPPUT_ASSERT_EXPR( expression ) \ CPPUT_ASSERT( (expression), #expression ) /*! \brief Checks that an expression evaluate to true. * \ingroup group_assertions * The expression source code is written in the assertion diagnostic in case of failure. * \see CppUT::checkTrue */ # define CPPUT_CHECK_EXPR( expression ) \ CPPUT_CHECK( (expression), #expression ) /*! \brief Asserts that an expression evaluate to false. * \ingroup group_assertions * \see CppUT::checkFalse */ # define CPPUT_ASSERT_FALSE \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkFalse /*! \brief Checks that an expression evaluate to false. * \ingroup group_assertions * \see CppUT::checkFalse */ # define CPPUT_CHECK_FALSE \ CPPUT_BEGIN_CHECKING_MACRO() \ ::CppUT::checkFalse /*! \brief Asserts that an expression evaluate to false. * \ingroup group_assertions * The expression source code is written in the assertion diagnostic in case of failure. * \see CppUT::checkFalse */ # define CPPUT_ASSERT_EXPR_FALSE( expression ) \ CPPUT_ASSERT_FALSE( (expression), #expression ) /*! \brief Checks that an expression evaluate to false. * \ingroup group_assertions * The expression source code is written in the assertion diagnostic in case of failure. * \see CppUT::checkFalse */ # define CPPUT_CHECK_EXPR_FALSE( expression ) \ CPPUT_CHECK_FALSE( (expression), #expression ) /*! \brief Asserts that two values are equal. * \ingroup group_assertions * - The values must be comparable using CppUT::equalityTest * - The values must be convertible to std::string using CppUT::stringize * \see CppUT::checkEquals */ # define CPPUT_ASSERT_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkEquals /*! \brief Checks that two values are equal. * \ingroup group_assertions * - The values must be comparable using CppUT::equalityTest * - The values must be convertible to std::string using CppUT::stringize * \see CppUT::checkEquals */ # define CPPUT_CHECK_EQUAL \ CPPUT_BEGIN_CHECKING_MACRO() \ ::CppUT::checkEquals /*! \brief Asserts that two values are not equal. * \ingroup group_assertions * - The values must be comparable using CppUT::equalityTest * - The values must be convertible to std::string using CppUT::stringize * \see CppUT::checkNotEquals */ # define CPPUT_ASSERT_NOT_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkNotEquals /*! \brief Checks that two values are not equal. * \ingroup group_assertions * - The values must be comparable using CppUT::equalityTest * - The values must be convertible to std::string using CppUT::stringize * \see CppUT::checkNotEquals */ # define CPPUT_CHECK_NOT_EQUAL \ CPPUT_BEGIN_CHECKING_MACRO() \ ::CppUT::checkNotEquals /*! \brief Asserts that two double are equals given a tolerance * \ingroup group_assertions * \see ::CppUT::checkDoubleEquals */ # define CPPUT_ASSERT_DOUBLE_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkDoubleEquals /*! \brief Checks that two double are equals given a tolerance * \ingroup group_assertions * \see ::CppUT::checkDoubleEquals */ # define CPPUT_CHECK_DOUBLE_EQUAL \ CPPUT_BEGIN_CHECKING_MACRO() \ ::CppUT::checkDoubleEquals /*! \internal */ # define _CPPUT_ASSERT_THROW_IMPL( assertionType, expression, ExceptionType ) \ do { \ CPPUT_CHECK_POINT( assertionType ); \ bool cpputExceptionThrown_ = false; \ try { \ expression; \ } catch ( const ExceptionType & ) { \ cpputExceptionThrown_ = true; \ } \ \ if ( cpputExceptionThrown_ ) \ break; \ \ ::CppUT::fail( "Expected exception: " #ExceptionType \ " not thrown." ); \ } while ( false ) /*! \brief Asserts that an expression throw an exception of a specified type * \ingroup group_assertions */ # define CPPUT_ASSERT_THROW( expression, ExceptionType ) \ _CPPUT_ASSERT_THROW_IMPL( abortingAssertion, expression, ExceptionType ) /*! \brief Checks that an expression throw an exception of a specified type * \ingroup group_assertions */ # define CPPUT_CHECK_THROW( expression, ExceptionType ) \ _CPPUT_CHECK_THROW_IMPL( checkingAssertion, expression, ExceptionType ) /*! \internal */ # define _CPPUT_ASSERT_NO_THROW_IMPL( assertionType, expression ) \ try { \ CPPUT_CHECK_POINT( assertionType ); \ expression; \ } catch ( const std::exception &e ) { \ ::CppUT::Message message( "Unexpected exception caught" ); \ message.add( "Type: " + \ ::CppTL::getObjectTypeName( e, "std::exception" ) ); \ message.add( std::string("What: ") + e.what() ); \ ::CppUT::fail( message ); \ } catch ( ... ) { \ ::CppUT::fail( "Unexpected exception caught" ); \ } /*! \brief Asserts that an expression does not throw any exception * \ingroup group_assertions */ # define CPPUT_ASSERT_NO_THROW( expression ) \ _CPPUT_ASSERT_NO_THROW_IMPL( abortingAssertion, expression ) /*! \brief Checks that an expression does not throw any exception * \ingroup group_assertions */ # define CPPUT_CHECK_NO_THROW( expression ) \ _CPPUT_ASSERT_NO_THROW_IMPL( checkingAssertion, expression ) /*! \internal * Notes: implementing that assertion checking is a bit tricky since all the state * about the current test/assertions is stored in a "static" and * we don't want the tested assertion to polute the test result * of the current test. * TestInfo::ScopedContextOverride is used to create a temporary * context for the tested assertion. After the assertion, the * result of the assertion (did it failed), and the test result * properties are captured for later inspection. */ # define _CPPUT_ASSERT_ASSERTION_FAIL_MESSAGE_IMPL( assertionType, assertion, message ) \ { \ CPPUT_CHECK_POINT( assertionType ); \ bool assertionFailedCppUT_ = false; \ { \ ::CppUT::TestInfo::ScopedContextOverride contextSwitchCppUT_; \ try { \ assertion; \ } catch ( const ::CppUT::AbortingAssertionException & ) { \ } \ assertionFailedCppUT_ = ::CppUT::TestInfo::threadInstance().testStatus().hasFailed(); \ } \ ::CppUT::checkAssertionFail( assertionFailedCppUT_, message ); \ } /*! \brief Asserts that an assertion fails (for use to unit test custom assertion) * \ingroup group_assertions */ # define CPPUT_ASSERT_ASSERTION_FAIL_MESSAGE( assertion, message ) \ _CPPUT_ASSERT_ASSERTION_FAIL_MESSAGE_IMPL( abortingAssertion, assertion, message ) /*! \brief Checks that an assertion fails (for use to unit test custom assertion) * \ingroup group_assertions */ # define CPPUT_CHECK_ASSERTION_FAIL_MESSAGE( assertion, message ) \ _CPPUT_CHECK_ASSERTION_FAIL_MESSAGE_IMPL( checkingAssertion, assertion, message ) /*! \brief Asserts that an assertion fails (for use to unit test custom assertion) * \ingroup group_assertions */ # define CPPUT_ASSERT_ASSERTION_FAIL( assertion ) \ CPPUT_ASSERT_ASSERTION_FAIL_MESSAGE( assertion, ::CppUT::Message() ) /*! \brief Checks that an assertion fails (for use to unit test custom assertion) * \ingroup group_assertions */ # define CPPUT_CHECK_ASSERTION_FAIL( assertion ) \ CPPUT_CHECK_ASSERTION_FAIL_MESSAGE( assertion, ::CppUT::Message() ) /*! \internal */ # define _CPPUT_ASSERT_ASSERTION_PASS_MESSAGE_IMPL( assertionType, assertion, message ) \ { \ CPPUT_CHECK_POINT( assertionType ); \ bool assertionFailedCppUT_ = false; \ { \ ::CppUT::TestInfo::ScopedContextOverride contextSwitchCppUT_; \ try { \ assertion; \ } catch ( const ::CppUT::AbortingAssertionException & ) { \ } \ assertionFailedCppUT_ = ::CppUT::TestInfo::threadInstance().testStatus().hasFailed(); \ } \ ::CppUT::checkAssertionPass( assertionFailedCppUT_, message ); \ } /*! \brief Asserts that an assertion is successful (for use to unit test custom assertion) * \ingroup group_assertions */ # define CPPUT_ASSERT_ASSERTION_PASS_MESSAGE( assertion, message ) \ _CPPUT_ASSERT_ASSERTION_PASS_MESSAGE_IMPL( abortingAssertion, assertion, message ) /*! \brief Checks that an assertion is successful (for use to unit test custom assertion) * \ingroup group_assertions */ # define CPPUT_CHECK_ASSERTION_PASS_MESSAGE( assertion, message ) \ _CPPUT_CHECK_ASSERTION_PASS_MESSAGE_IMPL( checkingAssertion, assertion, message ) /*! \brief Asserts that an assertion is successful (for use to unit test custom assertion) * \ingroup group_assertions */ # define CPPUT_ASSERT_ASSERTION_PASS( assertion ) \ CPPUT_ASSERT_ASSERTION_PASS_MESSAGE( assertion, ::CppUT::Message() ) /*! \brief Checks that an assertion is successful (for use to unit test custom assertion) * \ingroup group_assertions */ # define CPPUT_CHECK_ASSERTION_PASS( assertion ) \ CPPUT_CHECK_ASSERTION_PASS_MESSAGE( assertion, ::CppUT::Message() ) /*! \brief Skips and aborts the current test. * \ingroup group_assertions * * Cause the current test to be skipped. Its status will be 'TestStatus::skipped', * unless an assertion failed before. */ # define CPPUT_SKIP_TEST \ ::CppUT::skipCurrentTest /*! \brief Checks that an assertion fail, but ignore its failure * \ingroup group_assertions * * A typical usage of CPPUT_IGNORE_FAILURE is to ignore a failing assertion temporary. * Even if the assertion fails, it does not cause the test to fail, but increased * CppUT::TestStatus::ignoredFailureCount() instead. * * Notes that CPPUT_IGNORE_FAILURE also checks that the \c assertion fails (just like * CPPUT_CHECK_ASSERTION_FAIL) and will therefore cause the test to fail if the * assertion did not fail. * * \code * CPPUT_IGNORE_FAILURE(( CPPUT_ASSERT_EQUAL( 1, 2 )); * \endcode * * \warning Be sure to always use double brace around the macro parameter to avoid * preprocessor mess. */ # define CPPUT_IGNORE_FAILURE( assertion ) \ { \ CPPUT_CHECK_POINT( checkingAssertion ); \ bool failedCppUT_; \ { \ ::CppUT::TestInfo::IgnoreFailureScopedContextOverride contextSwitchCppUT_( failedCppUT_ );\ try { \ assertion; \ } catch ( const ::CppUT::AbortingAssertionException & ) { \ } \ } \ ::CppUT::checkAssertionFail( failedCppUT_, #assertion ); \ } #endif // CPPUT_ASSERT_H_INCLUDED Index: equality.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/equality.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** equality.h 11 Nov 2005 23:23:48 -0000 1.5 --- equality.h 13 Nov 2005 10:12:01 -0000 1.6 *************** *** 42,45 **** --- 42,46 ---- + /// \cond implementation_detail namespace Impl { template<typename AType, typename BType> *************** *** 56,59 **** --- 57,61 ---- } // namespace Impl + /// \endcond implementation_detail /*! \ingroup group_assertions_support |
From: Baptiste L. <bl...@us...> - 2005-11-13 10:12:09
|
Update of /cvsroot/cppunit/cppunit2/include/cpptl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10041/include/cpptl Modified Files: any.h enumerator.h functor.h functor.py intrusiveptr.h reflection.h reflection.inl sharedptr.h thread.h Log Message: - renamed include/cpput/assert.h to include/cpput/assertcommon.h. This avoid clash with include <assert.h> in doxygen documentation - most Impl namespaces are now hidden from documentation using \cond and \endcond. Index: any.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/any.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** any.h 10 Nov 2005 08:03:09 -0000 1.2 --- any.h 13 Nov 2005 10:12:01 -0000 1.3 *************** *** 21,24 **** --- 21,25 ---- + /// \cond implementation_detail namespace Impl { class AnyHolder *************** *** 70,73 **** --- 71,75 ---- } // namespace Impl + /// \endcond Index: reflection.inl =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/reflection.inl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** reflection.inl 5 Mar 2005 13:44:50 -0000 1.4 --- reflection.inl 13 Nov 2005 10:12:01 -0000 1.5 *************** *** 213,216 **** --- 213,217 ---- // ////////////////////////////////////////////////////////////////// + /// \cond implementation_detail namespace Impl { *************** *** 230,233 **** --- 231,237 ---- } // namespace Impl + /// \endcond + + } // namespace CppTL Index: thread.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/thread.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** thread.h 7 Mar 2005 08:46:38 -0000 1.3 --- thread.h 13 Nov 2005 10:12:01 -0000 1.4 *************** *** 87,90 **** --- 87,91 ---- # else // # if !(CPPTL_HAS_THREAD) + /// \cond implementation_detail namespace Impl { *************** *** 100,103 **** --- 101,105 ---- } // namespace Impl + /// \endcond Index: reflection.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/reflection.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** reflection.h 5 Mar 2005 10:15:12 -0000 1.5 --- reflection.h 13 Nov 2005 10:12:01 -0000 1.6 *************** *** 15,18 **** --- 15,19 ---- typedef std::vector<Any> MethodParameters; + /// \cond implementation_detail namespace Impl { class AttributAccessor; *************** *** 130,133 **** --- 131,135 ---- } // namespace Impl + /// \endcond Index: sharedptr.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/sharedptr.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sharedptr.h 4 Jul 2005 08:09:30 -0000 1.5 --- sharedptr.h 13 Nov 2005 10:12:01 -0000 1.6 *************** *** 19,22 **** --- 19,23 ---- { + /// \cond implementation_detail namespace Impl { *************** *** 121,124 **** --- 122,126 ---- } // namespace Impl + /// \endcond template<class PointeeType> Index: enumerator.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/enumerator.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** enumerator.h 11 Nov 2005 20:54:15 -0000 1.10 --- enumerator.h 13 Nov 2005 10:12:01 -0000 1.11 *************** *** 35,39 **** namespace CppTL { namespace Enum { ! /// \internal namespace Impl { --- 35,39 ---- namespace CppTL { namespace Enum { ! /// \cond implementation_detail namespace Impl { *************** *** 60,63 **** --- 60,65 ---- } // namespace Impl + /// \endcond + } // namespace Enum Index: functor.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/functor.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** functor.h 4 Mar 2005 22:17:54 -0000 1.5 --- functor.h 13 Nov 2005 10:12:01 -0000 1.6 *************** *** 43,46 **** --- 43,47 ---- + /// \cond implementation_detail namespace Impl { *************** *** 1163,1166 **** --- 1164,1168 ---- } // namespace Impl + /// \endcond Index: functor.py =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/functor.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** functor.py 4 Mar 2005 22:17:54 -0000 1.5 --- functor.py 13 Nov 2005 10:12:01 -0000 1.6 *************** *** 48,51 **** --- 48,52 ---- + /// \cond implementation_detail namespace Impl { *************** *** 64,67 **** --- 65,69 ---- } // namespace Impl + /// \endcond Index: intrusiveptr.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/intrusiveptr.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** intrusiveptr.h 20 Jul 2005 21:06:49 -0000 1.1 --- intrusiveptr.h 13 Nov 2005 10:12:01 -0000 1.2 *************** *** 44,50 **** namespace CppTL { namespace Impl { ! /// Smart-pointer base class to avoid template code bloat class IntrusivePtrBase { --- 44,51 ---- namespace CppTL { + /// \cond implementation_detail namespace Impl { ! /// Smart-pointer base class class IntrusivePtrBase { *************** *** 98,101 **** --- 99,103 ---- } // namespace Impl + /// \endcond inline void instrusivePtrAddRef( IntrusiveCount *p ) *************** *** 109,112 **** --- 111,115 ---- } + /// \todo inline Impl::IntrusivePtrBase into this class: it makes debugging more complex template<class PointeeType> class IntrusivePtr : public Impl::IntrusivePtrBase |
From: Baptiste L. <bl...@us...> - 2005-11-13 10:12:09
|
Update of /cvsroot/cppunit/cppunit2/src/opentesttest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10041/src/opentesttest Modified Files: packetstest.cpp serializertest.cpp Log Message: - renamed include/cpput/assert.h to include/cpput/assertcommon.h. This avoid clash with include <assert.h> in doxygen documentation - most Impl namespaces are now hidden from documentation using \cond and \endcond. Index: packetstest.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/opentesttest/packetstest.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** packetstest.cpp 8 Nov 2005 23:25:31 -0000 1.5 --- packetstest.cpp 13 Nov 2005 10:12:01 -0000 1.6 *************** *** 1,4 **** #include "packetstest.h" ! #include <cpput/assert.h> #include <cpput/assertstring.h> #include <cpput/registry.h> --- 1,4 ---- #include "packetstest.h" ! #include <cpput/assertcommon.h> #include <cpput/assertstring.h> #include <cpput/registry.h> Index: serializertest.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/opentesttest/serializertest.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** serializertest.cpp 9 Nov 2005 21:45:08 -0000 1.7 --- serializertest.cpp 13 Nov 2005 10:12:01 -0000 1.8 *************** *** 1,4 **** #include "serializertest.h" ! #include <cpput/assert.h> #include <cpput/assertstring.h> #include <cpput/registry.h> --- 1,4 ---- #include "serializertest.h" ! #include <cpput/assertcommon.h> #include <cpput/assertstring.h> #include <cpput/registry.h> |
From: Baptiste L. <bl...@us...> - 2005-11-13 10:12:09
|
Update of /cvsroot/cppunit/cppunit2/src/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10041/src/cpput Modified Files: assert.cpp exceptionguard.cpp registry.cpp testcase.cpp Log Message: - renamed include/cpput/assert.h to include/cpput/assertcommon.h. This avoid clash with include <assert.h> in doxygen documentation - most Impl namespaces are now hidden from documentation using \cond and \endcond. Index: assert.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/assert.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** assert.cpp 11 Nov 2005 20:54:15 -0000 1.17 --- assert.cpp 13 Nov 2005 10:12:01 -0000 1.18 *************** *** 1,3 **** ! # include <cpput/assert.h> # include <cpput/message.h> # include <cpput/stringize.h> --- 1,3 ---- ! # include <cpput/assertcommon.h> # include <cpput/message.h> # include <cpput/stringize.h> Index: registry.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/registry.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** registry.cpp 8 Nov 2005 23:25:31 -0000 1.4 --- registry.cpp 13 Nov 2005 10:12:01 -0000 1.5 *************** *** 6,9 **** --- 6,10 ---- namespace CppUT { + /// \cond implementation_detail namespace Impl { struct ThreadSafeSuiteFactory *************** *** 28,31 **** --- 29,33 ---- }; } // namespace Impl + /// \endcond Index: testcase.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/testcase.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** testcase.cpp 11 Nov 2005 20:54:15 -0000 1.14 --- testcase.cpp 13 Nov 2005 10:12:01 -0000 1.15 *************** *** 1,4 **** #include <cpput/testcase.h> ! #include <cpput/assert.h> #include <cpptl/functor.h> #include <cpput/message.h> --- 1,4 ---- #include <cpput/testcase.h> ! #include <cpput/assertcommon.h> #include <cpptl/functor.h> #include <cpput/message.h> Index: exceptionguard.cpp =================================================================== RCS file: /cvsroot/cppunit/cppunit2/src/cpput/exceptionguard.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** exceptionguard.cpp 11 Nov 2005 20:54:15 -0000 1.9 --- exceptionguard.cpp 13 Nov 2005 10:12:01 -0000 1.10 *************** *** 39,42 **** --- 39,43 ---- + /// \cond implementation_detail namespace Impl { *************** *** 97,100 **** --- 98,102 ---- } // namespace Impl + /// \endcond |
From: Baptiste L. <bl...@us...> - 2005-11-13 10:12:08
|
Update of /cvsroot/cppunit/cppunit2/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10041/doc Modified Files: doxyfile Log Message: - renamed include/cpput/assert.h to include/cpput/assertcommon.h. This avoid clash with include <assert.h> in doxygen documentation - most Impl namespaces are now hidden from documentation using \cond and \endcond. Index: doxyfile =================================================================== RCS file: /cvsroot/cppunit/cppunit2/doc/doxyfile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** doxyfile 12 Nov 2005 20:55:46 -0000 1.2 --- doxyfile 13 Nov 2005 10:12:01 -0000 1.3 *************** *** 80,84 **** EXCLUDE = EXCLUDE_SYMLINKS = NO ! EXCLUDE_PATTERNS = yaml.h format.h bimap.h enumstringizer.h inputtest.h parametrizedsource.h resource.h tablefixture.h parametrizedsource.cpp tablefixture.cpp testrunner.cpp connection.h testrunner.h EXAMPLE_PATH = EXAMPLE_PATTERNS = * --- 80,84 ---- EXCLUDE = EXCLUDE_SYMLINKS = NO ! EXCLUDE_PATTERNS = yaml.h format.h bimap.h enumstringizer.h inputtest.h parametrizedsource.h resource.h tablefixture.h parametrizedsource.cpp tablefixture.cpp testrunner.cpp connection.h testrunner.h reflectionimpl10.h thread.cpp EXAMPLE_PATH = EXAMPLE_PATTERNS = * *************** *** 194,205 **** # Configuration options related to the dot tool #--------------------------------------------------------------------------- ! CLASS_DIAGRAMS = NO ! HIDE_UNDOC_RELATIONS = YES ! HAVE_DOT = NO CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = NO ! TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES --- 194,205 ---- # Configuration options related to the dot tool #--------------------------------------------------------------------------- ! CLASS_DIAGRAMS = YES ! HIDE_UNDOC_RELATIONS = NO ! HAVE_DOT = YES CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = NO ! TEMPLATE_RELATIONS = YES INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES *************** *** 208,212 **** DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png ! DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 --- 208,212 ---- DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png ! DOT_PATH = D:\wut\prg\Graphwiz\Graphviz\bin\dot.exe DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 *************** *** 214,218 **** MAX_DOT_GRAPH_DEPTH = 1000 DOT_TRANSPARENT = NO ! DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = YES --- 214,218 ---- MAX_DOT_GRAPH_DEPTH = 1000 DOT_TRANSPARENT = NO ! DOT_MULTI_TARGETS = YES GENERATE_LEGEND = YES DOT_CLEANUP = YES |
From: Baptiste L. <bl...@us...> - 2005-11-12 20:55:57
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10826/include/cpput Modified Files: assert.h exceptionguard.h stringize.h testcase.h testinfo.h testsuite.h Log Message: - added some documentation - fixed tabs display in html output. Index: testinfo.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testinfo.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** testinfo.h 11 Nov 2005 20:54:15 -0000 1.18 --- testinfo.h 12 Nov 2005 20:55:46 -0000 1.19 *************** *** 8,15 **** # include <stdexcept> - /// @todo find a away to integrate context with multiple thread. - namespace CppUT { class CPPUT_API AbortingAssertionException : public std::runtime_error { --- 8,15 ---- # include <stdexcept> namespace CppUT { + /*! \brief Exception thrown when an aborting assertion fails. + */ class CPPUT_API AbortingAssertionException : public std::runtime_error { *************** *** 21,24 **** --- 21,26 ---- }; + /*! \brief Exception thrown to skip the current test. + */ class CPPUT_API SkipTestException : public std::runtime_error { *************** *** 30,33 **** --- 32,37 ---- }; + /*! \brief Represents the location of an assertion in the source code. + */ class SourceLocation { *************** *** 59,62 **** --- 63,69 ---- }; + /*! \brief Represents a failed assertion. + * \ingroup group_custom_assertions + */ class CPPUT_API Assertion { *************** *** 104,108 **** ! class CPPUT_API TestStatus { --- 111,117 ---- ! /*! \brief Represents the status of the current test. ! * \ingroup group_custom_assertions ! */ class CPPUT_API TestStatus { *************** *** 149,153 **** ! class CPPUT_API TestResultUpdater : public CppTL::IntrusiveCount { --- 158,163 ---- ! /*! \brief Provides notification of failed assertions and log events. ! */ class CPPUT_API TestResultUpdater : public CppTL::IntrusiveCount { *************** *** 162,171 **** }; enum AssertionType { ! abortingAssertion = 1, ! checkingAssertion }; enum AbortingAssertionMode { --- 172,187 ---- }; + /*! \brief Indiciates if on failure the assertion it will abort the current test. + * \ingroup group_custom_assertions + */ enum AssertionType { ! abortingAssertion = 1, ///< The assertion will abort the test on failure ! checkingAssertion ///< The test will continue on assertion failure }; + /*! \brief Indicates if AbortingAssertionException contains detail about the failed assertion. + * Used by CppUnit 2 to test itself without relying on TestResultUpdater. + */ enum AbortingAssertionMode { *************** *** 174,177 **** --- 190,197 ---- }; + /*! \brief Heart of the test system: hold current test status and the state of the current assertion. + * \ingroup group_custom_assertions + * \todo find a away to integrate context with multiple thread. + */ class TestInfo : public CppTL::IntrusiveCount { *************** *** 243,262 **** }; ! Assertion &CPPUT_API currentAssertion(); ! /// Realize the current assertion. ! /// Add data about the current assertion to the test result. ! /// @exception AbortingAssertionException If assertionType was set to ! /// abortingAssertion. void CPPUT_API realizeAssertion(); void CPPUT_API log( const Json::Value &log ); void CPPUT_API log( const std::string &log ); void CPPUT_API log( const char *log ); ! // This overload allows usage of StringConcatenator... void CPPUT_API log( const CppTL::ConstString &log ); --- 263,304 ---- }; ! /*! \brief Returns the current assertion. ! * \ingroup group_custom_assertions ! * \sa TestInfo ! */ Assertion &CPPUT_API currentAssertion(); ! /*! \brief Realizes the current assertion. ! * \ingroup group_custom_assertions ! * Pass the current assertion to the TestResultUpdater and set the test status to ! * TestStatus::failed. ! * ! * If the current assertion type is abortingAssertion then an AbortingAssertionException ! * is thrown. ! * ! * @exception AbortingAssertionException If assertionType was set to ! * abortingAssertion. ! * \sa TestInfo ! */ void CPPUT_API realizeAssertion(); + /*! \brief Log an event. + * \sa TestInfo + */ void CPPUT_API log( const Json::Value &log ); + /*! \brief Log an event. + * \sa TestInfo + */ void CPPUT_API log( const std::string &log ); + /*! \brief Log an event. + * \sa TestInfo + */ void CPPUT_API log( const char *log ); ! /*! \brief Log an event. ! * \sa TestInfo ! */ void CPPUT_API log( const CppTL::ConstString &log ); Index: testsuite.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testsuite.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testsuite.h 11 Nov 2005 23:23:48 -0000 1.7 --- testsuite.h 12 Nov 2005 20:55:46 -0000 1.8 *************** *** 8,12 **** namespace CppUT { ! /*! An abstract test suite that represents a collection of Test. * \ingroup group_testcases */ --- 8,12 ---- namespace CppUT { ! /*! \brief An abstract test suite that represents a collection of Test. * \ingroup group_testcases */ *************** *** 30,34 **** ! /*! A test suite that represents a collection of Test. * \ingroup group_testcases */ --- 30,34 ---- ! /*! \brief A test suite that represents a collection of Test. * \ingroup group_testcases */ *************** *** 53,57 **** ! /*! Creates a TestSuite with the specified name. * \ingroup group_testcases */ --- 53,57 ---- ! /*! \brief Creates a TestSuite with the specified name. * \ingroup group_testcases */ Index: assert.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/assert.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** assert.h 11 Nov 2005 23:23:48 -0000 1.17 --- assert.h 12 Nov 2005 20:55:46 -0000 1.18 *************** *** 119,134 **** ! // __func__ should contains the current fonction name on many compiler (C99 compiler extension). See: ! // http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.vacpp7a.doc/language/ref/clrc02predefined_identifiers.htm ! // Available if __C99__FUNC__ is defined: ! // http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.vacpp7a.doc/language/ref/clrapxaix_macros.htm # define CPPUT_CHECK_POINT( assertionType ) \ ::CppUT::TestInfo::threadInstance().newAssertion( ::CppUT::assertionType, \ __FILE__, \ __LINE__ ) ! # define CPPUT_BEGIN_ASSERTION_MACRO() \ CPPUT_CHECK_POINT( abortingAssertion ), # define CPPUT_BEGIN_CHECKING_MACRO() \ CPPUT_CHECK_POINT( checkingAssertion ), --- 119,143 ---- ! /*! Starts either an aborting assertion or a checking assertion macro. ! * \ingroup group_custom_assertions ! * \internal ! * __func__ should contains the current fonction name on many compiler (C99 compiler extension). See: ! * http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.vacpp7a.doc/language/ref/clrc02predefined_identifiers.htm ! * Available if __C99__FUNC__ is defined: ! * http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.vacpp7a.doc/language/ref/clrapxaix_macros.htm ! */ # define CPPUT_CHECK_POINT( assertionType ) \ ::CppUT::TestInfo::threadInstance().newAssertion( ::CppUT::assertionType, \ __FILE__, \ __LINE__ ) ! /*! Starts an aborting assertion macro. ! * \ingroup group_custom_assertions ! */ # define CPPUT_BEGIN_ASSERTION_MACRO() \ CPPUT_CHECK_POINT( abortingAssertion ), + /*! Starts a checking assertion macro. + * \ingroup group_custom_assertions + */ # define CPPUT_BEGIN_CHECKING_MACRO() \ CPPUT_CHECK_POINT( checkingAssertion ), Index: stringize.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/stringize.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** stringize.h 11 Nov 2005 23:23:48 -0000 1.9 --- stringize.h 12 Nov 2005 20:55:46 -0000 1.10 *************** *** 33,37 **** /*! \brief A generic functor that can be used to convert a value into a string. ! * \ingroup group_assertions_support * It is used as default argument by function template that allow the user to * pass a specific functor to convert data to string. --- 33,37 ---- /*! \brief A generic functor that can be used to convert a value into a string. ! * \ingroup group_assertions_support * It is used as default argument by function template that allow the user to * pass a specific functor to convert data to string. Index: testcase.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testcase.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** testcase.h 11 Nov 2005 23:23:48 -0000 1.13 --- testcase.h 12 Nov 2005 20:55:46 -0000 1.14 *************** *** 10,14 **** namespace CppUT { ! /*! An abstract test case that can be run. * \ingroup group_testcases */ --- 10,14 ---- namespace CppUT { ! /*! \brief An abstract test case that can be run. * \ingroup group_testcases */ *************** *** 43,47 **** ! /*! A test case that can be run. * \ingroup group_testcases */ --- 43,47 ---- ! /*! \brief A test case that can be run. * \ingroup group_testcases */ *************** *** 72,76 **** ! /*! Creates a TestCase with the specified name and run functor. * \ingroup group_testcases */ --- 72,76 ---- ! /*! \brief Creates a TestCase with the specified name and run functor. * \ingroup group_testcases */ *************** *** 79,83 **** ! /*! Creates a TestCase with the specified name and setUp, run, and tearDown functor. * \ingroup group_testcases */ --- 79,83 ---- ! /*! \brief Creates a TestCase with the specified name and setUp, run, and tearDown functor. * \ingroup group_testcases */ *************** *** 87,91 **** const std::string &name ); ! /*! Creates a TestCase with the specified name that will always fail. * \ingroup group_testcases * --- 87,91 ---- const std::string &name ); ! /*! \brief Creates a TestCase with the specified name that will always fail. * \ingroup group_testcases * *************** *** 99,103 **** const Message &message ); ! /*! Creates a TestCase using a fixture-like object. * \ingroup group_testcases * --- 99,103 ---- const Message &message ); ! /*! \brief Creates a TestCase using a fixture-like object. * \ingroup group_testcases * Index: exceptionguard.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/exceptionguard.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** exceptionguard.h 11 Nov 2005 23:23:48 -0000 1.5 --- exceptionguard.h 12 Nov 2005 20:55:46 -0000 1.6 *************** *** 43,47 **** ! /** Helpers to provide simple exception translation. * \warning Ensure that either a fault, assertion is added to TestInfo, or * that TestStatus is set to \c failed otherwise the test will not fail! --- 43,47 ---- ! /*! \brief Helpers to provide simple exception translation. * \warning Ensure that either a fault, assertion is added to TestInfo, or * that TestStatus is set to \c failed otherwise the test will not fail! *************** *** 76,80 **** ! /** * \ingroup group_testcases * \see registerExceptionTranslation() to easily register custom exception translator. --- 76,80 ---- ! /*! * \ingroup group_testcases * \see registerExceptionTranslation() to easily register custom exception translator. |
From: Baptiste L. <bl...@us...> - 2005-11-12 20:55:57
|
Update of /cvsroot/cppunit/cppunit2/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10826/doc Modified Files: cpput.dox doxyfile Log Message: - added some documentation - fixed tabs display in html output. Index: doxyfile =================================================================== RCS file: /cvsroot/cppunit/cppunit2/doc/doxyfile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** doxyfile 11 Nov 2005 23:23:48 -0000 1.1 --- doxyfile 12 Nov 2005 20:55:46 -0000 1.2 *************** *** 7,13 **** PROJECT_NUMBER = 0.0 OUTPUT_DIRECTORY = docbuild - CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English - USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES --- 7,11 ---- *************** *** 23,38 **** an \ the - ALWAYS_DETAILED_SEC = NO - INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES STRIP_FROM_PATH = E:\prg\vc\Lib\cppunit2 ! STRIP_FROM_INC_PATH = ! SHORT_NAMES = NO ! JAVADOC_AUTOBRIEF = NO ! MULTILINE_CPP_IS_BRIEF = NO ! DETAILS_AT_TOP = NO INHERIT_DOCS = YES - DISTRIBUTE_GROUP_DOC = NO - SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 8 ALIASES = --- 21,29 ---- an \ the FULL_PATH_NAMES = YES STRIP_FROM_PATH = E:\prg\vc\Lib\cppunit2 ! STRIP_FROM_INC_PATH = E:\prg\vc\Lib\cppunit2\include ! JAVADOC_AUTOBRIEF = YES INHERIT_DOCS = YES TAB_SIZE = 8 ALIASES = *************** *** 40,43 **** --- 31,35 ---- OPTIMIZE_OUTPUT_JAVA = NO SUBGROUPING = YES + #--------------------------------------------------------------------------- # Build related configuration options *************** *** 83,92 **** #--------------------------------------------------------------------------- INPUT = ../include/cpptl ../include/cpput ../include/json ../src/cpptl ../src/cpput . ! # ../include/opentest ../src/opentest FILE_PATTERNS = *.h *.cpp *.inl *.dox RECURSIVE = NO EXCLUDE = EXCLUDE_SYMLINKS = NO ! EXCLUDE_PATTERNS = yaml.h format.h bimap.h enumstringizer.h inputtest.h parametrizedsource.h resource.h tablefixture.h parametrizedsource.cpp tablefixture.cpp testrunner.cpp connection.h EXAMPLE_PATH = EXAMPLE_PATTERNS = * --- 75,84 ---- #--------------------------------------------------------------------------- INPUT = ../include/cpptl ../include/cpput ../include/json ../src/cpptl ../src/cpput . ! # ../src/opentest ../include/opentest FILE_PATTERNS = *.h *.cpp *.inl *.dox RECURSIVE = NO EXCLUDE = EXCLUDE_SYMLINKS = NO ! EXCLUDE_PATTERNS = yaml.h format.h bimap.h enumstringizer.h inputtest.h parametrizedsource.h resource.h tablefixture.h parametrizedsource.cpp tablefixture.cpp testrunner.cpp connection.h testrunner.h EXAMPLE_PATH = EXAMPLE_PATTERNS = * *************** *** 96,103 **** FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- ! SOURCE_BROWSER = YES INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES --- 88,96 ---- FILTER_PATTERNS = FILTER_SOURCE_FILES = NO + #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- ! SOURCE_BROWSER = NO INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES *************** *** 107,116 **** VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- - # configuration options related to the alphabetical class index - #--------------------------------------------------------------------------- - ALPHABETICAL_INDEX = NO - COLS_IN_ALPHA_INDEX = 5 - IGNORE_PREFIX = - #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- --- 100,103 ---- *************** *** 120,125 **** HTML_HEADER = header.html HTML_FOOTER = footer.html ! HTML_STYLESHEET = ! HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = cppunit2.chm --- 107,112 ---- HTML_HEADER = header.html HTML_FOOTER = footer.html ! #HTML_STYLESHEET = ! #HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = cppunit2.chm *************** *** 132,135 **** --- 119,123 ---- GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 250 + #--------------------------------------------------------------------------- # configuration options related to the LaTeX output *************** *** 186,195 **** #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES ! MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = ../include INCLUDE_FILE_PATTERNS = *.h ! PREDEFINED = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES --- 174,184 ---- #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES ! MACRO_EXPANSION = YES EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = ../include INCLUDE_FILE_PATTERNS = *.h ! PREDEFINED = "_MSC_VER=1400" \ ! _CPPRTTI _WIN32 EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES Index: cpput.dox =================================================================== RCS file: /cvsroot/cppunit/cppunit2/doc/cpput.dox,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cpput.dox 11 Nov 2005 23:23:48 -0000 1.1 --- cpput.dox 12 Nov 2005 20:55:46 -0000 1.2 *************** *** 1,4 **** --- 1,9 ---- /** \mainpage + + \section _warning WARNING + + This is a *very early* documenation release and is very incomplete (including this page). + \section _intro Introduction *************** *** 13,16 **** --- 18,22 ---- - customizable convertion to std::string for string assertion - support to ignore a specific assertion failures + - ... *************** *** 38,41 **** --- 44,50 ---- */ + /*! \defgroup group_custom_assertions Creating new assertions + */ + /*! \defgroup group_assertions_support Assertion support */ |
From: Baptiste L. <bl...@us...> - 2005-11-11 23:25:20
|
Update of /cvsroot/cppunit/cppunit2/src/cpputtest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12243/src/cpputtest Added Files: testinfotest.cpp Log Message: - added unit tests for TestInfo - fixed bug in CPPUT_IGNORE_FAILURE and exception guard. --- NEW FILE: testinfotest.cpp --- #include <cpput/assert.h> #include <cpput/testcase.h> #include <cpput/assertenum.h> #include <stdio.h> #include <stdexcept> #include "mocktestvisitor.h" namespace { // Capture the current TestStatus statistics struct AssertionCount { AssertionCount() { captureStatus(); } void resetStatistics() { CppUT::TestInfo::threadInstance().startNewTest(); } void captureStatus() { status_ = CppUT::TestInfo::threadInstance().testStatus(); } void check( int assertion, int failed, int ignored, CppUT::TestStatus::Status status = CppUT::TestStatus::passed ) { CppUT::checkEquals( assertion, status_.assertionCount(), "bad assertion count" ); CppUT::checkEquals( failed, status_.failedAssertionCount(), "bad failed assertion count" ); CppUT::checkEquals( ignored, status_.ignoredFailureCount(), "bad ignored failure count" ); CppUT::checkEquals( status, status_.status(), "bad status" ); // restore original status CppUT::TestInfo::threadInstance().testStatus() = status_; } CppUT::TestStatus status_; }; struct MockTestResultEvent { MockTestResultEvent( const std::string &type, const std::string &detail ) : type_( type ) , detail_( detail ) { } bool operator ==( const MockTestResultEvent &other ) const { return type_ == other.type_ && ( detail_.find( other.detail_ ) != std::string::npos || other.detail_.find( detail_ ) != std::string::npos ); } bool operator !=( const MockTestResultEvent &other ) const { return !( *this == other ); } std::string type_; std::string detail_; }; class MockTestResultUpdater : public CppUT::TestResultUpdater { public: public: // overridden from CppUT::TestResultUpdater virtual void addResultLog( const Json::Value &log ) { MockTestResultEvent event( "log_event", log.toStyledString() ); actualEvents_.push_back( event ); } virtual void addResultAssertion( const CppUT::Assertion &assertion ) { MockTestResultEvent event( "assertion_event", assertion.toString() ); if ( assertion.isIgnoredFailure() ) event.detail_ += " [ignored_failure]"; actualEvents_.push_back( event ); } void expectLogEvent( const Json::Value &log ) { MockTestResultEvent event( "log_event", log.toStyledString() ); expectedEvents_.push_back( event ); } void expectAssertionEvent( const std::string &detail, bool isIgnored = false ) { MockTestResultEvent event( "assertion_event", detail ); if ( isIgnored ) event.detail_ += " [ignored_failure]"; expectedEvents_.push_back( event ); } void reset() { actualEvents_.clear(); expectedEvents_.clear(); } void verify() { std::string expected; std::string actual; unsigned int minCount = CPPTL_MIN( expectedEvents_.size(), actualEvents_.size() ); unsigned int index = 0; for ( ; index < minCount; ++index ) { if ( expectedEvents_[index] != actualEvents_[index] ) break; } if ( index < minCount || expectedEvents_.size() != actualEvents_.size() ) { CppUT::Message message( "Expected and actual test event sequences did not match" ); std::string indexStr = CppTL::toString( index ).c_str(); message.add( "Difference at index " + indexStr ); message.add( "Expected:\n" + toString( expectedEvents_ ) ); message.add( "Actual :\n" + toString( actualEvents_ ) ); CppUT::fail( message ); } reset(); } typedef std::deque<MockTestResultEvent> TestEvents; std::string toString( const TestEvents &events ) const { std::string buffer; for ( unsigned int index =0; index < events.size(); ++index ) { std::string indexStr = CppTL::toString(index).c_str(); buffer += "[" + indexStr + "]='" + CppUT::stringize(events[index]) + "'\n"; } return buffer; } TestEvents expectedEvents_; TestEvents actualEvents_; }; } // end anonymous namespace namespace CppUT { /// We override this function so that CppUnit know how to convert /// MockTestResultEvent instance into a string. inline std::string toString( const MockTestResultEvent &v ) { return "TestEvent( type: " + v.type_ + "; detail: " + v.detail_ + " )"; } } // Assumes a local variable named 'count of type AssertionCount is declared #define TESTINFO_ASSERT_STATUS_IS \ count.captureStatus(), /* capture test statistics */ \ CPPUT_BEGIN_ASSERTION_MACRO() /* warning: change test statistics */ \ count.check #define TESTINFO_IGNORE( assertion ) \ try { assertion; } catch ( CppUT::AbortingAssertionException & ) {} #define TESTINFO_VERIFY_TESTEVENTS( updater ) \ CPPUT_BEGIN_ASSERTION_MACRO() \ (updater).verify() static void testTestInfoStatus() { CppUT::TestInfo &testInfo = CppUT::TestInfo::threadInstance(); AssertionCount count; // successful aborting assertion count.resetStatistics(); CPPUT_ASSERT( true ); TESTINFO_ASSERT_STATUS_IS( 1, 0, 0 ); // successful checking assertion count.resetStatistics(); CPPUT_CHECK( true ); TESTINFO_ASSERT_STATUS_IS( 1, 0, 0 ); // failing aborting assertion count.resetStatistics(); TESTINFO_IGNORE(( CPPUT_ASSERT( false ) )) TESTINFO_ASSERT_STATUS_IS( 1, 1, 0, CppUT::TestStatus::failed ); // failing checking assertion count.resetStatistics(); CPPUT_CHECK( false ); TESTINFO_ASSERT_STATUS_IS( 1, 1, 0, CppUT::TestStatus::failed ); // ignored successful aborting assertion count.resetStatistics(); CPPUT_IGNORE_FAILURE(( CPPUT_ASSERT( true ) )); TESTINFO_ASSERT_STATUS_IS( 1, 1, 0, CppUT::TestStatus::failed ); // ignored successful checking assertion count.resetStatistics(); CPPUT_IGNORE_FAILURE(( CPPUT_CHECK( true ) )); TESTINFO_ASSERT_STATUS_IS( 1, 1, 0, CppUT::TestStatus::failed ); // ignored failing aborting assertion count.resetStatistics(); CPPUT_IGNORE_FAILURE(( CPPUT_ASSERT( false ) )); TESTINFO_ASSERT_STATUS_IS( 1, 0, 1 ); // ignored failing checking assertion count.resetStatistics(); CPPUT_IGNORE_FAILURE(( CPPUT_CHECK( false ) )); TESTINFO_ASSERT_STATUS_IS( 1, 0, 1 ); // skipped test count.resetStatistics(); try { CPPUT_SKIP_TEST(); } catch ( CppUT::SkipTestException & ) { } TESTINFO_ASSERT_STATUS_IS( 0, 0, 0, CppUT::TestStatus::skipped ); } // Test status transition logic static void testTestInfoStatusStatus() { CppUT::TestInfo &testInfo = CppUT::TestInfo::threadInstance(); AssertionCount count; // passed => passed count.resetStatistics(); CPPUT_CHECK( true ); TESTINFO_ASSERT_STATUS_IS( 1, 0, 0, CppUT::TestStatus::passed ); // passed => skipped try { CPPUT_SKIP_TEST(); } catch ( CppUT::SkipTestException & ) { } TESTINFO_ASSERT_STATUS_IS( 1, 0, 0, CppUT::TestStatus::skipped ); // skipped => failed TESTINFO_IGNORE(( CPPUT_ASSERT( false ) )) TESTINFO_ASSERT_STATUS_IS( 2, 1, 0, CppUT::TestStatus::failed ); // failed => failed CPPUT_IGNORE_FAILURE(( CPPUT_CHECK( false ) )); TESTINFO_ASSERT_STATUS_IS( 3, 1, 1, CppUT::TestStatus::failed ); // passed => failed count.resetStatistics(); CPPUT_IGNORE_FAILURE(( CPPUT_CHECK( true ) )); TESTINFO_ASSERT_STATUS_IS( 1, 1, 0, CppUT::TestStatus::failed ); } static void testTestInfoListener() { // we override the context to ensure our result updater is discarded in case of // assertion. CppUT::TestInfo::ScopedContextOverride context; MockTestResultUpdater updater; CppUT::TestInfo::threadInstance().setTestResultUpdater( updater ); // no events CPPUT_CHECK( true ); TESTINFO_VERIFY_TESTEVENTS( updater ); // one aborting assertion and one non aborting assertion events updater.expectAssertionEvent( "msg1" ); updater.expectAssertionEvent( "msg2" ); CPPUT_CHECK( false, "msg1" ); CPPUT_CHECK( true, "msg3" ); TESTINFO_IGNORE(( CPPUT_ASSERT( false, "msg2" ) )) TESTINFO_VERIFY_TESTEVENTS( updater ); // one aborting assertion and one non aborting assertion events updater.expectAssertionEvent( "msg1" ); updater.expectAssertionEvent( "msg2" ); CPPUT_CHECK( false, "msg1" ); TESTINFO_IGNORE(( CPPUT_ASSERT( false, "msg2" ) )) TESTINFO_VERIFY_TESTEVENTS( updater ); // two ignored assertions and one aborting assertion events updater.expectAssertionEvent( "CPPUT_CHECK( true, \"ignore1\" )" ); updater.expectAssertionEvent( "", true ); // ignored failure updater.expectAssertionEvent( "abort3" ); CPPUT_IGNORE_FAILURE(( CPPUT_CHECK( true, "ignore1" ) )); CPPUT_IGNORE_FAILURE(( CPPUT_CHECK( false, "ignore2" ) )); TESTINFO_IGNORE(( CPPUT_ASSERT( false, "abort3" ) )) TESTINFO_VERIFY_TESTEVENTS( updater ); // two ignored assertions and one aborting assertion events updater.expectAssertionEvent( "CPPUT_CHECK( true, \"ignore1\" )" ); updater.expectLogEvent( "log_1" ); updater.expectAssertionEvent( "", true ); // ignored failure updater.expectLogEvent( "log_2" ); updater.expectLogEvent( "log_3" ); updater.expectAssertionEvent( "abort3" ); updater.expectLogEvent( "log_4" ); CPPUT_IGNORE_FAILURE(( CPPUT_CHECK( true, "ignore1" ) )); CppUT::log( "log_1" ); CPPUT_IGNORE_FAILURE(( CPPUT_CHECK( false, "ignore2" ) )); CppUT::log( "log_2" ); CppUT::log( "log_3" ); TESTINFO_IGNORE(( CPPUT_ASSERT( false, "abort3" ) )) CppUT::log( "log_4" ); TESTINFO_VERIFY_TESTEVENTS( updater ); } bool testTestInfo() { printf( "Running bootstrap test: testTestInfo()...\n" ); try { CppUT::TestInfo::threadInstance().startNewTest(); testTestInfoStatus(); testTestInfoStatusStatus(); testTestInfoListener(); } catch ( const CppUT::AbortingAssertionException &e ) { printf( "testTestInfo() failed: %s\n", e.what() ); return false; } catch ( ... ) { printf( "testTestInfo() failed (uncaught exception)." ); return false; } return true; } |
From: Baptiste L. <bl...@us...> - 2005-11-11 23:24:03
|
Update of /cvsroot/cppunit/cppunit2/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11942/doc Added Files: cpput.dox doxyfile Log Message: Rough documentation: placed most function/class/macro in group. --- NEW FILE: doxyfile --- # Doxyfile 1.4.3 #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = "CppUnit 2" PROJECT_NUMBER = 0.0 OUTPUT_DIRECTORY = docbuild CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the ALWAYS_DETAILED_SEC = NO INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = YES STRIP_FROM_PATH = E:\prg\vc\Lib\cppunit2 STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = NO INHERIT_DOCS = YES DISTRIBUTE_GROUP_DOC = NO SEPARATE_MEMBER_PAGES = NO TAB_SIZE = 8 ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = NO EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = NO EXTRACT_LOCAL_METHODS = NO HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = NO HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO SORT_BY_SCOPE_NAME = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = NO GENERATE_BUGLIST = NO GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES SHOW_DIRECTORIES = YES FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = cppunit2-doxygen-warning.log #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = ../include/cpptl ../include/cpput ../include/json ../src/cpptl ../src/cpput . # ../include/opentest ../src/opentest FILE_PATTERNS = *.h *.cpp *.inl *.dox RECURSIVE = NO EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = yaml.h format.h bimap.h enumstringizer.h inputtest.h parametrizedsource.h resource.h tablefixture.h parametrizedsource.cpp tablefixture.cpp testrunner.cpp connection.h EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_PATTERNS = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = YES INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES USE_HTAGS = NO VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = NO COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html HTML_HEADER = header.html HTML_FOOTER = footer.html HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = cppunit2.chm HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = NO DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = NO TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide EXTRA_PACKAGES = LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml XML_SCHEMA = XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = ../include INCLUDE_FILE_PATTERNS = *.h PREDEFINED = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = NO HIDE_UNDOC_RELATIONS = YES HAVE_DOT = NO CLASS_GRAPH = YES COLLABORATION_GRAPH = YES GROUP_GRAPHS = YES UML_LOOK = NO TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = png DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_DEPTH = 1000 DOT_TRANSPARENT = NO DOT_MULTI_TARGETS = NO GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO --- NEW FILE: cpput.dox --- /** \mainpage \section _intro Introduction CppUnit 2 is a test framework for C++. \section _features Features - support aborting and non-aborting assertions - rich collection of assertions - rich assertion diagnostic - customizable conversion to string for complex assertion (equal, not equal...) - customizable equality comparison - customizable convertion to std::string for string assertion - support to ignore a specific assertion failures \section _plinks Project links - <a HREF="http://cppunit.sourceforge.net">cppunit home</a> - <a HREF="http://www.sourceforge.net/projects/cppunit">cppunit sourceforge project</a> \section _rlinks Related links - <a HREF="http://www.json.org/">JSON</a> Specification and alternate language implementations. - <a HREF="http://www.yaml.org/">YAML</a> A data format designed for human readability. - <a HREF="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode FAQ</a>. \section _license License This documentation is in public domain. The CppTL library is in public domain. The CppUT and OpenTest library are under the LGPL with run-time exception. \author Baptiste Lepilleur <bl...@us...> */ /*! \defgroup group_assertions Assertions */ /*! \defgroup group_assertions_support Assertion support */ /*! \defgroup group_testcases Test case & test suite */ /*! \defgroup group_testfixture Test fixture */ /*! \defgroup group_testregistry Test registry */ |
From: Baptiste L. <bl...@us...> - 2005-11-11 23:24:03
|
Update of /cvsroot/cppunit/cppunit2/include/cpput In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11942/include/cpput Modified Files: assert.h assertenum.h assertstring.h config.h dllproxy.h equality.h exceptionguard.h extendeddata.h registry.h stringize.h test.h testcase.h testfixture.h testsuite.h Log Message: Rough documentation: placed most function/class/macro in group. Index: test.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/test.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test.h 8 Nov 2005 21:44:54 -0000 1.10 --- test.h 11 Nov 2005 23:23:48 -0000 1.11 *************** *** 13,16 **** --- 13,21 ---- class TestVisitor; + /*! This class represents the data about a test. + * \ingroup group_testcases + * + * It is the base class of AbstractTestCase and AbstractTestSuite. + */ class CPPUT_API Test : public CppTL::IntrusiveCount { Index: testsuite.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testsuite.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** testsuite.h 8 Nov 2005 21:44:54 -0000 1.6 --- testsuite.h 11 Nov 2005 23:23:48 -0000 1.7 *************** *** 8,11 **** --- 8,14 ---- namespace CppUT { + /*! An abstract test suite that represents a collection of Test. + * \ingroup group_testcases + */ class CPPUT_API AbstractTestSuite : public Test { *************** *** 27,31 **** ! class CPPUT_API TestSuite : public AbstractTestSuite { --- 30,36 ---- ! /*! A test suite that represents a collection of Test. ! * \ingroup group_testcases ! */ class CPPUT_API TestSuite : public AbstractTestSuite { *************** *** 48,51 **** --- 53,59 ---- + /*! Creates a TestSuite with the specified name. + * \ingroup group_testcases + */ TestSuitePtr CPPUT_API makeTestSuite( const std::string &name ); Index: assertenum.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/assertenum.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** assertenum.h 8 Nov 2005 09:05:05 -0000 1.10 --- assertenum.h 11 Nov 2005 23:23:48 -0000 1.11 *************** *** 386,402 **** # define CPPUT_ASSERT_SEQUENCE_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkSequenceEqual # define CPPUT_ASSERT_SET_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkSetEqual ! # define CPPUT_ASSERT_STL_SEQUENCE_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkStlSequenceEqual # define CPPUT_ASSERT_STL_SET_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ --- 386,413 ---- + /*! \brief Asserts that two ordered sequence (list) are identical. + * \ingroup group_assertions + */ # define CPPUT_ASSERT_SEQUENCE_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkSequenceEqual + /*! \brief Asserts that two unordered sequence (set,bag) are identical. + * \ingroup group_assertions + */ # define CPPUT_ASSERT_SET_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkSetEqual ! /*! \brief Asserts that two STL ordered sequence are identical. ! * \ingroup group_assertions ! */ # define CPPUT_ASSERT_STL_SEQUENCE_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkStlSequenceEqual + /*! \brief Asserts that two STL unordered sequence are identical. + * \ingroup group_assertions + */ # define CPPUT_ASSERT_STL_SET_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ *************** *** 404,411 **** --- 415,428 ---- + /*! \brief Checks that two ordered sequence (list) are identical. + * \ingroup group_assertions + */ # define CPPUT_CHECK_SEQUENCE_EQUAL \ CPPUT_BEGIN_CHECKING_MACRO() \ ::CppUT::checkSequenceEqual + /*! \brief Checks that two unordered sequence (set,bag) are identical. + * \ingroup group_assertions + */ # define CPPUT_CHECK_SET_EQUAL \ CPPUT_BEGIN_CHECKING_MACRO() \ *************** *** 413,420 **** --- 430,443 ---- + /*! \brief Asserts that two STL ordered sequence are identical. + * \ingroup group_assertions + */ # define CPPUT_CHECK_STL_SEQUENCE_EQUAL \ CPPUT_BEGIN_CHECKING_MACRO() \ ::CppUT::checkStlSequenceEqual + /*! \brief Checks that two STL unordered sequence are identical. + * \ingroup group_assertions + */ # define CPPUT_CHECK_STL_SET_EQUAL \ CPPUT_BEGIN_CHECKING_MACRO() \ Index: assert.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/assert.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** assert.h 11 Nov 2005 20:54:15 -0000 1.16 --- assert.h 11 Nov 2005 23:23:48 -0000 1.17 *************** *** 135,194 **** --- 135,270 ---- // basic assertions + + + /*! \brief Always fails with the given message. + * \ingroup group_assertions + * \see CppUT::fail + */ # define CPPUT_FAIL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::fail + /*! \brief Asserts that an expression evaluate to true. + * \ingroup group_assertions + * \see CppUT::checkTrue + */ # define CPPUT_ASSERT \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkTrue + /*! \brief Checks that an expression evaluate to true. + * \ingroup group_assertions + * \see CppUT::checkTrue + */ # define CPPUT_CHECK \ CPPUT_BEGIN_CHECKING_MACRO() \ ::CppUT::checkTrue + /*! \brief Asserts that an expression evaluate to true. + * \ingroup group_assertions + * The expression source code is written in the assertion diagnostic in case of failure. + * \see CppUT::checkTrue + */ # define CPPUT_ASSERT_EXPR( expression ) \ CPPUT_ASSERT( (expression), #expression ) + /*! \brief Checks that an expression evaluate to true. + * \ingroup group_assertions + * The expression source code is written in the assertion diagnostic in case of failure. + * \see CppUT::checkTrue + */ # define CPPUT_CHECK_EXPR( expression ) \ CPPUT_CHECK( (expression), #expression ) + /*! \brief Asserts that an expression evaluate to false. + * \ingroup group_assertions + * \see CppUT::checkFalse + */ # define CPPUT_ASSERT_FALSE \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkFalse + /*! \brief Checks that an expression evaluate to false. + * \ingroup group_assertions + * \see CppUT::checkFalse + */ # define CPPUT_CHECK_FALSE \ CPPUT_BEGIN_CHECKING_MACRO() \ ::CppUT::checkFalse + /*! \brief Asserts that an expression evaluate to false. + * \ingroup group_assertions + * The expression source code is written in the assertion diagnostic in case of failure. + * \see CppUT::checkFalse + */ # define CPPUT_ASSERT_EXPR_FALSE( expression ) \ CPPUT_ASSERT_FALSE( (expression), #expression ) + /*! \brief Checks that an expression evaluate to false. + * \ingroup group_assertions + * The expression source code is written in the assertion diagnostic in case of failure. + * \see CppUT::checkFalse + */ # define CPPUT_CHECK_EXPR_FALSE( expression ) \ CPPUT_CHECK_FALSE( (expression), #expression ) + /*! \brief Asserts that two values are equal. + * \ingroup group_assertions + * - The values must be comparable using CppUT::equalityTest + * - The values must be convertible to std::string using CppUT::stringize + * \see CppUT::checkEquals + */ # define CPPUT_ASSERT_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkEquals + /*! \brief Checks that two values are equal. + * \ingroup group_assertions + * - The values must be comparable using CppUT::equalityTest + * - The values must be convertible to std::string using CppUT::stringize + * \see CppUT::checkEquals + */ # define CPPUT_CHECK_EQUAL \ CPPUT_BEGIN_CHECKING_MACRO() \ ::CppUT::checkEquals + /*! \brief Asserts that two values are not equal. + * \ingroup group_assertions + * - The values must be comparable using CppUT::equalityTest + * - The values must be convertible to std::string using CppUT::stringize + * \see CppUT::checkNotEquals + */ # define CPPUT_ASSERT_NOT_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkNotEquals + /*! \brief Checks that two values are not equal. + * \ingroup group_assertions + * - The values must be comparable using CppUT::equalityTest + * - The values must be convertible to std::string using CppUT::stringize + * \see CppUT::checkNotEquals + */ # define CPPUT_CHECK_NOT_EQUAL \ CPPUT_BEGIN_CHECKING_MACRO() \ ::CppUT::checkNotEquals + /*! \brief Asserts that two double are equals given a tolerance + * \ingroup group_assertions + * \see ::CppUT::checkDoubleEquals + */ # define CPPUT_ASSERT_DOUBLE_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkDoubleEquals + /*! \brief Checks that two double are equals given a tolerance + * \ingroup group_assertions + * \see ::CppUT::checkDoubleEquals + */ # define CPPUT_CHECK_DOUBLE_EQUAL \ CPPUT_BEGIN_CHECKING_MACRO() \ ::CppUT::checkDoubleEquals + /*! \internal + */ # define _CPPUT_ASSERT_THROW_IMPL( assertionType, expression, ExceptionType ) \ do { \ *************** *** 208,217 **** --- 284,302 ---- } while ( false ) + + /*! \brief Asserts that an expression throw an exception of a specified type + * \ingroup group_assertions + */ # define CPPUT_ASSERT_THROW( expression, ExceptionType ) \ _CPPUT_ASSERT_THROW_IMPL( abortingAssertion, expression, ExceptionType ) + /*! \brief Checks that an expression throw an exception of a specified type + * \ingroup group_assertions + */ # define CPPUT_CHECK_THROW( expression, ExceptionType ) \ _CPPUT_CHECK_THROW_IMPL( checkingAssertion, expression, ExceptionType ) + /*! \internal + */ # define _CPPUT_ASSERT_NO_THROW_IMPL( assertionType, expression ) \ try { \ *************** *** 228,246 **** } # define CPPUT_ASSERT_NO_THROW( expression ) \ _CPPUT_ASSERT_NO_THROW_IMPL( abortingAssertion, expression ) # define CPPUT_CHECK_NO_THROW( expression ) \ _CPPUT_ASSERT_NO_THROW_IMPL( checkingAssertion, expression ) ! // Notes: implementing that assertion checking is a bit tricky since all the state ! // about the current test/assertions is stored in a "static" and ! // we don't want the tested assertion to polute the test result ! // of the current test. ! // TestInfo::ScopedContextOverride is used to create a temporary ! // context for the tested assertion. After the assertion, the ! // result of the assertion (did it failed), and the test result ! // properties are captured for later inspection. # define _CPPUT_ASSERT_ASSERTION_FAIL_MESSAGE_IMPL( assertionType, assertion, message ) \ { \ --- 313,340 ---- } + + /*! \brief Asserts that an expression does not throw any exception + * \ingroup group_assertions + */ # define CPPUT_ASSERT_NO_THROW( expression ) \ _CPPUT_ASSERT_NO_THROW_IMPL( abortingAssertion, expression ) + /*! \brief Checks that an expression does not throw any exception + * \ingroup group_assertions + */ # define CPPUT_CHECK_NO_THROW( expression ) \ _CPPUT_ASSERT_NO_THROW_IMPL( checkingAssertion, expression ) ! /*! \internal ! * Notes: implementing that assertion checking is a bit tricky since all the state ! * about the current test/assertions is stored in a "static" and ! * we don't want the tested assertion to polute the test result ! * of the current test. ! * TestInfo::ScopedContextOverride is used to create a temporary ! * context for the tested assertion. After the assertion, the ! * result of the assertion (did it failed), and the test result ! * properties are captured for later inspection. ! */ # define _CPPUT_ASSERT_ASSERTION_FAIL_MESSAGE_IMPL( assertionType, assertion, message ) \ { \ *************** *** 258,273 **** --- 352,381 ---- } + /*! \brief Asserts that an assertion fails (for use to unit test custom assertion) + * \ingroup group_assertions + */ # define CPPUT_ASSERT_ASSERTION_FAIL_MESSAGE( assertion, message ) \ _CPPUT_ASSERT_ASSERTION_FAIL_MESSAGE_IMPL( abortingAssertion, assertion, message ) + /*! \brief Checks that an assertion fails (for use to unit test custom assertion) + * \ingroup group_assertions + */ # define CPPUT_CHECK_ASSERTION_FAIL_MESSAGE( assertion, message ) \ _CPPUT_CHECK_ASSERTION_FAIL_MESSAGE_IMPL( checkingAssertion, assertion, message ) + /*! \brief Asserts that an assertion fails (for use to unit test custom assertion) + * \ingroup group_assertions + */ # define CPPUT_ASSERT_ASSERTION_FAIL( assertion ) \ CPPUT_ASSERT_ASSERTION_FAIL_MESSAGE( assertion, ::CppUT::Message() ) + /*! \brief Checks that an assertion fails (for use to unit test custom assertion) + * \ingroup group_assertions + */ # define CPPUT_CHECK_ASSERTION_FAIL( assertion ) \ CPPUT_CHECK_ASSERTION_FAIL_MESSAGE( assertion, ::CppUT::Message() ) + /*! \internal + */ # define _CPPUT_ASSERT_ASSERTION_PASS_MESSAGE_IMPL( assertionType, assertion, message ) \ { \ *************** *** 285,304 **** } # define CPPUT_ASSERT_ASSERTION_PASS_MESSAGE( assertion, message ) \ _CPPUT_ASSERT_ASSERTION_PASS_MESSAGE_IMPL( abortingAssertion, assertion, message ) # define CPPUT_CHECK_ASSERTION_PASS_MESSAGE( assertion, message ) \ _CPPUT_CHECK_ASSERTION_PASS_MESSAGE_IMPL( checkingAssertion, assertion, message ) # define CPPUT_ASSERT_ASSERTION_PASS( assertion ) \ CPPUT_ASSERT_ASSERTION_PASS_MESSAGE( assertion, ::CppUT::Message() ) # define CPPUT_CHECK_ASSERTION_PASS( assertion ) \ CPPUT_CHECK_ASSERTION_PASS_MESSAGE( assertion, ::CppUT::Message() ) # define CPPUT_SKIP_TEST \ ::CppUT::skipCurrentTest ! /*! Checks that an assertion fail, but ignore its failure * * A typical usage of CPPUT_IGNORE_FAILURE is to ignore a failing assertion temporary. --- 393,434 ---- } + + /*! \brief Asserts that an assertion is successful (for use to unit test custom assertion) + * \ingroup group_assertions + */ # define CPPUT_ASSERT_ASSERTION_PASS_MESSAGE( assertion, message ) \ _CPPUT_ASSERT_ASSERTION_PASS_MESSAGE_IMPL( abortingAssertion, assertion, message ) + + /*! \brief Checks that an assertion is successful (for use to unit test custom assertion) + * \ingroup group_assertions + */ # define CPPUT_CHECK_ASSERTION_PASS_MESSAGE( assertion, message ) \ _CPPUT_CHECK_ASSERTION_PASS_MESSAGE_IMPL( checkingAssertion, assertion, message ) + + /*! \brief Asserts that an assertion is successful (for use to unit test custom assertion) + * \ingroup group_assertions + */ # define CPPUT_ASSERT_ASSERTION_PASS( assertion ) \ CPPUT_ASSERT_ASSERTION_PASS_MESSAGE( assertion, ::CppUT::Message() ) + /*! \brief Checks that an assertion is successful (for use to unit test custom assertion) + * \ingroup group_assertions + */ # define CPPUT_CHECK_ASSERTION_PASS( assertion ) \ CPPUT_CHECK_ASSERTION_PASS_MESSAGE( assertion, ::CppUT::Message() ) + /*! \brief Skips and aborts the current test. + * \ingroup group_assertions + * + * Cause the current test to be skipped. Its status will be 'TestStatus::skipped', + * unless an assertion failed before. + */ # define CPPUT_SKIP_TEST \ ::CppUT::skipCurrentTest ! /*! \brief Checks that an assertion fail, but ignore its failure ! * \ingroup group_assertions * * A typical usage of CPPUT_IGNORE_FAILURE is to ignore a failing assertion temporary. Index: equality.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/equality.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** equality.h 10 Mar 2005 08:23:45 -0000 1.4 --- equality.h 11 Nov 2005 23:23:48 -0000 1.5 *************** *** 15,18 **** --- 15,20 ---- namespace CppUT { + /*! \ingroup group_assertions_support + */ template<class AType, class BType> struct EqualityTraits *************** *** 25,28 **** --- 27,32 ---- + /*! \ingroup group_assertions_support + */ struct NoSpecificEqualityTest { *************** *** 30,33 **** --- 34,39 ---- + /*! \ingroup group_assertions_support + */ inline NoSpecificEqualityTest isEqual( ... ) { *************** *** 51,54 **** --- 57,64 ---- } // namespace Impl + /*! \ingroup group_assertions_support + * @todo change implementation to match stringize. + * @todo delegate to compareTest() => <0, == 0, > 0. Would allow comparison assertions. + */ template<typename AType, typename BType> bool equalityTest( const AType &a, const BType &b ) *************** *** 56,83 **** return Impl::testIsEqual( a, b, isEqual( &a, &b ) ); } ! ! # ifdef CPPUT_HAS_TEMPLATE_PARTIAL_SPECIALIZATION ! template<typename AType, typename BType> ! bool equalityTest( const AType *a, const BType *b ) ! { ! return a == b || ( a && b && equalityTest( *a, *b ) ); ! } ! ! template<typename AType, typename BType> ! bool equalityTest( const CppTL::SharedPtr<AType> &a, const CppTL::SharedPtr<BType> &b ) ! { ! return a.get() == b.get() || ( a.get() && b.get() && equalityTest( *a, *b ) ); ! } ! ! # ifdef CPPUT_BOOST_FRIENDLY ! ! template<typename AType, typename BType> ! bool equalityTest( const boost::shared_ptr<AType> &a, const boost::shared_ptr<BType> &b ) ! { ! return a.get() == b.get() || ( a.get() && b.get() && equalityTest( *a, *b ) ); ! } ! # endif // CPPUT_BOOST_FRIENDLY ! ! # endif // CPPUT_HAS_TEMPLATE_PARTIAL_SPECIALIZATION # endif // CPPUT_NO_DEFAULT_STRINGIZE --- 66,70 ---- return Impl::testIsEqual( a, b, isEqual( &a, &b ) ); } ! # endif // CPPUT_NO_DEFAULT_STRINGIZE Index: registry.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/registry.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** registry.h 9 Nov 2005 21:40:29 -0000 1.7 --- registry.h 11 Nov 2005 23:23:48 -0000 1.8 *************** *** 11,19 **** --- 11,25 ---- namespace CppUT { + /*! \ingroup group_testregistry + */ typedef CppTL::Functor0R<TestPtr> TestFactory; + /*! \ingroup group_testregistry + */ typedef int TestFactoryId; + /*! \ingroup group_testregistry + */ class CPPUT_API Registry { *************** *** 87,90 **** --- 93,98 ---- + /*! \ingroup group_testregistry + */ template<class SuiteType> class SuiteRegisterer *************** *** 135,138 **** --- 143,148 ---- + /*! \ingroup group_testregistry + */ #define CPPUT_REGISTER_NAMED_SUITE_TO_DEFAULT( TestFixtureType, suiteName ) \ static CppUT::SuiteRegisterer< TestFixtureType > \ *************** *** 140,143 **** --- 150,155 ---- + /*! \ingroup group_testregistry + */ #define CPPUT_REGISTER_SUITE_TO_DEFAULT( TestFixtureType ) \ static CppUT::SuiteRegisterer< TestFixtureType > \ *************** *** 145,148 **** --- 157,162 ---- + /*! \ingroup group_testregistry + */ #define CPPUT_REGISTER_SUITE_IN( TestFixtureType, parentSuiteName ) \ static CppUT::SuiteRegisterer< TestFixtureType > \ *************** *** 152,155 **** --- 166,171 ---- + /*! \ingroup group_testregistry + */ #define CPPUT_REGISTER_NAMED_SUITE_IN( TestFixtureType, \ parentSuiteName, \ *************** *** 161,164 **** --- 177,182 ---- suiteName ); + /*! \ingroup group_testregistry + */ class SuiteRelationshipRegisterer { *************** *** 184,187 **** --- 202,207 ---- + /*! \ingroup group_testregistry + */ #define CPPUT_REGISTER_SUITE_RELATIONSHIP( parentSuiteName, childSuiteName ) \ static CppUT::SuiteRelationshipRegisterer \ *************** *** 191,194 **** --- 211,216 ---- + /*! \ingroup group_testregistry + */ #define CPPUT_REGISTER_SUITE_RELATIONSHIP_TO_DEFAULT( childSuiteName ) \ CPPUT_REGISTER_SUITE_RELATIONSHIP( \ Index: dllproxy.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/dllproxy.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dllproxy.h 8 Feb 2004 15:50:01 -0000 1.1 --- dllproxy.h 11 Nov 2005 23:23:48 -0000 1.2 *************** *** 38,46 **** * - Adds the file to the project. */ ! class DllProxy : public NonCopyable { public: /*! \brief Loads the specified library. ! * \param libraryFileName Name of the library to load. * \exception DynamicLibraryManagerException if a failure occurs while loading * the library (fail to found or load the library). --- 38,46 ---- * - Adds the file to the project. */ ! class DllProxy : public CppTL::NonCopyable { public: /*! \brief Loads the specified library. ! * \param path Name of the library to load. * \exception DynamicLibraryManagerException if a failure occurs while loading * the library (fail to found or load the library). Index: stringize.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/stringize.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** stringize.h 7 Nov 2005 22:43:07 -0000 1.8 --- stringize.h 11 Nov 2005 23:23:48 -0000 1.9 *************** *** 32,36 **** namespace CppUT { ! /** A generic functor that can be used to convert a value into a string. * It is used as default argument by function template that allow the user to * pass a specific functor to convert data to string. --- 32,37 ---- namespace CppUT { ! /*! \brief A generic functor that can be used to convert a value into a string. ! * \ingroup group_assertions_support * It is used as default argument by function template that allow the user to * pass a specific functor to convert data to string. *************** *** 46,49 **** --- 47,52 ---- }; + /*! \ingroup group_assertions_support + */ template<class ValueType> struct RefStringizer *************** *** 55,58 **** --- 58,63 ---- }; + /*! \ingroup group_assertions_support + */ template<class ValueType> struct DerefStringizer *************** *** 83,88 **** --- 88,97 ---- // } + /*! \ingroup group_assertions_support + */ struct NotConvertibleToStdString {}; + /*! \ingroup group_assertions_support + */ inline std::string getStdString( const char *cstr ) { *************** *** 90,93 **** --- 99,104 ---- } + /*! \ingroup group_assertions_support + */ inline std::string getStdString( const std::string &s ) { *************** *** 95,98 **** --- 106,111 ---- } + /*! \ingroup group_assertions_support + */ inline std::string getStdString( const CppTL::ConstString &s ) { *************** *** 101,104 **** --- 114,119 ---- #ifdef CPPTL_NO_FUNCTION_TEMPLATE_ORDERING + /*! \ingroup group_assertions_support + */ inline NotConvertibleToStdString getStdString( ... ) { *************** *** 106,109 **** --- 121,126 ---- } #else + /*! \ingroup group_assertions_support + */ template<class T> inline NotConvertibleToStdString getStdString( const T & ) *************** *** 113,116 **** --- 130,135 ---- #endif + /*! \ingroup group_assertions_support + */ template <class StringType> inline std::string convertToString( const StringType &s ) *************** *** 169,172 **** --- 188,193 ---- } // namespace Impl + /*! \ingroup group_assertions_support + */ template<typename ValueType> std::string stringize( const ValueType &value ) *************** *** 188,191 **** --- 209,214 ---- namespace CppUT { + /*! \ingroup group_assertions_support + */ template<typename ValueType> std::string defaultStringize( const ValueType &value ) Index: testcase.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testcase.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** testcase.h 8 Nov 2005 21:44:54 -0000 1.12 --- testcase.h 11 Nov 2005 23:23:48 -0000 1.13 *************** *** 10,14 **** namespace CppUT { ! class CPPUT_API AbstractTestCase : public Test { --- 10,16 ---- namespace CppUT { ! /*! An abstract test case that can be run. ! * \ingroup group_testcases ! */ class CPPUT_API AbstractTestCase : public Test { *************** *** 41,44 **** --- 43,49 ---- + /*! A test case that can be run. + * \ingroup group_testcases + */ class CPPUT_API TestCase : public AbstractTestCase { *************** *** 66,73 **** --- 71,85 ---- + + /*! Creates a TestCase with the specified name and run functor. + * \ingroup group_testcases + */ TestPtr CPPUT_API makeTestCase( const CppTL::Functor0 &run, const std::string &name ); + /*! Creates a TestCase with the specified name and setUp, run, and tearDown functor. + * \ingroup group_testcases + */ TestPtr CPPUT_API makeTestCase( const CppTL::Functor0 &setUp, const CppTL::Functor0 &run, *************** *** 75,82 **** const std::string &name ); TestPtr CPPUT_API makeFailingTestCase( const std::string &name, const Message &message ); ! /// @todo Use traits to get smart-pointer type and allow for any type of smart-pointer template<typename FixtureType> TestPtr makeFixtureTestCase( const CppTL::IntrusivePtr<FixtureType> &fixture, --- 87,108 ---- const std::string &name ); + /*! Creates a TestCase with the specified name that will always fail. + * \ingroup group_testcases + * + * The test case run body simply call CPPUT_FAIL() with the specified message. + * + * This is useful for example when a TestSuite is created from input data + * and those an invalid or inaccessible. A failing test case can be added to + * the suite to report the error. + */ TestPtr CPPUT_API makeFailingTestCase( const std::string &name, const Message &message ); ! /*! Creates a TestCase using a fixture-like object. ! * \ingroup group_testcases ! * ! * The test case will delegate implementation of AbstractTestCase setUp() and ! * tearDown() to method of the same name on the given \c fixture object. ! */ template<typename FixtureType> TestPtr makeFixtureTestCase( const CppTL::IntrusivePtr<FixtureType> &fixture, *************** *** 84,87 **** --- 110,114 ---- const std::string &name ) { + /// @todo Use traits to get smart-pointer type and allow for any type of smart-pointer return makeTestCase( CppTL::memfn0( fixture, &FixtureType::setUp ), run, Index: exceptionguard.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/exceptionguard.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** exceptionguard.h 11 Nov 2005 20:54:15 -0000 1.4 --- exceptionguard.h 11 Nov 2005 23:23:48 -0000 1.5 *************** *** 18,21 **** --- 18,24 ---- namespace CppUT { + /*! + * \ingroup group_testcases + */ class CPPUT_API ExceptionGuardElement : public CppTL::IntrusiveCount { *************** *** 43,46 **** --- 46,50 ---- * \warning Ensure that either a fault, assertion is added to TestInfo, or * that TestStatus is set to \c failed otherwise the test will not fail! + * \ingroup group_testcases */ template<class ExceptionType *************** *** 73,77 **** /** ! * @see registerExceptionTranslation() to easily register custom exception translator. */ class CPPUT_API ExceptionGuard --- 77,82 ---- /** ! * \ingroup group_testcases ! * \see registerExceptionTranslation() to easily register custom exception translator. */ class CPPUT_API ExceptionGuard *************** *** 94,98 **** ! /** Register an exception translator. * @todo provides some helper to generate fault result... * \code --- 99,104 ---- ! /*! \brief Register an exception translator. ! * \ingroup group_testcases * @todo provides some helper to generate fault result... * \code Index: assertstring.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/assertstring.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** assertstring.h 27 Feb 2005 10:13:36 -0000 1.3 --- assertstring.h 11 Nov 2005 23:23:48 -0000 1.4 *************** *** 69,84 **** --- 69,100 ---- // string assertions + + /*! \brief Asserts that a string starts with the specified character sequence. + * \ingroup group_assertions + */ # define CPPUT_ASSERTSTR_START \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkStringStartsWith + /*! \brief Asserts that a string ends with the specified character sequence. + * \ingroup group_assertions + */ # define CPPUT_ASSERTSTR_END \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkStringEndsWith + /*! \brief Asserts that a string contains the specified character sequence. + * \ingroup group_assertions + */ # define CPPUT_ASSERTSTR_CONTAIN \ CPPUT_BEGIN_ASSERTION_MACRO() \ ::CppUT::checkStringContains + /*! \brief Asserts that two string are identical. + * \ingroup group_assertions + * + * Useful to compare \c const \c char \c * or string of different C++ types + * (MFC \c CString and \c std::string for example). + */ # define CPPUT_ASSERTSTR_EQUAL \ CPPUT_BEGIN_ASSERTION_MACRO() \ Index: extendeddata.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/extendeddata.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** extendeddata.h 6 Aug 2005 22:24:52 -0000 1.1 --- extendeddata.h 11 Nov 2005 23:23:48 -0000 1.2 *************** *** 9,13 **** ! /** \brief Helper to set test extended data (description, time-out, dependencies...) * * Example of usage: --- 9,14 ---- ! /*! \brief Helper to set test extended data (description, time-out, dependencies...) ! * \ingroup group_testfixture * * Example of usage: *************** *** 31,39 **** * test.setDependenciesFromPackedString( "testInit" ); * } ! * \end * * The only purpose of this class is to make it easy to set test properties without * direct access to the test object. It is used to implement the macro ! * \link CPPUT_TEST_WITH_SPECIFICS(). */ class TestExtendedDataHelper --- 32,41 ---- * test.setDependenciesFromPackedString( "testInit" ); * } ! * \endcode * * The only purpose of this class is to make it easy to set test properties without * direct access to the test object. It is used to implement the macro ! * \link CPPUT_TEST_WITH_SPECIFICS() \endlink. ! * \ingroup group_testfixture */ class TestExtendedDataHelper *************** *** 50,53 **** --- 52,57 ---- + /*! \ingroup group_testfixture + */ class CPPUT_API TestExtendedData { *************** *** 61,64 **** --- 65,70 ---- + /*! \ingroup group_testfixture + */ class TestExtendedDataList : public TestExtendedData { *************** *** 75,78 **** --- 81,86 ---- + /*! \ingroup group_testfixture + */ class CPPUT_API DescriptionData : public TestExtendedData { *************** *** 88,91 **** --- 96,101 ---- + /*! \ingroup group_testfixture + */ class CPPUT_API TimeOutData : public TestExtendedData { *************** *** 101,104 **** --- 111,116 ---- + /*! \ingroup group_testfixture + */ class CPPUT_API DependenciesData : public TestExtendedData { *************** *** 113,116 **** --- 125,130 ---- + /*! \ingroup group_testfixture + */ class CPPUT_API TestExtendedDataFactory { Index: testfixture.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/testfixture.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** testfixture.h 8 Nov 2005 23:25:31 -0000 1.12 --- testfixture.h 11 Nov 2005 23:23:48 -0000 1.13 *************** *** 13,16 **** --- 13,18 ---- + /*! \ingroup group_testfixture + */ class CPPUT_API TestFixture : public CppTL::IntrusiveCount , public TestExtendedDataFactory *************** *** 146,149 **** --- 148,153 ---- + /*! \ingroup group_testfixture + */ # define CPPUT_TESTSUITE_BEGIN( FixtureType ) \ public: \ *************** *** 162,169 **** --- 166,177 ---- ::CppTL::IntrusivePtr<FixtureType> fixture + /*! \ingroup group_testfixture + */ # define CPPUT_TESTSUITE_EXTEND( FixtureType, ParentFixtureType ) \ CPPUT_TESTSUITE_BEGIN( FixtureType ); \ ParentFixtureType::addTests_( suite, factory_ ) + /*! \ingroup group_testfixture + */ # define CPPUT_TESTSUITE_END() \ } \ *************** *** 180,186 **** --- 188,198 ---- } + /*! \ingroup group_testfixture + */ # define CPPUT_ABSTRACT_TESTSUITE_END() \ } + /*! \ingroup group_testfixture + */ # define CPPUT_TEST( testMethod ) \ fixture = fixtureFactory(); \ *************** *** 190,193 **** --- 202,207 ---- #testMethod ) ) + /*! \ingroup group_testfixture + */ # define CPPUT_TEST_WITH_SPECIFICS( testMethod, specifics ) \ fixture = fixtureFactory(); \ Index: config.h =================================================================== RCS file: /cvsroot/cppunit/cppunit2/include/cpput/config.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** config.h 6 Mar 2005 18:39:50 -0000 1.12 --- config.h 11 Nov 2005 23:23:48 -0000 1.13 *************** *** 88,118 **** # endif - - namespace CppUT { - - // defines YesType and NoType for simple generic programming - struct YesType {}; - struct NoType { char padding[256]; }; - - - /// Base class for non copyable class. - class CPPUT_API NonCopyable - { - public: - NonCopyable() - { - } - - ~NonCopyable() - { - } - - private: - NonCopyable( const NonCopyable &other ); - void operator =( const NonCopyable &other ); - }; - - } // namespace CppUT - - #endif // CPPUT_CONFIG_H_INCLUDED --- 88,90 ---- |