summaryrefslogtreecommitdiff
path: root/src/cppunit
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2002-07-14 18:48:32 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2002-07-14 18:48:32 +0000
commit251c1ff8aecaa608ef9e6041c2691d369430bf7b (patch)
tree183795a04e06a8a94a64214afc2a1cc8a12a5486 /src/cppunit
parent0807889cb53679c5a9e741e8dedc3668ef59729b (diff)
downloadcppunit-251c1ff8aecaa608ef9e6041c2691d369430bf7b.tar.gz
CodingGuideLines.
CodingGuideLines.txt: added. CppUnit's coding guidelines for portability. * include/cppunit/portability/CppUnitStack.h: added. wrapper for std::stack. * include/cppunit/portability/CppUnitSet.h: added. wrapper for std::set. * include/cppunit/ui/text/TestRunner.h: fixed namespace definition for deprecated TestRunner. * include/cppunit/TestAssert.h: * src/cppunit/TestAssert.cpp: removed old deprecated functions that did not use SourceLine. Moved assertEquals() and assertDoubleEquals() into CppUnit namespace. * src/cppunit/TestFactoryRegistry.cpp: use CppUnitMap instead of std::map. * src/DllPlugInTester/CommandLineParser.h: use CppUnitDeque instead std::deque. * examples/cppunittest/*.h: * examples/cppunittest/*.cpp: removed all usage of CppUnitTest namespace. Everything is now in global space. * examples/*/*.h: * examples/*/*.cpp: replaced usage of CppUnit:: with CPPUNIT_NS::. * examples/ClockerPlugIn/ClockerModel.h: use CppUnit STL wrapper instead of STL container.
Diffstat (limited to 'src/cppunit')
-rw-r--r--src/cppunit/TestAssert.cpp55
-rw-r--r--src/cppunit/TestFactoryRegistry.cpp4
-rw-r--r--src/cppunit/cppunit.dsp12
-rw-r--r--src/cppunit/cppunit_dll.dsp32
4 files changed, 50 insertions, 53 deletions
diff --git a/src/cppunit/TestAssert.cpp b/src/cppunit/TestAssert.cpp
index 8d9ad80..484f372 100644
--- a/src/cppunit/TestAssert.cpp
+++ b/src/cppunit/TestAssert.cpp
@@ -10,55 +10,11 @@
CPPUNIT_NS_BEGIN
-#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
-/// Check for a failed general assertion
void
-TestAssert::assertImplementation( bool condition,
- std::string conditionExpression,
- long lineNumber,
- std::string fileName )
-{
- Asserter::failIf( condition,
- conditionExpression,
- SourceLine( fileName, lineNumber ) );
-}
-
-
-/// Reports failed equality
-void
-TestAssert::assertNotEqualImplementation( std::string expected,
- std::string actual,
- long lineNumber,
- std::string fileName )
-{
- Asserter::failNotEqual( expected,
- actual,
- SouceLine( fileName, lineNumber ), "" );
-}
-
-
-/// Check for a failed equality assertion
-void
-TestAssert::assertEquals( double expected,
- double actual,
- double delta,
- long lineNumber,
- std::string fileName )
-{
- if (fabs (expected - actual) > delta)
- assertNotEqualImplementation( assertion_traits<double>::toString(expected),
- assertion_traits<double>::toString(actual),
- lineNumber,
- fileName );
-}
-
-#else // CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
-
-void
-TestAssert::assertDoubleEquals( double expected,
- double actual,
- double delta,
- SourceLine sourceLine )
+assertDoubleEquals( double expected,
+ double actual,
+ double delta,
+ SourceLine sourceLine )
{
Asserter::failNotEqualIf( fabs( expected - actual ) > delta,
assertion_traits<double>::toString(expected),
@@ -67,7 +23,4 @@ TestAssert::assertDoubleEquals( double expected,
}
-#endif
-
-
CPPUNIT_NS_END
diff --git a/src/cppunit/TestFactoryRegistry.cpp b/src/cppunit/TestFactoryRegistry.cpp
index 095caa6..663237a 100644
--- a/src/cppunit/TestFactoryRegistry.cpp
+++ b/src/cppunit/TestFactoryRegistry.cpp
@@ -1,6 +1,6 @@
#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/portability/CppUnitMap.h>
#include <cppunit/TestSuite.h>
-#include <map>
#include <assert.h>
@@ -11,7 +11,7 @@ CPPUNIT_NS_BEGIN
class TestFactoryRegistryList
{
private:
- typedef std::map<std::string, TestFactoryRegistry *> Registries;
+ typedef CppUnitMap<std::string, TestFactoryRegistry *> Registries;
Registries m_registries;
enum State {
diff --git a/src/cppunit/cppunit.dsp b/src/cppunit/cppunit.dsp
index 76564e1..e0bd8c6 100644
--- a/src/cppunit/cppunit.dsp
+++ b/src/cppunit/cppunit.dsp
@@ -103,6 +103,10 @@ SOURCE=..\..\ChangeLog
# End Source File
# Begin Source File
+SOURCE=..\..\CodingGuideLines.txt
+# End Source File
+# Begin Source File
+
SOURCE=..\..\doc\cookbook.dox
# End Source File
# Begin Source File
@@ -223,6 +227,14 @@ SOURCE=..\..\include\cppunit\portability\CppUnitMap.h
# End Source File
# Begin Source File
+SOURCE=..\..\include\cppunit\portability\CppUnitSet.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\portability\CppUnitStack.h
+# End Source File
+# Begin Source File
+
SOURCE=..\..\include\cppunit\portability\CppUnitVector.h
# End Source File
# Begin Source File
diff --git a/src/cppunit/cppunit_dll.dsp b/src/cppunit/cppunit_dll.dsp
index acef366..71e720f 100644
--- a/src/cppunit/cppunit_dll.dsp
+++ b/src/cppunit/cppunit_dll.dsp
@@ -399,6 +399,30 @@ SOURCE="..\..\include\cppunit\config\config-msvc6.h"
# End Source File
# Begin Source File
+SOURCE=..\..\include\cppunit\config\CppUnitApi.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\portability\CppUnitDeque.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\portability\CppUnitMap.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\portability\CppUnitSet.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\portability\CppUnitStack.h
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\portability\CppUnitVector.h
+# End Source File
+# Begin Source File
+
SOURCE=..\..\include\cppunit\Portability.h
# End Source File
# Begin Source File
@@ -411,12 +435,20 @@ SOURCE=..\..\include\cppunit\config\SelectDllLoader.h
# PROP Default_Filter ""
# Begin Source File
+SOURCE=..\..\include\cppunit\ui\text\TestRunner.h
+# End Source File
+# Begin Source File
+
SOURCE=.\TextTestRunner.cpp
# End Source File
# Begin Source File
SOURCE=..\..\include\cppunit\TextTestRunner.h
# End Source File
+# Begin Source File
+
+SOURCE=..\..\include\cppunit\ui\text\TextTestRunner.h
+# End Source File
# End Group
# Begin Group "listener"