[Cppunit-cvs] cppunit2/include/cpput assert.h,1.16,1.17 assertenum.h,1.10,1.11 assertstring.h,1.3,1.
Brought to you by:
blep
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 ---- |