diff options
| author | Baptiste Lepilleur <gaiacrtn@free.fr> | 2002-08-27 20:51:18 +0000 |
|---|---|---|
| committer | Baptiste Lepilleur <gaiacrtn@free.fr> | 2002-08-27 20:51:18 +0000 |
| commit | c86c65b7d821fe4bb046c489528108843513e63d (patch) | |
| tree | 0df76dcf21360b74ec3a401f8b077da5d839f2e9 /src/cppunit | |
| parent | 69a36d9356412dddb51d8f31fbbac45ac52f7f30 (diff) | |
| download | cppunit-c86c65b7d821fe4bb046c489528108843513e63d.tar.gz | |
CodingGuideLines.
CodingGuideLines.txt: updated for OS/390 C++ limitation.
* examples/cppunittests/MockFunctor.h: added. Mock Functor to help
testing.
* examples/cppunittests/MockProtector.h: qdded. Mock Protector to help
testing.
* examples/cppunittests/TestResultTest.h
* examples/cppunittests/TestResultTest.cpp: added tests for
pushProtector(), popProtector() and protect().
* include/cppunit/TestAssert.h: removed default message value from
assertEquals(). Caused compilation error on OS/390.
* include/cppunit/plugin/PlugInParameters.h:
* src/cppunit/PlugInParameters.cpp: renamed commandLine() to
getCommandLine().
* src/msvc6/testrunner/TestRunnerDlg.h:
* src/msvc6/testrunner/TestRunnerDlg.cpp: bug fix, disabled Browse
button while running tests.
Diffstat (limited to 'src/cppunit')
| -rw-r--r-- | src/cppunit/DefaultProtector.cpp | 7 | ||||
| -rw-r--r-- | src/cppunit/Makefile.am | 3 | ||||
| -rw-r--r-- | src/cppunit/PlugInManager.cpp | 2 | ||||
| -rw-r--r-- | src/cppunit/PlugInParameters.cpp | 28 | ||||
| -rw-r--r-- | src/cppunit/ProtectorChain.cpp | 2 | ||||
| -rw-r--r-- | src/cppunit/TestPlugInDefaultImpl.cpp | 2 | ||||
| -rw-r--r-- | src/cppunit/XmlDocument.cpp | 2 | ||||
| -rw-r--r-- | src/cppunit/cppunit.dsp | 10 | ||||
| -rw-r--r-- | src/cppunit/cppunit_dll.dsp | 10 |
9 files changed, 49 insertions, 17 deletions
diff --git a/src/cppunit/DefaultProtector.cpp b/src/cppunit/DefaultProtector.cpp index d05765c..72460a2 100644 --- a/src/cppunit/DefaultProtector.cpp +++ b/src/cppunit/DefaultProtector.cpp @@ -12,12 +12,7 @@ DefaultProtector::protect( const Functor &functor, { try { - // BUG: => should return what is returned. Need to update - // UT to prove there is a bug. Consequence: runTest() is called - // even if setUp() failed in a 'sub-protector'. - functor(); - return true; -// return functor(); + return functor(); } catch ( Exception &failure ) { diff --git a/src/cppunit/Makefile.am b/src/cppunit/Makefile.am index 010b44d..4622f09 100644 --- a/src/cppunit/Makefile.am +++ b/src/cppunit/Makefile.am @@ -1,5 +1,5 @@ # -# $Id: Makefile.am,v 1.39 2002-08-04 11:04:18 blep Exp $ +# $Id: Makefile.am,v 1.40 2002-08-27 21:51:18 blep Exp $ # EXTRA_DIST = cppunit.dsp cppunit_dll.dsp DllMain.cpp @@ -21,6 +21,7 @@ libcppunit_la_SOURCES = \ Message.cpp \ RepeatedTest.cpp \ PlugInManager.cpp \ + PlugInParameter.cpp \ Protector.cpp \ ProtectorChain.h \ ProtectorContext.h \ diff --git a/src/cppunit/PlugInManager.cpp b/src/cppunit/PlugInManager.cpp index 67fbfd2..77e6dc8 100644 --- a/src/cppunit/PlugInManager.cpp +++ b/src/cppunit/PlugInManager.cpp @@ -24,7 +24,7 @@ PlugInManager::~PlugInManager() void PlugInManager::load( const std::string &libraryFileName, - const Parameters ¶meters ) + const PlugInParameters ¶meters ) { PlugInInfo info; info.m_fileName = libraryFileName; diff --git a/src/cppunit/PlugInParameters.cpp b/src/cppunit/PlugInParameters.cpp new file mode 100644 index 0000000..71b55dc --- /dev/null +++ b/src/cppunit/PlugInParameters.cpp @@ -0,0 +1,28 @@ +#if !defined(CPPUNIT_NO_TESTPLUGIN) + +#include <cppunit/plugin/PlugInParameters.h> + +CPPUNIT_NS_BEGIN + + +PlugInParameters::PlugInParameters( const std::string &commandLine ) + : m_commandLine( commandLine ) +{ +} + + +PlugInParameters::~PlugInParameters() +{ +} + + +std::string +PlugInParameters::getCommandLine() const +{ + return m_commandLine; +} + + +CPPUNIT_NS_END + +#endif // !defined(CPPUNIT_NO_TESTPLUGIN) diff --git a/src/cppunit/ProtectorChain.cpp b/src/cppunit/ProtectorChain.cpp index f4c8bed..8cede2b 100644 --- a/src/cppunit/ProtectorChain.cpp +++ b/src/cppunit/ProtectorChain.cpp @@ -63,7 +63,7 @@ ProtectorChain::protect( const Functor &functor, return functor(); Functors functors; - for ( int index = 0; index < m_protectors.size(); ++index ) + for ( int index = m_protectors.size()-1; index >= 0; --index ) { const Functor &protectedFunctor = functors.empty() ? functor : *functors.back(); diff --git a/src/cppunit/TestPlugInDefaultImpl.cpp b/src/cppunit/TestPlugInDefaultImpl.cpp index 54101e7..5d4c555 100644 --- a/src/cppunit/TestPlugInDefaultImpl.cpp +++ b/src/cppunit/TestPlugInDefaultImpl.cpp @@ -22,7 +22,7 @@ TestPlugInDefaultImpl::~TestPlugInDefaultImpl() void TestPlugInDefaultImpl::initialize( TestFactoryRegistry *registry, - const Parameters ¶meters ) + const PlugInParameters ¶meters ) { } diff --git a/src/cppunit/XmlDocument.cpp b/src/cppunit/XmlDocument.cpp index 141fb45..486c263 100644 --- a/src/cppunit/XmlDocument.cpp +++ b/src/cppunit/XmlDocument.cpp @@ -31,7 +31,7 @@ XmlDocument::encoding() const void XmlDocument::setEncoding( const std::string &encoding ) { - m_encoding = encoding.empty() ? "ISO-8859-1" : encoding; + m_encoding = encoding.empty() ? std::string("ISO-8859-1") : encoding; } diff --git a/src/cppunit/cppunit.dsp b/src/cppunit/cppunit.dsp index ba25beb..285a2b3 100644 --- a/src/cppunit/cppunit.dsp +++ b/src/cppunit/cppunit.dsp @@ -556,15 +556,19 @@ SOURCE=..\..\include\cppunit\plugin\DynamicLibraryManagerException.h # End Source File # Begin Source File -SOURCE=..\..\include\cppunit\plugin\Parameters.h +SOURCE=.\PlugInManager.cpp # End Source File # Begin Source File -SOURCE=.\PlugInManager.cpp +SOURCE=..\..\include\cppunit\plugin\PlugInManager.h # End Source File # Begin Source File -SOURCE=..\..\include\cppunit\plugin\PlugInManager.h +SOURCE=.\PlugInParameters.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\include\cppunit\plugin\PlugInParameters.h # End Source File # Begin Source File diff --git a/src/cppunit/cppunit_dll.dsp b/src/cppunit/cppunit_dll.dsp index f42f123..d4cbabb 100644 --- a/src/cppunit/cppunit_dll.dsp +++ b/src/cppunit/cppunit_dll.dsp @@ -551,15 +551,19 @@ SOURCE=..\..\include\cppunit\plugin\DynamicLibraryManagerException.h # End Source File # Begin Source File -SOURCE=..\..\include\cppunit\plugin\Parameters.h +SOURCE=.\PlugInManager.cpp # End Source File # Begin Source File -SOURCE=.\PlugInManager.cpp +SOURCE=..\..\include\cppunit\plugin\PlugInManager.h # End Source File # Begin Source File -SOURCE=..\..\include\cppunit\plugin\PlugInManager.h +SOURCE=.\PlugInParameters.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\include\cppunit\plugin\PlugInParameters.h # End Source File # Begin Source File |
