diff options
| author | Steve M. Robbins <smr@sumost.ca> | 2001-06-02 21:29:52 +0000 |
|---|---|---|
| committer | Steve M. Robbins <smr@sumost.ca> | 2001-06-02 21:29:52 +0000 |
| commit | cdbca4119defbc5f9698906633eec05b5dc8272a (patch) | |
| tree | 6f0fc91b8cb7cc7b361966ffc8ab2e401e1e4c6e /include/cppunit/extensions | |
| parent | 99f54c0f4b53debc49f2081ce01158b2ed200c30 (diff) | |
| download | cppunit-cdbca4119defbc5f9698906633eec05b5dc8272a.tar.gz | |
Change to templatized TestAssert::assertEquals() and the new CPPUNIT_ASSERT* macros
Diffstat (limited to 'include/cppunit/extensions')
| -rw-r--r-- | include/cppunit/extensions/HelperMacros.h | 13 | ||||
| -rw-r--r-- | include/cppunit/extensions/Orthodox.h | 10 | ||||
| -rw-r--r-- | include/cppunit/extensions/TestSuiteBuilder.h | 9 | ||||
| -rw-r--r-- | include/cppunit/extensions/TypeInfoHelper.h | 4 |
4 files changed, 19 insertions, 17 deletions
diff --git a/include/cppunit/extensions/HelperMacros.h b/include/cppunit/extensions/HelperMacros.h index 12defe8..17784ea 100644 --- a/include/cppunit/extensions/HelperMacros.h +++ b/include/cppunit/extensions/HelperMacros.h @@ -7,6 +7,7 @@ #define CPPUNIT_EXTENSIONS_HELPERMACROS_H #include <string> +#include <cppunit/config.h> #include <cppunit/extensions/AutoRegisterSuite.h> #include <cppunit/extensions/TestSuiteBuilder.h> @@ -17,13 +18,11 @@ // defined, otherwise it is extracted from the macro parameter // // This macro is for cppunit internal and should not be use otherwise. -#ifdef CPPUNIT_USE_TYPEINFO -#define __CPPUNIT_SUITE_CTOR_ARGS( ATestCaseType ) - -#else // CPPUNIT_USE_TYPEINFO -#define __CPPUNIT_SUITE_CTOR_ARGS( ATestCaseType ) (std::string(#ATestCaseType)) - -#endif // CPPUNIT_USE_TYPEINFO +#if CPPUNIT_USE_TYPEINFO +# define __CPPUNIT_SUITE_CTOR_ARGS( ATestCaseType ) +#else +# define __CPPUNIT_SUITE_CTOR_ARGS( ATestCaseType ) (std::string(#ATestCaseType)) +#endif /** \file diff --git a/include/cppunit/extensions/Orthodox.h b/include/cppunit/extensions/Orthodox.h index e7667d1..39506f1 100644 --- a/include/cppunit/extensions/Orthodox.h +++ b/include/cppunit/extensions/Orthodox.h @@ -58,25 +58,25 @@ template <typename ClassUnderTest> void Orthodox<ClassUnderTest>::runTest () ClassUnderTest a, b, c; // make sure we have an equality operator - assert (a == b); + CPPUNIT_ASSERT (a == b); // check the inverse b.operator= (a.operator! ()); - assert (a != b); + CPPUNIT_ASSERT (a != b); // double inversion b = !!a; - assert (a == b); + CPPUNIT_ASSERT (a == b); // invert again b = !a; // check calls c = a; - assert (c == call (a)); + CPPUNIT_ASSERT (c == call (a)); c = b; - assert (c == call (b)); + CPPUNIT_ASSERT (c == call (b)); } diff --git a/include/cppunit/extensions/TestSuiteBuilder.h b/include/cppunit/extensions/TestSuiteBuilder.h index c1c6906..8536f1c 100644 --- a/include/cppunit/extensions/TestSuiteBuilder.h +++ b/include/cppunit/extensions/TestSuiteBuilder.h @@ -2,12 +2,13 @@ #define CPPUNIT_EXTENSIONS_TESTSUITEBUILDER_H #include <memory> +#include <cppunit/config.h> #include <cppunit/TestSuite.h> #include <cppunit/TestCaller.h> -#ifdef CPPUNIT_USE_TYPEINFO -#include <cppunit/extensions/TypeInfoHelper.h> -#endif // CPPUNIT_USE_TYPEINFO +#if CPPUNIT_USE_TYPEINFO +# include <cppunit/extensions/TypeInfoHelper.h> +#endif namespace CppUnit { @@ -17,7 +18,7 @@ namespace CppUnit { public: typedef void (Fixture::*TestMethod)(); -#ifdef CPPUNIT_USE_TYPEINFO +#if CPPUNIT_USE_TYPEINFO TestSuiteBuilder() : m_suite( new TestSuite( TypeInfoHelper::getClassName( typeid(Fixture) ) ) ) diff --git a/include/cppunit/extensions/TypeInfoHelper.h b/include/cppunit/extensions/TypeInfoHelper.h index 6dd6ae8..1b5cdb7 100644 --- a/include/cppunit/extensions/TypeInfoHelper.h +++ b/include/cppunit/extensions/TypeInfoHelper.h @@ -1,7 +1,9 @@ #ifndef CPPUNIT_TYPEINFOHELPER_H #define CPPUNIT_TYPEINFOHELPER_H -#ifdef CPPUNIT_USE_TYPEINFO +#include <cppunit/config.h> + +#if CPPUNIT_USE_TYPEINFO #include <typeinfo> |
