[cppunit] 05/38: Import Upstream version 1.10.2
Rene Engelhard
rene at moszumanska.debian.org
Sun May 14 10:57:33 UTC 2017
This is an automated email from the git hooks/post-receive script.
rene pushed a commit to branch experimental
in repository cppunit.
commit b19fb2e9b47d58e0658cd1a30f8b6ad32faa7e64
Author: Rene Engelhard <rene at rene-engelhard.de>
Date: Sat May 13 20:41:58 2017 +0200
Import Upstream version 1.10.2
---
ChangeLog | 38 ++++++++++++++++++++++
INSTALL-WIN32.txt | 7 +++-
NEWS | 29 +++++++++++++++++
TODO | 9 -----
configure | 2 +-
configure.in | 2 +-
cppunit.spec | 2 +-
doc/Makefile.am | 2 +-
doc/Makefile.in | 2 +-
examples/cppunittest/CppUnitTestMain.dsp | 10 +++---
examples/simple/simple_plugin.dsp | 4 +--
include/cppunit/Portability.h | 6 +++-
.../cppunit/extensions/TestSuiteBuilderContext.h | 11 ++++++-
include/cppunit/plugin/TestPlugIn.h | 1 +
src/DllPlugInTester/CommandLineParser.cpp | 2 +-
src/DllPlugInTester/CommandLineParser.h | 2 +-
src/DllPlugInTester/CommandLineParserTest.cpp | 24 +++++++-------
src/DllPlugInTester/CommandLineParserTest.h | 2 +-
src/DllPlugInTester/DllPlugInTester.cpp | 2 +-
src/DllPlugInTester/DllPlugInTester.dsp | 8 ++---
src/cppunit/TestPath.cpp | 5 ++-
src/cppunit/TestSuiteBuilderContext.cpp | 30 +++++++++++++----
src/cppunit/cppunit.dsp | 4 +--
src/cppunit/cppunit_dll.dsp | 4 +--
src/msvc6/testpluginrunner/TestPlugIn.cpp | 8 +++++
src/msvc6/testpluginrunner/TestPlugInException.cpp | 7 ++++
src/msvc6/testpluginrunner/TestPlugInRunner.dsp | 4 +--
src/msvc6/testpluginrunner/TestPlugInRunnerApp.cpp | 14 ++------
.../testpluginrunner/TestPlugInRunnerModel.cpp | 25 ++++++++++++++
src/msvc6/testpluginrunner/TestPlugInRunnerModel.h | 6 ++++
src/msvc6/testrunner/ActiveTest.cpp | 6 ++++
src/msvc6/testrunner/ListCtrlSetter.cpp | 7 ++++
src/msvc6/testrunner/MostRecentTests.cpp | 7 ++++
src/msvc6/testrunner/ResourceLoaders.cpp | 8 +++++
src/msvc6/testrunner/TestRunner.dsp | 8 ++---
src/msvc6/testrunner/TestRunnerDlg.cpp | 11 ++++---
src/msvc6/testrunner/TestRunnerDlg.h | 2 +-
src/msvc6/testrunner/TestRunnerModel.cpp | 7 ++++
38 files changed, 251 insertions(+), 77 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ba1221e..678bb62 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,41 @@
+2004-06-18 Baptiste Lepilleur <gaiacrtn at free.fr>
+
+ * Release 10.0.2
+
+ * include/cppunit/extension/TestSuiteBuilderContext.h:
+ * src/cppunit/TestSuiteBuilderContext.cpp: fixed bug #921843. This bug
+ was caused by a known STL bug in VC++ 6.
+ See http://www.dinkumware.com/vc_fixes.html <xtree> issue with shared
+ std::map in dll. As a work-around the map has been replaced by a vector.
+
+ * src/DllPlugInTester/*.cpp: bug #941625, string literal using char *
+ instead of const char *. Patch contributed by Curt Arnold has been
+ applied.
+
+ * src/msvc6/testrunner/TestRunnerDlg.h:
+ * src/msvc6/testrunner/TestRunnerDlg.cpp:
+ * src/msvc6/testpluginrunner/TestPlugIn.cpp:
+ * src/msvc6/testpluginrunner/TestPlugInRunnerApp.cpp:
+ * src/msvc6/testpluginrunner/TestPlugInRunnerModel.cpp:
+ * src/msvc6/testpluginrunner/TestPlugInRunnerModel.h: bug #952912,
+ memory leaks when loading/reloading plug-ins.
+
+2004-06-17 Baptiste Lepilleur <gaiacrtn at free.fr>
+
+ * include/cppunit/Portability.h:
+ * include/cppunit/plugin/TestPlugIn.h: fixed report compilation issue
+ with mingw & cygwin. WIN32 is now always defined if _WIN32 is defined.
+ Bug #945737 & #930338.
+
+ * doc/Makefile.am: fixed bug #940650 => cp -dpR, removed option -p since
+ there is no link to preserve anyway (does not exist on SunOs).
+
+ * src/cppunit/TestPath.cpp: bug #938753, array bound read in
+ splitPathString() with substr if an empty string is passed.
+
+ * src/*/*.dsp: bug #933154, post build fail in directory with spaces.
+
+
2004-06-16 Baptiste Lepilleur <gaiacrtn at free.fr>
* release 1.10.0
diff --git a/INSTALL-WIN32.txt b/INSTALL-WIN32.txt
index 428bff0..3dcc726 100644
--- a/INSTALL-WIN32.txt
+++ b/INSTALL-WIN32.txt
@@ -5,7 +5,8 @@ At the current time, the only supported WIN32 platform is
Microsoft Visual C++. You must have VC++ 6.0 at least.
Quick Steps to compile & run a sample using the GUI TestRunner:
-- Open examples/examples.dsw in VC++ (contains all the samples)
+- Open examples/examples.dsw in VC++ (contains all the samples).
+ VC7 will ask you if you want to convert, anwser 'yes to all'.
- Make HostApp the Active project
- Compile
- in VC++, Tools/Customize.../Add-ins and macro files/Browse...
@@ -196,3 +197,7 @@ defined in include/msvc6/testrunner/TestPlugInInterface.h.
See examples/msvc6/TestPlugIn/TestPlugInInterfaceImpl.* for an example.
Be warned, that runner is still experimental and have not been tested
much.
+
+ If you did a batch build, run TestPlugInRunnerd.exe and choose dll
+ examples/cppunittest/DebugPlugIn/CppUnitTestPlugInd.dll, or
+ examples/simple/DebugPlugIn/simple_plugind.dll to test it out.
diff --git a/NEWS b/NEWS
index c470217..ff2ed61 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,32 @@
+ New in CppUnit 1.10.2:
+ --------------------------------------
+
+* Bug Fix:
+
+ - Memory checker: bug #938753, array bound read in
+ splitPathString() with substr if an empty string is passed.
+
+ - Memory leaks: bug #952912, many memory leaks removed in the
+ MFC test plug-in runner.
+
+ - Crash when using CPPUNIT_TEST_SUITE_REGISTRATION with cppunit dll.
+ Bug #921843. This bug was caused by a known STL bug in VC++ 6.
+ See http://www.dinkumware.com/vc_fixes.html <xtree> issue with shared
+ std::map in dll.
+
+* Compilation:
+
+ - mingw & cigwin, bug #930338 & #945737 fixed.
+
+ - make install does not work on SunOS. Bug #940650 fixed.
+
+ - bug #933154, post-build step fails in directory with spaces
+ with Visual C++.
+
+ - DllPlugInTester, bug #941625 (char * string literal). Applied patch
+ contribued by Curt Arnold.
+
+
New in CppUnit 1.10.0 (same as 1.9.14):
--------------------------------------
diff --git a/TODO b/TODO
index 8776334..19fa324 100644
--- a/TODO
+++ b/TODO
@@ -2,26 +2,17 @@
Asserter::makeNotEqualMessage() strip the shortDescription of the additional message.
* CppUnit:
- - Extends CompilerOutputter to a generic text outputter that can use a format string
- to display both the location of the failure and the message.
- STL concept checker.
- Memory leak tracking: setUp/tearDown should be leak safe if no failure occured.
* UnitTest
- add tests for XmlOutputter::setStyleSheet (current assertion macro strip <?...> when
testing )
- - add tests for TestRunner, TextUi::TestRunner, CompilerOutputter.
- - add tests for test plug-in
* VC++ TestRunner:
- Modify MfcUi::TestRunner to expose TestResult (which allow specific TestListener
for global initialization).
- Update MfcTestRunner to use TestPath to store test in the registry
- - [DONE] Add "details" field to show detail of the selected failed test:
- - suite and test name,
- - failure message. If possible separate "was" and "expected" in the
- forthcoming assertEquals() to make comparison easier,
- - source file location.
* Documentation:
CookBook:
diff --git a/configure b/configure
index 2e28ba6..ec1697f 100755
--- a/configure
+++ b/configure
@@ -1481,7 +1481,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
#
CPPUNIT_MAJOR_VERSION=1
CPPUNIT_MINOR_VERSION=10
-CPPUNIT_MICRO_VERSION=0
+CPPUNIT_MICRO_VERSION=2
CPPUNIT_INTERFACE_AGE=0
CPPUNIT_BINARY_AGE=0
CPPUNIT_VERSION=$CPPUNIT_MAJOR_VERSION.$CPPUNIT_MINOR_VERSION.$CPPUNIT_MICRO_VERSION
diff --git a/configure.in b/configure.in
index 94755b7..c1a3ba2 100644
--- a/configure.in
+++ b/configure.in
@@ -15,7 +15,7 @@ AC_PREREQ(2.50)
#
CPPUNIT_MAJOR_VERSION=1
CPPUNIT_MINOR_VERSION=10
-CPPUNIT_MICRO_VERSION=0
+CPPUNIT_MICRO_VERSION=2
CPPUNIT_INTERFACE_AGE=0
CPPUNIT_BINARY_AGE=0
CPPUNIT_VERSION=$CPPUNIT_MAJOR_VERSION.$CPPUNIT_MINOR_VERSION.$CPPUNIT_MICRO_VERSION
diff --git a/cppunit.spec b/cppunit.spec
index ec00a4b..a70a602 100644
--- a/cppunit.spec
+++ b/cppunit.spec
@@ -4,7 +4,7 @@
%define lib_name cppunit
Name: cppunit
-Version: 1.10.0
+Version: 1.10.2
Release: %rel
Summary: C++ Port of JUnit Testing Framework
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 13ec97f..08e5a03 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -19,7 +19,7 @@ htmldir = $(pkgdatadir)/html
html_DATA = $(static_pages) html/index.html
install-data-hook:
- cp -dpR html/* $(DESTDIR)$(htmldir)
+ cp -pR html/* $(DESTDIR)$(htmldir)
# Automake's "distcheck" is sensitive to having files left over
# after "make uninstall", so we have to clean up the install hook.
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 81ecca8..413c143 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -337,7 +337,7 @@ uninstall-am: uninstall-htmlDATA uninstall-info-am uninstall-local
@DOC_TRUE at install-data-hook:
- at DOC_TRUE@ cp -dpR html/* $(DESTDIR)$(htmldir)
+ at DOC_TRUE@ cp -pR html/* $(DESTDIR)$(htmldir)
# Automake's "distcheck" is sensitive to having files left over
# after "make uninstall", so we have to clean up the install hook.
diff --git a/examples/cppunittest/CppUnitTestMain.dsp b/examples/cppunittest/CppUnitTestMain.dsp
index 005946c..7bd3b22 100644
--- a/examples/cppunittest/CppUnitTestMain.dsp
+++ b/examples/cppunittest/CppUnitTestMain.dsp
@@ -58,7 +58,7 @@ LINK32=link.exe
TargetPath=.\Release\CppUnitTestMain.exe
SOURCE="$(InputPath)"
PostBuild_Desc=Self test
-PostBuild_Cmds=$(TargetPath)
+PostBuild_Cmds="$(TargetPath)"
# End Special Build Tool
!ELSEIF "$(CFG)" == "CppUnitTestMain - Win32 Debug"
@@ -89,7 +89,7 @@ LINK32=link.exe
TargetPath=.\Debug\CppUnitTestMain.exe
SOURCE="$(InputPath)"
PostBuild_Desc=Self test
-PostBuild_Cmds=$(TargetPath)
+PostBuild_Cmds="$(TargetPath)"
# End Special Build Tool
!ELSEIF "$(CFG)" == "CppUnitTestMain - Win32 Release DLL"
@@ -108,7 +108,7 @@ PostBuild_Cmds=$(TargetPath)
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GR /GX /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "CPPUNIT_USE_TYPEINFO" /FD /c
# SUBTRACT BASE CPP /YX /Yc /Yu
-# ADD CPP /nologo /MD /W3 /GR /GX /Ox /Ot /Oa /Ow /Og /Oi /Op /Oy /Ob0 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "CPPUNIT_DLL" /FD /c
+# ADD CPP /nologo /MD /W3 /GR /GX /Ox /Ot /Oa /Ow /Og /Oi /Op /Ob0 /I "../../include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "CPPUNIT_DLL" /FD /c
# SUBTRACT CPP /YX /Yc /Yu
# ADD BASE RSC /l 0x40c /d "NDEBUG"
# ADD RSC /l 0x40c /d "NDEBUG"
@@ -482,7 +482,7 @@ InputPath=..\..\lib\cppunit_dll.dll
InputName=cppunit_dll
"$(IntDir)\$(InputName).dll" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputPath) $(IntDir)\$(InputName).dll
+ copy "$(InputPath)" "$(IntDir)\$(InputName).dll"
# End Custom Build
@@ -517,7 +517,7 @@ InputPath=..\..\lib\cppunitd_dll.dll
InputName=cppunitd_dll
"$(IntDir)\$(InputName).dll" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- copy $(InputPath) $(IntDir)\$(InputName).dll
+ copy "$(InputPath)" "$(IntDir)\$(InputName).dll"
# End Custom Build
diff --git a/examples/simple/simple_plugin.dsp b/examples/simple/simple_plugin.dsp
index 9d86084..6a4ce29 100644
--- a/examples/simple/simple_plugin.dsp
+++ b/examples/simple/simple_plugin.dsp
@@ -59,7 +59,7 @@ LINK32=link.exe
TargetPath=.\ReleasePlugIn\simple_plugin.dll
SOURCE="$(InputPath)"
PostBuild_Desc=Running tests...
-PostBuild_Cmds=..\..\lib\DllPlugInTester_dll.exe $(TargetPath)
+PostBuild_Cmds=..\..\lib\DllPlugInTester_dll.exe "$(TargetPath)"
# End Special Build Tool
!ELSEIF "$(CFG)" == "simple_plugin - Win32 Debug"
@@ -92,7 +92,7 @@ LINK32=link.exe
TargetPath=.\DebugPlugIn\simple_plugind.dll
SOURCE="$(InputPath)"
PostBuild_Desc=Running tests...
-PostBuild_Cmds=..\..\lib\DllPlugInTesterd_dll.exe -b --xml tests.xml -c $(TargetPath)
+PostBuild_Cmds=..\..\lib\DllPlugInTesterd_dll.exe -b --xml tests.xml -c "$(TargetPath)"
# End Special Build Tool
!ENDIF
diff --git a/include/cppunit/Portability.h b/include/cppunit/Portability.h
index b2080e0..76cc4f2 100644
--- a/include/cppunit/Portability.h
+++ b/include/cppunit/Portability.h
@@ -1,6 +1,10 @@
#ifndef CPPUNIT_PORTABILITY_H
#define CPPUNIT_PORTABILITY_H
+#if defined(_WIN32) && !defined(WIN32)
+# define WIN32 1
+#endif
+
/* include platform specific config */
#if defined(__BORLANDC__)
# include <cppunit/config/config-bcb5.h>
@@ -12,7 +16,7 @@
// Version number of package
#ifndef CPPUNIT_VERSION
-#define CPPUNIT_VERSION "1.9.10"
+#define CPPUNIT_VERSION "1.10.2"
#endif
#include <cppunit/config/CppUnitApi.h> // define CPPUNIT_API & CPPUNIT_NEED_DLL_DECL
diff --git a/include/cppunit/extensions/TestSuiteBuilderContext.h b/include/cppunit/extensions/TestSuiteBuilderContext.h
index 171455b..db26926 100644
--- a/include/cppunit/extensions/TestSuiteBuilderContext.h
+++ b/include/cppunit/extensions/TestSuiteBuilderContext.h
@@ -10,6 +10,7 @@
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
#endif
+
CPPUNIT_NS_BEGIN
class TestSuite;
@@ -37,6 +38,8 @@ public:
const TestNamer &namer,
TestFixtureFactory &factory );
+ virtual ~TestSuiteBuilderContextBase();
+
/*! \brief Adds a test to the fixture suite.
*
* \param test Test to add to the fixture suite. Must not be \c NULL.
@@ -74,11 +77,17 @@ public:
protected:
TestFixture *makeTestFixture() const;
- typedef CppUnitMap<std::string,std::string> Properties;
+ // Notes: we use a vector here instead of a map to work-around the
+ // shared std::map in dll bug in VC6.
+ // See http://www.dinkumware.com/vc_fixes.html for detail.
+ typedef std::pair<std::string,std::string> Property;
+ typedef CppUnitVector<Property> Properties;
TestSuite &m_suite;
const TestNamer &m_namer;
TestFixtureFactory &m_factory;
+
+private:
Properties m_properties;
};
diff --git a/include/cppunit/plugin/TestPlugIn.h b/include/cppunit/plugin/TestPlugIn.h
index 3a6f908..1214e12 100644
--- a/include/cppunit/plugin/TestPlugIn.h
+++ b/include/cppunit/plugin/TestPlugIn.h
@@ -145,6 +145,7 @@ typedef CppUnitTestPlugIn *(*TestPlugInSignature)();
#define NOKERNEL
#define NOSOUND
#define NOMINMAX
+#define BLENDFUNCTION void // for mingw & gcc
#include <windows.h>
#endif
#define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() \
diff --git a/src/DllPlugInTester/CommandLineParser.cpp b/src/DllPlugInTester/CommandLineParser.cpp
index 4aecacb..f4c19f5 100644
--- a/src/DllPlugInTester/CommandLineParser.cpp
+++ b/src/DllPlugInTester/CommandLineParser.cpp
@@ -2,7 +2,7 @@
CommandLineParser::CommandLineParser( int argc,
- char *argv[] )
+ const char *argv[] )
: m_currentArgument( 0 )
, m_useCompiler( false )
, m_useXml( false )
diff --git a/src/DllPlugInTester/CommandLineParser.h b/src/DllPlugInTester/CommandLineParser.h
index 2fc80eb..3cbcb5a 100644
--- a/src/DllPlugInTester/CommandLineParser.h
+++ b/src/DllPlugInTester/CommandLineParser.h
@@ -48,7 +48,7 @@ public:
/*! Constructs a CommandLineParser object.
*/
CommandLineParser( int argc,
- char *argv[] );
+ const char *argv[] );
/// Destructor.
virtual ~CommandLineParser();
diff --git a/src/DllPlugInTester/CommandLineParserTest.cpp b/src/DllPlugInTester/CommandLineParserTest.cpp
index 7e9ac5d..b521eb2 100644
--- a/src/DllPlugInTester/CommandLineParserTest.cpp
+++ b/src/DllPlugInTester/CommandLineParserTest.cpp
@@ -29,10 +29,10 @@ CommandLineParserTest::tearDown()
void
-CommandLineParserTest::parse( char **lines )
+CommandLineParserTest::parse( const char **lines )
{
int count =0;
- for ( char **line = lines; *line != NULL; ++line, ++count );
+ for ( const char **line = lines; *line != NULL; ++line, ++count );
delete _parser;
_parser = new CommandLineParser( count, lines );
@@ -43,7 +43,7 @@ CommandLineParserTest::parse( char **lines )
void
CommandLineParserTest::testEmptyCommandLine()
{
- static char *lines[] = { "", NULL };
+ static const char *lines[] = { "", NULL };
parse( lines );
std::string none;
@@ -63,7 +63,7 @@ CommandLineParserTest::testEmptyCommandLine()
void
CommandLineParserTest::testFlagCompiler()
{
- static char *lines[] = { "", "-c", NULL };
+ static const char *lines[] = { "", "-c", NULL };
parse( lines );
std::string none;
@@ -84,7 +84,7 @@ CommandLineParserTest::testFlagCompiler()
void
CommandLineParserTest::testLongFlagBriefProgress()
{
- static char *lines[] = { "", "--brief-progress", NULL };
+ static const char *lines[] = { "", "--brief-progress", NULL };
parse( lines );
std::string none;
@@ -105,7 +105,7 @@ CommandLineParserTest::testLongFlagBriefProgress()
void
CommandLineParserTest::testFileName()
{
- static char *lines[] = { "", "TestPlugIn.dll", NULL };
+ static const char *lines[] = { "", "TestPlugIn.dll", NULL };
parse( lines );
std::string none;
@@ -131,7 +131,7 @@ CommandLineParserTest::testFileName()
void
CommandLineParserTest::testTestPath()
{
- static char *lines[] = { "", ":Core", NULL };
+ static const char *lines[] = { "", ":Core", NULL };
parse( lines );
std::string none;
@@ -152,7 +152,7 @@ CommandLineParserTest::testTestPath()
void
CommandLineParserTest::testParameterWithSpace()
{
- static char *lines[] = { "", "--xml", "Test Results.xml", NULL };
+ static const char *lines[] = { "", "--xml", "Test Results.xml", NULL };
parse( lines );
std::string none;
@@ -174,7 +174,7 @@ CommandLineParserTest::testParameterWithSpace()
void
CommandLineParserTest::testMissingStyleSheetParameterThrow()
{
- static char *lines[] = { "", "--xsl", NULL };
+ static const char *lines[] = { "", "--xsl", NULL };
parse( lines );
}
@@ -182,7 +182,7 @@ CommandLineParserTest::testMissingStyleSheetParameterThrow()
void
CommandLineParserTest::testMissingEncodingParameterThrow()
{
- static char *lines[] = { "", "--encoding", NULL };
+ static const char *lines[] = { "", "--encoding", NULL };
parse( lines );
}
@@ -190,7 +190,7 @@ CommandLineParserTest::testMissingEncodingParameterThrow()
void
CommandLineParserTest::testXmlFileNameIsOptional()
{
- static char *lines[] = { "", "--xml", NULL };
+ static const char *lines[] = { "", "--xml", NULL };
parse( lines );
std::string none;
@@ -201,7 +201,7 @@ CommandLineParserTest::testXmlFileNameIsOptional()
void
CommandLineParserTest::testPlugInsWithParameters()
{
- static char *lines[] = { "", "TestPlugIn1.dll=login = lain",
+ static const char *lines[] = { "", "TestPlugIn1.dll=login = lain",
"Clocker.dll", NULL };
parse( lines );
diff --git a/src/DllPlugInTester/CommandLineParserTest.h b/src/DllPlugInTester/CommandLineParserTest.h
index fa15fb1..ce2693c 100644
--- a/src/DllPlugInTester/CommandLineParserTest.h
+++ b/src/DllPlugInTester/CommandLineParserTest.h
@@ -45,7 +45,7 @@ private:
CommandLineParserTest( const CommandLineParserTest &other );
void operator =( const CommandLineParserTest &other );
- void parse( char **lines );
+ void parse( const char **lines );
private:
CommandLineParser *_parser;
diff --git a/src/DllPlugInTester/DllPlugInTester.cpp b/src/DllPlugInTester/DllPlugInTester.cpp
index 779757f..f1125d8 100644
--- a/src/DllPlugInTester/DllPlugInTester.cpp
+++ b/src/DllPlugInTester/DllPlugInTester.cpp
@@ -208,7 +208,7 @@ printUsage( const std::string &applicationName )
*/
int
main( int argc,
- char *argv[] )
+ const char *argv[] )
{
const int successReturnCode = 0;
const int failureReturnCode = 1;
diff --git a/src/DllPlugInTester/DllPlugInTester.dsp b/src/DllPlugInTester/DllPlugInTester.dsp
index 6a75b90..0537db8 100644
--- a/src/DllPlugInTester/DllPlugInTester.dsp
+++ b/src/DllPlugInTester/DllPlugInTester.dsp
@@ -63,7 +63,7 @@ TargetPath=.\ReleaseUnicode\DllPlugInTesteru.exe
TargetName=DllPlugInTesteru
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\lib\$(TargetName).exe
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\lib\$(TargetName).exe
# End Special Build Tool
!ELSEIF "$(CFG)" == "DllPlugInTester - Win32 Debug Unicode"
@@ -97,7 +97,7 @@ TargetPath=.\DebugUnicode\DllPlugInTesterud.exe
TargetName=DllPlugInTesterud
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\lib\$(TargetName).exe
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\lib\$(TargetName).exe
# End Special Build Tool
!ELSEIF "$(CFG)" == "DllPlugInTester - Win32 Release Static"
@@ -199,7 +199,7 @@ TargetPath=.\ReleaseDll\DllPlugInTester_dll.exe
TargetName=DllPlugInTester_dll
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\lib\$(TargetName).exe
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\lib\$(TargetName).exe
# End Special Build Tool
!ELSEIF "$(CFG)" == "DllPlugInTester - Win32 Debug"
@@ -233,7 +233,7 @@ TargetPath=.\DebugDll\DllPlugInTesterd_dll.exe
TargetName=DllPlugInTesterd_dll
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\lib\$(TargetName).exe
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\lib\$(TargetName).exe
# End Special Build Tool
!ENDIF
diff --git a/src/cppunit/TestPath.cpp b/src/cppunit/TestPath.cpp
index 2f4903f..a2783a2 100644
--- a/src/cppunit/TestPath.cpp
+++ b/src/cppunit/TestPath.cpp
@@ -226,7 +226,10 @@ bool
TestPath::splitPathString( const std::string &pathAsString,
PathTestNames &testNames )
{
- bool isRelative = (pathAsString.substr(0,1) != "/");
+ if ( pathAsString.empty() )
+ return true;
+
+ bool isRelative = pathAsString[0] != '/';
int index = (isRelative ? 0 : 1);
while ( true )
diff --git a/src/cppunit/TestSuiteBuilderContext.cpp b/src/cppunit/TestSuiteBuilderContext.cpp
index 06aa12e..ff71b52 100644
--- a/src/cppunit/TestSuiteBuilderContext.cpp
+++ b/src/cppunit/TestSuiteBuilderContext.cpp
@@ -17,6 +17,11 @@ TestSuiteBuilderContextBase::TestSuiteBuilderContextBase(
}
+TestSuiteBuilderContextBase::~TestSuiteBuilderContextBase()
+{
+}
+
+
void
TestSuiteBuilderContextBase::addTest( Test *test )
{
@@ -50,17 +55,30 @@ void
TestSuiteBuilderContextBase::addProperty( const std::string &key,
const std::string &value )
{
- m_properties[ key ] = value;
+ Properties::iterator it = m_properties.begin();
+ for ( ; it != m_properties.end(); ++it )
+ {
+ if ( (*it).first == key )
+ {
+ (*it).second = value;
+ return;
+ }
+ }
+
+ Property property( key, value );
+ m_properties.push_back( property );
}
const std::string
TestSuiteBuilderContextBase::getStringProperty( const std::string &key ) const
{
- Properties::const_iterator itFound = m_properties.find( key );
- if ( itFound == m_properties.end() )
- return "";
-
- return (*itFound).second;
+ Properties::const_iterator it = m_properties.begin();
+ for ( ; it != m_properties.end(); ++it )
+ {
+ if ( (*it).first == key )
+ return (*it).second;
+ }
+ return "";
}
diff --git a/src/cppunit/cppunit.dsp b/src/cppunit/cppunit.dsp
index aab9220..3a844ac 100644
--- a/src/cppunit/cppunit.dsp
+++ b/src/cppunit/cppunit.dsp
@@ -55,7 +55,7 @@ TargetPath=.\Release\cppunit.lib
TargetName=cppunit
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\lib\$(TargetName).lib
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\lib\$(TargetName).lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "cppunit - Win32 Debug"
@@ -85,7 +85,7 @@ TargetPath=.\Debug\cppunitd.lib
TargetName=cppunitd
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\lib\$(TargetName).lib
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\lib\$(TargetName).lib
# End Special Build Tool
!ENDIF
diff --git a/src/cppunit/cppunit_dll.dsp b/src/cppunit/cppunit_dll.dsp
index ee32f3d..925a818 100644
--- a/src/cppunit/cppunit_dll.dsp
+++ b/src/cppunit/cppunit_dll.dsp
@@ -61,7 +61,7 @@ TargetPath=.\ReleaseDll\cppunit_dll.dll
TargetName=cppunit_dll
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\lib\$(TargetName).dll copy $(TargetDir)\$(TargetName).lib ..\..\lib\$(TargetName).lib
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\lib\$(TargetName).dll copy "$(TargetDir)\$(TargetName).lib" ..\..\lib\$(TargetName).lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "cppunit_dll - Win32 Debug"
@@ -97,7 +97,7 @@ TargetPath=.\DebugDll\cppunitd_dll.dll
TargetName=cppunitd_dll
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\lib\$(TargetName).dll copy $(TargetDir)\$(TargetName).lib ..\..\lib\$(TargetName).lib
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\lib\$(TargetName).dll copy "$(TargetDir)\$(TargetName).lib" ..\..\lib\$(TargetName).lib
# End Special Build Tool
!ENDIF
diff --git a/src/msvc6/testpluginrunner/TestPlugIn.cpp b/src/msvc6/testpluginrunner/TestPlugIn.cpp
index 7fd0574..2612220 100644
--- a/src/msvc6/testpluginrunner/TestPlugIn.cpp
+++ b/src/msvc6/testpluginrunner/TestPlugIn.cpp
@@ -11,6 +11,13 @@
#include <cppunit/extensions/TestFactoryRegistry.h>
#include "TestPlugInException.h"
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+
TestPlugIn::TestPlugIn( const std::string fileName ) :
m_fileName( fileName )
@@ -28,6 +35,7 @@ TestPlugIn::~TestPlugIn()
void
TestPlugIn::deleteDllCopy()
{
+ m_manager.unload( m_copyFileName );
::DeleteFile( m_copyFileName.c_str() );
}
diff --git a/src/msvc6/testpluginrunner/TestPlugInException.cpp b/src/msvc6/testpluginrunner/TestPlugInException.cpp
index f006c0f..c4fcddd 100644
--- a/src/msvc6/testpluginrunner/TestPlugInException.cpp
+++ b/src/msvc6/testpluginrunner/TestPlugInException.cpp
@@ -7,6 +7,13 @@
#include "StdAfx.h"
#include "TestPlugInException.h"
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+
TestPlugInException::TestPlugInException( std::string message,
Cause cause ) :
diff --git a/src/msvc6/testpluginrunner/TestPlugInRunner.dsp b/src/msvc6/testpluginrunner/TestPlugInRunner.dsp
index f12d11e..792515b 100644
--- a/src/msvc6/testpluginrunner/TestPlugInRunner.dsp
+++ b/src/msvc6/testpluginrunner/TestPlugInRunner.dsp
@@ -59,7 +59,7 @@ TargetPath=.\Release\TestPlugInRunner.exe
TargetName=TestPlugInRunner
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\..\lib\$(TargetName).exe
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\..\lib\$(TargetName).exe
# End Special Build Tool
!ELSEIF "$(CFG)" == "TestPlugInRunner - Win32 Debug"
@@ -92,7 +92,7 @@ TargetPath=.\Debug\TestPlugInRunnerd.exe
TargetName=TestPlugInRunnerd
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\..\lib\$(TargetName).exe
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\..\lib\$(TargetName).exe
# End Special Build Tool
!ENDIF
diff --git a/src/msvc6/testpluginrunner/TestPlugInRunnerApp.cpp b/src/msvc6/testpluginrunner/TestPlugInRunnerApp.cpp
index 75d3d8c..4f7d6b2 100644
--- a/src/msvc6/testpluginrunner/TestPlugInRunnerApp.cpp
+++ b/src/msvc6/testpluginrunner/TestPlugInRunnerApp.cpp
@@ -63,21 +63,13 @@ BOOL TestPlugInRunnerApp::InitInstance()
SetRegistryKey(_T("CppUnit Test Plug-In Runner"));
+ {
TestPlugInRunnerModel model;
TestPlugInRunnerDlg dlg( &model );
m_pMainWnd = &dlg;
- int nResponse = dlg.DoModal();
- if (nResponse == IDOK)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with OK
- }
- else if (nResponse == IDCANCEL)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with Cancel
- }
+ dlg.DoModal();
+ }
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
diff --git a/src/msvc6/testpluginrunner/TestPlugInRunnerModel.cpp b/src/msvc6/testpluginrunner/TestPlugInRunnerModel.cpp
index 71ae0cf..13418d3 100644
--- a/src/msvc6/testpluginrunner/TestPlugInRunnerModel.cpp
+++ b/src/msvc6/testpluginrunner/TestPlugInRunnerModel.cpp
@@ -9,6 +9,12 @@
#include <cppunit/TestSuite.h>
#include "TestPlugIn.h"
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
TestPlugInRunnerModel::TestPlugInRunnerModel() :
TestRunnerModel( new CPPUNIT_NS::TestSuite( "Default" ) ),
@@ -19,6 +25,7 @@ TestPlugInRunnerModel::TestPlugInRunnerModel() :
TestPlugInRunnerModel::~TestPlugInRunnerModel()
{
+ freeRootTest();
delete m_plugIn;
}
@@ -26,6 +33,7 @@ TestPlugInRunnerModel::~TestPlugInRunnerModel()
void
TestPlugInRunnerModel::setPlugIn( TestPlugIn *plugIn )
{
+ freeRootTest();
delete m_plugIn;
m_plugIn = plugIn;
reloadPlugIn();
@@ -39,6 +47,7 @@ TestPlugInRunnerModel::reloadPlugIn()
{
CWaitCursor waitCursor;
m_history.clear();
+ freeRootTest();
setRootTest( m_plugIn->makeTest() );
loadHistory();
@@ -50,3 +59,19 @@ TestPlugInRunnerModel::reloadPlugIn()
throw;
}
}
+
+
+void
+TestPlugInRunnerModel::freeRootTest()
+{
+ delete m_rootTest;
+ m_rootTest = 0;
+}
+
+
+void
+TestPlugInRunnerModel::setRootTest( CPPUNIT_NS::Test *rootTest )
+{
+ freeRootTest();
+ TestRunnerModel::setRootTest( rootTest );
+}
diff --git a/src/msvc6/testpluginrunner/TestPlugInRunnerModel.h b/src/msvc6/testpluginrunner/TestPlugInRunnerModel.h
index b6c12d6..3b31cd8 100644
--- a/src/msvc6/testpluginrunner/TestPlugInRunnerModel.h
+++ b/src/msvc6/testpluginrunner/TestPlugInRunnerModel.h
@@ -27,6 +27,10 @@ public:
void setPlugIn( TestPlugIn *plugIn );
void reloadPlugIn();
+
+public: // overridden from TestRunnerModel
+ void setRootTest( CPPUNIT_NS::Test *rootTest );
+
private:
/// Prevents the use of the copy constructor.
TestPlugInRunnerModel( const TestPlugInRunnerModel © );
@@ -34,6 +38,8 @@ private:
/// Prevents the use of the copy operator.
void operator =( const TestPlugInRunnerModel © );
+ void freeRootTest();
+
private:
TestPlugIn *m_plugIn;
};
diff --git a/src/msvc6/testrunner/ActiveTest.cpp b/src/msvc6/testrunner/ActiveTest.cpp
index 94268ba..67da35d 100644
--- a/src/msvc6/testrunner/ActiveTest.cpp
+++ b/src/msvc6/testrunner/ActiveTest.cpp
@@ -1,6 +1,12 @@
#include "stdafx.h"
#include "ActiveTest.h"
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
// Construct the active test
diff --git a/src/msvc6/testrunner/ListCtrlSetter.cpp b/src/msvc6/testrunner/ListCtrlSetter.cpp
index ea25f94..d06af54 100644
--- a/src/msvc6/testrunner/ListCtrlSetter.cpp
+++ b/src/msvc6/testrunner/ListCtrlSetter.cpp
@@ -1,6 +1,13 @@
#include "StdAfx.h"
#include "ListCtrlSetter.h"
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+
ListCtrlSetter::ListCtrlSetter( CListCtrl &list ) :
m_List( list ),
diff --git a/src/msvc6/testrunner/MostRecentTests.cpp b/src/msvc6/testrunner/MostRecentTests.cpp
index 9d437a7..e854bf3 100644
--- a/src/msvc6/testrunner/MostRecentTests.cpp
+++ b/src/msvc6/testrunner/MostRecentTests.cpp
@@ -8,6 +8,13 @@
#include "MostRecentTests.h"
#include <algorithm>
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+
MostRecentTests::MostRecentTests()
{
diff --git a/src/msvc6/testrunner/ResourceLoaders.cpp b/src/msvc6/testrunner/ResourceLoaders.cpp
index 88699da..17f4895 100644
--- a/src/msvc6/testrunner/ResourceLoaders.cpp
+++ b/src/msvc6/testrunner/ResourceLoaders.cpp
@@ -2,6 +2,14 @@
#include "ResourceLoaders.h"
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+
+
extern HINSTANCE g_testRunnerResource;
CString loadCString(UINT stringId)
diff --git a/src/msvc6/testrunner/TestRunner.dsp b/src/msvc6/testrunner/TestRunner.dsp
index 271d43b..f4d2282 100644
--- a/src/msvc6/testrunner/TestRunner.dsp
+++ b/src/msvc6/testrunner/TestRunner.dsp
@@ -63,7 +63,7 @@ TargetPath=.\Release\TestRunner.dll
TargetName=TestRunner
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\..\lib\$(TargetName).dll copy $(TargetDir)\$(TargetName).lib ..\..\..\lib\$(TargetName).lib
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\..\lib\$(TargetName).dll copy "$(TargetDir)\$(TargetName).lib" ..\..\..\lib\$(TargetName).lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "TestRunner - Win32 Debug"
@@ -98,7 +98,7 @@ TargetPath=.\Debug\testrunnerd.dll
TargetName=testrunnerd
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\..\lib\$(TargetName).dll copy $(TargetDir)\$(TargetName).lib ..\..\..\lib\$(TargetName).lib
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\..\lib\$(TargetName).dll copy "$(TargetDir)\$(TargetName).lib" ..\..\..\lib\$(TargetName).lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "TestRunner - Win32 Release Unicode"
@@ -135,7 +135,7 @@ TargetPath=.\ReleaseUnicode\testrunneru.dll
TargetName=testrunneru
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\..\lib\$(TargetName).dll copy $(TargetDir)\$(TargetName).lib ..\..\..\lib\$(TargetName).lib
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\..\lib\$(TargetName).dll copy "$(TargetDir)\$(TargetName).lib" ..\..\..\lib\$(TargetName).lib
# End Special Build Tool
!ELSEIF "$(CFG)" == "TestRunner - Win32 Debug Unicode"
@@ -172,7 +172,7 @@ TargetPath=.\DebugUnicode\testrunnerud.dll
TargetName=testrunnerud
SOURCE="$(InputPath)"
PostBuild_Desc=Copying target to lib/
-PostBuild_Cmds=copy $(TargetPath) ..\..\..\lib\$(TargetName).dll copy $(TargetDir)\$(TargetName).lib ..\..\..\lib\$(TargetName).lib
+PostBuild_Cmds=copy "$(TargetPath)" ..\..\..\lib\$(TargetName).dll copy "$(TargetDir)\$(TargetName).lib" ..\..\..\lib\$(TargetName).lib
# End Special Build Tool
!ENDIF
diff --git a/src/msvc6/testrunner/TestRunnerDlg.cpp b/src/msvc6/testrunner/TestRunnerDlg.cpp
index b509f53..45d202c 100644
--- a/src/msvc6/testrunner/TestRunnerDlg.cpp
+++ b/src/msvc6/testrunner/TestRunnerDlg.cpp
@@ -69,6 +69,9 @@ TestRunnerDlg::init(TestRunnerModel *model)
m_selectedTest = 0;
m_bAutorunAtStartup = true;
m_bIsRunning = false;
+ m_activeTest = 0;
+ m_result = 0;
+ m_testObserver = 0;
ModifyFlags( flSWPCopyBits, 0 ); // anti-flickering option for resizing
}
@@ -350,6 +353,9 @@ TestRunnerDlg::freeState()
delete m_activeTest;
delete m_result;
delete m_testObserver;
+ m_activeTest = 0;
+ m_result = 0;
+ m_testObserver = 0;
}
@@ -363,10 +369,7 @@ TestRunnerDlg::reset()
updateCountsDisplay();
- m_activeTest = NULL;
- m_result = NULL;
- m_testObserver = NULL;
-
+ freeState();
CListCtrl *listCtrl = (CListCtrl *)GetDlgItem (IDC_LIST);
listCtrl->DeleteAllItems();
diff --git a/src/msvc6/testrunner/TestRunnerDlg.h b/src/msvc6/testrunner/TestRunnerDlg.h
index 3da294f..5d5f9b4 100644
--- a/src/msvc6/testrunner/TestRunnerDlg.h
+++ b/src/msvc6/testrunner/TestRunnerDlg.h
@@ -56,7 +56,7 @@ public:
TestRunnerDlg( TestRunnerModel *model,
const TCHAR* szDialogResourceId = NULL,
CWnd* pParent = NULL);
- ~TestRunnerDlg();
+ virtual ~TestRunnerDlg();
// overrided from TestListener;
void startTest( CPPUNIT_NS::Test *test );
diff --git a/src/msvc6/testrunner/TestRunnerModel.cpp b/src/msvc6/testrunner/TestRunnerModel.cpp
index a0a44ca..9b175b6 100644
--- a/src/msvc6/testrunner/TestRunnerModel.cpp
+++ b/src/msvc6/testrunner/TestRunnerModel.cpp
@@ -11,6 +11,13 @@
#include <stdexcept>
#include <cppunit/testsuite.h>
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+
const CString TestRunnerModel::settingKey( _T("CppUnit") );
const CString TestRunnerModel::settingMainDialogKey( _T( "MainDialog" ) );
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openoffice/cppunit.git
More information about the Pkg-openoffice-commits
mailing list