summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '3rdParty/CppUnit/src/src')
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/Asserter.cpp119
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/BriefTestProgressListener.cpp2
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/DefaultProtector.cpp2
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/Exception.cpp8
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/Message.cpp16
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/Protector.cpp4
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/ProtectorChain.cpp9
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/ProtectorChain.h8
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/ProtectorContext.h7
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/SourceLine.cpp1
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/TestCase.cpp2
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/TestFactoryRegistry.cpp6
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/TestNamer.cpp14
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/TestPath.cpp4
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/TestResult.cpp6
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/TestResultCollector.cpp3
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/TestSuite.cpp3
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/TestSuiteBuilderContext.cpp1
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/TextTestProgressListener.cpp2
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/TypeInfoHelper.cpp27
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/XmlDocument.cpp2
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/XmlElement.cpp5
-rw-r--r--3rdParty/CppUnit/src/src/cppunit/XmlOutputter.cpp5
23 files changed, 196 insertions, 60 deletions
diff --git a/3rdParty/CppUnit/src/src/cppunit/Asserter.cpp b/3rdParty/CppUnit/src/src/cppunit/Asserter.cpp
index a9cf95c..79fcb2e 100644
--- a/3rdParty/CppUnit/src/src/cppunit/Asserter.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/Asserter.cpp
@@ -6,6 +6,7 @@
CPPUNIT_NS_BEGIN
+// coverity[+kill]
void
Asserter::fail( std::string message,
const SourceLine &sourceLine )
@@ -13,7 +14,7 @@ Asserter::fail( std::string message,
fail( Message( "assertion failed", message ), sourceLine );
}
-
+// coverity[+kill]
void
Asserter::fail( const Message &message,
const SourceLine &sourceLine )
@@ -40,13 +41,41 @@ Asserter::failIf( bool shouldFail,
failIf( shouldFail, Message( "assertion failed", message ), sourceLine );
}
-
std::string
Asserter::makeExpected( const std::string &expectedValue )
{
return "Expected: " + expectedValue;
}
+std::string
+Asserter::makeExpectedEqual( const std::string &expectedValue )
+{
+ return "Expected: " + expectedValue;
+}
+
+std::string
+Asserter::makeExpectedLess( const std::string& expectedValue )
+{
+ return "Expected less than: " + expectedValue;
+}
+
+std::string
+Asserter::makeExpectedLessEqual( const std::string& expectedValue )
+{
+ return "Expected less or equal than: " + expectedValue;
+}
+
+std::string
+Asserter::makeExpectedGreater( const std::string& expectedValue )
+{
+ return "Expected greater than: " + expectedValue;
+}
+
+std::string
+Asserter::makeExpectedGreaterEqual( const std::string& expectedValue )
+{
+ return "Expected greater or equal than: " + expectedValue;
+}
std::string
Asserter::makeActual( const std::string &actualValue )
@@ -55,18 +84,28 @@ Asserter::makeActual( const std::string &actualValue )
}
+Message
+Asserter::makeMessage( const std::string& expectedMessage,
+ const std::string& actualMessage,
+ const std::string& shortDescription,
+ const AdditionalMessage& additionalMessage)
+{
+ Message message( shortDescription,
+ expectedMessage,
+ actualMessage );
+ message.addDetail( additionalMessage );
+
+ return message;
+}
+
+
Message
Asserter::makeNotEqualMessage( const std::string &expectedValue,
const std::string &actualValue,
const AdditionalMessage &additionalMessage,
const std::string &shortDescription )
{
- Message message( shortDescription,
- makeExpected( expectedValue ),
- makeActual( actualValue ) );
- message.addDetail( additionalMessage );
-
- return message;
+ return makeMessage(makeExpectedEqual(expectedValue), makeActual(actualValue), shortDescription, additionalMessage);
}
@@ -77,15 +116,71 @@ Asserter::failNotEqual( std::string expected,
const AdditionalMessage &additionalMessage,
std::string shortDescription )
{
- fail( makeNotEqualMessage( expected,
- actual,
- additionalMessage,
- shortDescription ),
+ fail( makeMessage( makeExpectedEqual(expected),
+ makeActual(actual),
+ shortDescription,
+ additionalMessage ),
+ sourceLine );
+}
+
+
+void
+Asserter::failNotLess( std::string expected,
+ std::string actual,
+ const SourceLine &sourceLine,
+ const AdditionalMessage &additionalMessage,
+ std::string shortDescription )
+{
+ fail( makeMessage( makeExpectedLess(expected),
+ makeActual(actual),
+ shortDescription,
+ additionalMessage),
sourceLine );
}
void
+Asserter::failNotGreater( std::string expected,
+ std::string actual,
+ const SourceLine &sourceLine,
+ const AdditionalMessage &additionalMessage,
+ std::string shortDescription )
+{
+ fail( makeMessage( makeExpectedGreater(expected),
+ makeActual(actual),
+ shortDescription,
+ additionalMessage),
+ sourceLine );
+}
+
+void
+Asserter::failNotLessEqual( std::string expected,
+ std::string actual,
+ const SourceLine &sourceLine,
+ const AdditionalMessage &additionalMessage,
+ std::string shortDescription )
+{
+ fail( makeMessage( makeExpectedLessEqual(expected),
+ makeActual(actual),
+ shortDescription,
+ additionalMessage ),
+ sourceLine );
+}
+
+void
+Asserter::failNotGreaterEqual( std::string expected,
+ std::string actual,
+ const SourceLine &sourceLine,
+ const AdditionalMessage &additionalMessage,
+ std::string shortDescription )
+{
+ fail( makeMessage( makeExpectedGreaterEqual(expected),
+ makeActual(actual),
+ shortDescription,
+ additionalMessage ),
+ sourceLine );
+}
+void
Asserter::failNotEqualIf( bool shouldFail,
std::string expected,
std::string actual,
diff --git a/3rdParty/CppUnit/src/src/cppunit/BriefTestProgressListener.cpp b/3rdParty/CppUnit/src/src/cppunit/BriefTestProgressListener.cpp
index 120e6d5..4ea8d35 100644
--- a/3rdParty/CppUnit/src/src/cppunit/BriefTestProgressListener.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/BriefTestProgressListener.cpp
@@ -37,7 +37,7 @@ BriefTestProgressListener::addFailure( const TestFailure &failure )
void
-BriefTestProgressListener::endTest( Test *)
+BriefTestProgressListener::endTest( Test * )
{
if ( !m_lastTestFailed )
stdCOut() << " : OK";
diff --git a/3rdParty/CppUnit/src/src/cppunit/DefaultProtector.cpp b/3rdParty/CppUnit/src/src/cppunit/DefaultProtector.cpp
index 6fb306b..fa6ac87 100644
--- a/3rdParty/CppUnit/src/src/cppunit/DefaultProtector.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/DefaultProtector.cpp
@@ -21,7 +21,7 @@ DefaultProtector::protect( const Functor &functor,
catch ( std::exception &e )
{
std::string shortDescription( "uncaught exception of type " );
-#if CPPUNIT_USE_TYPEINFO_NAME
+#if defined(CPPUNIT_USE_TYPEINFO_NAME)
shortDescription += TypeInfoHelper::getClassName( typeid(e) );
#else
shortDescription += "std::exception (or derived).";
diff --git a/3rdParty/CppUnit/src/src/cppunit/Exception.cpp b/3rdParty/CppUnit/src/src/cppunit/Exception.cpp
index 3bbe24b..6685480 100644
--- a/3rdParty/CppUnit/src/src/cppunit/Exception.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/Exception.cpp
@@ -19,20 +19,20 @@ const long Exception::UNKNOWNLINENUMBER = -1;
Exception::Exception( const Exception &other )
: std::exception( other )
+ , m_message(other.m_message)
+ , m_sourceLine(other.m_sourceLine)
+ , m_whatMessage(other.m_whatMessage)
{
- m_message = other.m_message;
- m_sourceLine = other.m_sourceLine;
}
-
Exception::Exception( const Message &message,
const SourceLine &sourceLine )
: m_message( message )
, m_sourceLine( sourceLine )
+ , m_whatMessage()
{
}
-
#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
Exception::Exception( std::string message,
long lineNumber,
diff --git a/3rdParty/CppUnit/src/src/cppunit/Message.cpp b/3rdParty/CppUnit/src/src/cppunit/Message.cpp
index 9d6a0e9..ad2efd9 100644
--- a/3rdParty/CppUnit/src/src/cppunit/Message.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/Message.cpp
@@ -4,19 +4,16 @@
CPPUNIT_NS_BEGIN
-
-Message::Message()
-{
-}
-
Message::Message( const Message &other )
+ : m_shortDescription()
+ , m_details()
{
*this = other;
}
-
Message::Message( const std::string &shortDescription )
: m_shortDescription( shortDescription )
+ , m_details()
{
}
@@ -24,6 +21,7 @@ Message::Message( const std::string &shortDescription )
Message::Message( const std::string &shortDescription,
const std::string &detail1 )
: m_shortDescription( shortDescription )
+ , m_details()
{
addDetail( detail1 );
}
@@ -33,6 +31,7 @@ Message::Message( const std::string &shortDescription,
const std::string &detail1,
const std::string &detail2 )
: m_shortDescription( shortDescription )
+ , m_details()
{
addDetail( detail1, detail2 );
}
@@ -43,10 +42,15 @@ Message::Message( const std::string &shortDescription,
const std::string &detail2,
const std::string &detail3 )
: m_shortDescription( shortDescription )
+ , m_details()
{
addDetail( detail1, detail2, detail3 );
}
+Message::~Message()
+{
+}
+
Message &
Message::operator =( const Message &other )
{
diff --git a/3rdParty/CppUnit/src/src/cppunit/Protector.cpp b/3rdParty/CppUnit/src/src/cppunit/Protector.cpp
index 5c171ec..99188bb 100644
--- a/3rdParty/CppUnit/src/src/cppunit/Protector.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/Protector.cpp
@@ -21,7 +21,7 @@ void
Protector::reportError( const ProtectorContext &context,
const Exception &error ) const
{
- std::auto_ptr<Exception> actualError( error.clone() );
+ std::unique_ptr<Exception> actualError( error.clone() );
actualError->setMessage( actualMessage( actualError->message(), context ) );
context.m_result->addError( context.m_test,
actualError.release() );
@@ -42,7 +42,7 @@ void
Protector::reportFailure( const ProtectorContext &context,
const Exception &failure ) const
{
- std::auto_ptr<Exception> actualFailure( failure.clone() );
+ std::unique_ptr<Exception> actualFailure( failure.clone() );
actualFailure->setMessage( actualMessage( actualFailure->message(), context ) );
context.m_result->addFailure( context.m_test,
actualFailure.release() );
diff --git a/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.cpp b/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.cpp
index f528341..db7744a 100644
--- a/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.cpp
@@ -21,11 +21,20 @@ public:
}
private:
+ // disable copying
+ ProtectFunctor( const ProtectFunctor& );
+ // disable copying
+ ProtectFunctor& operator=( const ProtectFunctor& );
+
Protector *m_protector;
const Functor &m_functor;
const ProtectorContext &m_context;
};
+ProtectorChain::ProtectorChain()
+ : m_protectors(0)
+{
+}
ProtectorChain::~ProtectorChain()
{
diff --git a/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.h b/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.h
index 711b56f..9123782 100644
--- a/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.h
+++ b/3rdParty/CppUnit/src/src/cppunit/ProtectorChain.h
@@ -2,7 +2,7 @@
#define CPPUNIT_PROTECTORCHAIN_H
#include <cppunit/Protector.h>
-#include <cppunit/portability/CppUnitDeque.h>
+#include <deque>
#if CPPUNIT_NEED_DLL_DECL
#pragma warning( push )
@@ -19,6 +19,8 @@ CPPUNIT_NS_BEGIN
class CPPUNIT_API ProtectorChain : public Protector
{
public:
+ ProtectorChain();
+
~ProtectorChain();
void push( Protector *protector );
@@ -34,10 +36,10 @@ private:
class ProtectFunctor;
private:
- typedef CppUnitDeque<Protector *> Protectors;
+ typedef std::deque<Protector *> Protectors;
Protectors m_protectors;
- typedef CppUnitDeque<Functor *> Functors;
+ typedef std::deque<Functor *> Functors;
};
diff --git a/3rdParty/CppUnit/src/src/cppunit/ProtectorContext.h b/3rdParty/CppUnit/src/src/cppunit/ProtectorContext.h
index c3d496c..4957e05 100644
--- a/3rdParty/CppUnit/src/src/cppunit/ProtectorContext.h
+++ b/3rdParty/CppUnit/src/src/cppunit/ProtectorContext.h
@@ -26,6 +26,13 @@ public:
{
}
+private:
+ /// disable copy construction
+ ProtectorContext( const ProtectorContext& );
+ /// disable assignment
+ ProtectorContext& operator=(const ProtectorContext&);
+
+public:
Test *m_test;
TestResult *m_result;
std::string m_shortDescription;
diff --git a/3rdParty/CppUnit/src/src/cppunit/SourceLine.cpp b/3rdParty/CppUnit/src/src/cppunit/SourceLine.cpp
index dfadae3..ecc9558 100644
--- a/3rdParty/CppUnit/src/src/cppunit/SourceLine.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/SourceLine.cpp
@@ -5,6 +5,7 @@ CPPUNIT_NS_BEGIN
SourceLine::SourceLine() :
+ m_fileName(),
m_lineNumber( -1 )
{
}
diff --git a/3rdParty/CppUnit/src/src/cppunit/TestCase.cpp b/3rdParty/CppUnit/src/src/cppunit/TestCase.cpp
index 13c0525..431a0c5 100644
--- a/3rdParty/CppUnit/src/src/cppunit/TestCase.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/TestCase.cpp
@@ -5,7 +5,7 @@
#include <cppunit/TestResult.h>
#include <stdexcept>
-#if CPPUNIT_USE_TYPEINFO_NAME
+#if defined(CPPUNIT_USE_TYPEINFO_NAME)
# include <typeinfo>
#endif
diff --git a/3rdParty/CppUnit/src/src/cppunit/TestFactoryRegistry.cpp b/3rdParty/CppUnit/src/src/cppunit/TestFactoryRegistry.cpp
index 3457da3..f1623cc 100644
--- a/3rdParty/CppUnit/src/src/cppunit/TestFactoryRegistry.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/TestFactoryRegistry.cpp
@@ -1,6 +1,6 @@
#include <cppunit/config/SourcePrefix.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/portability/CppUnitMap.h>
+#include <map>
#include <cppunit/TestSuite.h>
#include <assert.h>
@@ -12,7 +12,7 @@ CPPUNIT_NS_BEGIN
class TestFactoryRegistryList
{
private:
- typedef CppUnitMap<std::string, TestFactoryRegistry *, std::less<std::string> > Registries;
+ typedef std::map<std::string, TestFactoryRegistry *, std::less<std::string> > Registries;
Registries m_registries;
enum State {
@@ -50,6 +50,7 @@ private:
public:
TestFactoryRegistryList()
+ : m_registries()
{
stateFlag( exist );
}
@@ -83,6 +84,7 @@ public:
TestFactoryRegistry::TestFactoryRegistry( std::string name ) :
+ m_factories(),
m_name( name )
{
}
diff --git a/3rdParty/CppUnit/src/src/cppunit/TestNamer.cpp b/3rdParty/CppUnit/src/src/cppunit/TestNamer.cpp
index eec9be9..1eb6c5f 100644
--- a/3rdParty/CppUnit/src/src/cppunit/TestNamer.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/TestNamer.cpp
@@ -1,44 +1,34 @@
#include <cppunit/extensions/TestNamer.h>
#include <cppunit/extensions/TypeInfoHelper.h>
+#include <cppunit/tools/StringHelper.h>
#include <string>
-
CPPUNIT_NS_BEGIN
-
-#if CPPUNIT_HAVE_RTTI
TestNamer::TestNamer( const std::type_info &typeInfo )
+ : m_fixtureName( TypeInfoHelper::getClassName( typeInfo ) )
{
- m_fixtureName = TypeInfoHelper::getClassName( typeInfo );
}
-#endif
-
TestNamer::TestNamer( const std::string &fixtureName )
: m_fixtureName( fixtureName )
{
}
-
TestNamer::~TestNamer()
{
}
-
std::string
TestNamer::getFixtureName() const
{
return m_fixtureName;
}
-
std::string
TestNamer::getTestNameFor( const std::string &testMethodName ) const
{
return getFixtureName() + "::" + testMethodName;
}
-
-
-
CPPUNIT_NS_END
diff --git a/3rdParty/CppUnit/src/src/cppunit/TestPath.cpp b/3rdParty/CppUnit/src/src/cppunit/TestPath.cpp
index a2783a2..5affffb 100644
--- a/3rdParty/CppUnit/src/src/cppunit/TestPath.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/TestPath.cpp
@@ -8,11 +8,13 @@ CPPUNIT_NS_BEGIN
TestPath::TestPath()
+ : m_tests()
{
}
TestPath::TestPath( Test *root )
+ : m_tests()
{
add( root );
}
@@ -21,6 +23,7 @@ TestPath::TestPath( Test *root )
TestPath::TestPath( const TestPath &other,
int indexFirst,
int count )
+ : m_tests()
{
int countAdjustment = 0;
if ( indexFirst < 0 )
@@ -42,6 +45,7 @@ TestPath::TestPath( const TestPath &other,
TestPath::TestPath( Test *searchRoot,
const std::string &pathAsString )
+ : m_tests()
{
PathTestNames testNames;
diff --git a/3rdParty/CppUnit/src/src/cppunit/TestResult.cpp b/3rdParty/CppUnit/src/src/cppunit/TestResult.cpp
index 6be19f1..ad880bc 100644
--- a/3rdParty/CppUnit/src/src/cppunit/TestResult.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/TestResult.cpp
@@ -3,6 +3,7 @@
#include <cppunit/TestListener.h>
#include <cppunit/TestResult.h>
#include <cppunit/tools/Algorithm.h>
+#include <cppunit/portability/Stream.h>
#include <algorithm>
#include "DefaultProtector.h"
#include "ProtectorChain.h"
@@ -13,7 +14,8 @@ CPPUNIT_NS_BEGIN
TestResult::TestResult( SynchronizationObject *syncObject )
: SynchronizedObject( syncObject )
- , m_protectorChain( new ProtectorChain() )
+ , m_listeners()
+ , m_protectorChain( new ProtectorChain )
, m_stop( false )
{
m_protectorChain->push( new DefaultProtector() );
@@ -22,6 +24,8 @@ TestResult::TestResult( SynchronizationObject *syncObject )
TestResult::~TestResult()
{
+ stdCOut().flush();
+ stdCErr().flush();
delete m_protectorChain;
}
diff --git a/3rdParty/CppUnit/src/src/cppunit/TestResultCollector.cpp b/3rdParty/CppUnit/src/src/cppunit/TestResultCollector.cpp
index 4371c50..73f81da 100644
--- a/3rdParty/CppUnit/src/src/cppunit/TestResultCollector.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/TestResultCollector.cpp
@@ -7,6 +7,9 @@ CPPUNIT_NS_BEGIN
TestResultCollector::TestResultCollector( SynchronizationObject *syncObject )
: TestSuccessListener( syncObject )
+ , m_tests()
+ , m_failures()
+ , m_testErrors(0)
{
reset();
}
diff --git a/3rdParty/CppUnit/src/src/cppunit/TestSuite.cpp b/3rdParty/CppUnit/src/src/cppunit/TestSuite.cpp
index 8dd2ea6..b5d6db3 100644
--- a/3rdParty/CppUnit/src/src/cppunit/TestSuite.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/TestSuite.cpp
@@ -8,6 +8,7 @@ CPPUNIT_NS_BEGIN
/// Default constructor
TestSuite::TestSuite( std::string name )
: TestComposite( name )
+ , m_tests()
{
}
@@ -39,7 +40,7 @@ TestSuite::addTest( Test *test )
}
-const CppUnitVector<Test *> &
+const std::vector<Test *> &
TestSuite::getTests() const
{
return m_tests;
diff --git a/3rdParty/CppUnit/src/src/cppunit/TestSuiteBuilderContext.cpp b/3rdParty/CppUnit/src/src/cppunit/TestSuiteBuilderContext.cpp
index ff71b52..5e4347e 100644
--- a/3rdParty/CppUnit/src/src/cppunit/TestSuiteBuilderContext.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/TestSuiteBuilderContext.cpp
@@ -13,6 +13,7 @@ TestSuiteBuilderContextBase::TestSuiteBuilderContextBase(
: m_suite( suite )
, m_namer( namer )
, m_factory( factory )
+ , m_properties()
{
}
diff --git a/3rdParty/CppUnit/src/src/cppunit/TextTestProgressListener.cpp b/3rdParty/CppUnit/src/src/cppunit/TextTestProgressListener.cpp
index 5bbe768..ea4fb17 100644
--- a/3rdParty/CppUnit/src/src/cppunit/TextTestProgressListener.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/TextTestProgressListener.cpp
@@ -20,6 +20,7 @@ void
TextTestProgressListener::startTest( Test * )
{
stdCOut() << ".";
+ stdCOut().flush();
}
@@ -27,6 +28,7 @@ void
TextTestProgressListener::addFailure( const TestFailure &failure )
{
stdCOut() << ( failure.isError() ? "E" : "F" );
+ stdCOut().flush();
}
diff --git a/3rdParty/CppUnit/src/src/cppunit/TypeInfoHelper.cpp b/3rdParty/CppUnit/src/src/cppunit/TypeInfoHelper.cpp
index 2febac6..aa24a80 100644
--- a/3rdParty/CppUnit/src/src/cppunit/TypeInfoHelper.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/TypeInfoHelper.cpp
@@ -1,19 +1,16 @@
#include <cppunit/Portability.h>
#include <cppunit/extensions/TypeInfoHelper.h>
-#include <stdlib.h>
-
-#if CPPUNIT_HAVE_RTTI
#include <string>
#if CPPUNIT_HAVE_GCC_ABI_DEMANGLE
+#include <cstdlib>
#include <cxxabi.h>
#endif
CPPUNIT_NS_BEGIN
-
std::string
TypeInfoHelper::getClassName( const std::type_info &info )
{
@@ -22,10 +19,21 @@ TypeInfoHelper::getClassName( const std::type_info &info )
int status = 0;
char* c_name = 0;
- c_name = abi::__cxa_demangle( info.name(), 0, 0, &status );
-
- std::string name( c_name );
- free( c_name );
+ const char* c_origName = info.name();
+ if(c_origName[0] == '*')
+ ++c_origName;
+ c_name = abi::__cxa_demangle( c_origName, 0, 0, &status );
+
+ std::string name;
+ if(c_name)
+ {
+ name = std::string( c_name );
+ free( c_name );
+ }
+ else
+ {
+ name = std::string( c_origName );
+ }
#else // CPPUNIT_HAVE_GCC_ABI_DEMANGLE
@@ -48,7 +56,4 @@ TypeInfoHelper::getClassName( const std::type_info &info )
return name;
}
-
CPPUNIT_NS_END
-
-#endif // CPPUNIT_HAVE_RTTI
diff --git a/3rdParty/CppUnit/src/src/cppunit/XmlDocument.cpp b/3rdParty/CppUnit/src/src/cppunit/XmlDocument.cpp
index 31f9115..4b09769 100644
--- a/3rdParty/CppUnit/src/src/cppunit/XmlDocument.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/XmlDocument.cpp
@@ -5,7 +5,6 @@
CPPUNIT_NS_BEGIN
-
XmlDocument::XmlDocument( const std::string &encoding,
const std::string &styleSheet )
: m_styleSheet( styleSheet )
@@ -15,7 +14,6 @@ XmlDocument::XmlDocument( const std::string &encoding,
setEncoding( encoding );
}
-
XmlDocument::~XmlDocument()
{
delete m_rootElement;
diff --git a/3rdParty/CppUnit/src/src/cppunit/XmlElement.cpp b/3rdParty/CppUnit/src/src/cppunit/XmlElement.cpp
index f930ad4..b16d2fe 100644
--- a/3rdParty/CppUnit/src/src/cppunit/XmlElement.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/XmlElement.cpp
@@ -10,6 +10,8 @@ XmlElement::XmlElement( std::string elementName,
std::string content )
: m_name( elementName )
, m_content( content )
+ , m_attributes()
+ , m_elements()
{
}
@@ -17,6 +19,9 @@ XmlElement::XmlElement( std::string elementName,
XmlElement::XmlElement( std::string elementName,
int numericContent )
: m_name( elementName )
+ , m_content()
+ , m_attributes()
+ , m_elements()
{
setContent( numericContent );
}
diff --git a/3rdParty/CppUnit/src/src/cppunit/XmlOutputter.cpp b/3rdParty/CppUnit/src/src/cppunit/XmlOutputter.cpp
index c605e33..e1cb690 100644
--- a/3rdParty/CppUnit/src/src/cppunit/XmlOutputter.cpp
+++ b/3rdParty/CppUnit/src/src/cppunit/XmlOutputter.cpp
@@ -15,10 +15,13 @@ CPPUNIT_NS_BEGIN
XmlOutputter::XmlOutputter( TestResultCollector *result,
OStream &stream,
- std::string encoding )
+ const std::string& encoding )
: m_result( result )
, m_stream( stream )
+ , m_encoding( encoding )
+ , m_styleSheet()
, m_xml( new XmlDocument( encoding ) )
+ , m_hooks()
{
}