[Cppunit-cvs] cppunit2/include/cpput assert.h,1.17,1.18 exceptionguard.h,1.5,1.6 stringize.h,1.9,1.1
Brought to you by:
blep
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. |