Changes to make the CPPUnit build on PPC (with mwcc *shudder*).
Courtesy of Oliver Tappe. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6616 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -18,12 +18,12 @@ namespace CppUnit
|
||||
* #include <cppunit/TestAssert.h>
|
||||
*
|
||||
* void
|
||||
* checkXmlEqual( std::string expectedXml,
|
||||
* std::string actualXml,
|
||||
* checkXmlEqual( string expectedXml,
|
||||
* string actualXml,
|
||||
* CppUnit::SourceLine sourceLine )
|
||||
* {
|
||||
* std::string expected = XmlUniformiser( expectedXml ).stripped();
|
||||
* std::string actual = XmlUniformiser( actualXml ).stripped();
|
||||
* string expected = XmlUniformiser( expectedXml ).stripped();
|
||||
* string actual = XmlUniformiser( actualXml ).stripped();
|
||||
*
|
||||
* if ( expected == actual )
|
||||
* return;
|
||||
@@ -44,7 +44,7 @@ namespace Asserter
|
||||
|
||||
/*! Throws a Exception with the specified message and location.
|
||||
*/
|
||||
void CPPUNIT_API fail( std::string message,
|
||||
void CPPUNIT_API fail( string message,
|
||||
SourceLine sourceLine = SourceLine() );
|
||||
|
||||
/*! Throws a Exception with the specified message and location.
|
||||
@@ -54,7 +54,7 @@ namespace Asserter
|
||||
* \param sourceLine Location of the assertion.
|
||||
*/
|
||||
void CPPUNIT_API failIf( bool shouldFail,
|
||||
std::string message,
|
||||
string message,
|
||||
SourceLine sourceLine = SourceLine() );
|
||||
|
||||
/*! Throws a NotEqualException with the specified message and location.
|
||||
@@ -64,10 +64,10 @@ namespace Asserter
|
||||
* where the "difference" is located.
|
||||
* \param sourceLine Location of the assertion.
|
||||
*/
|
||||
void CPPUNIT_API failNotEqual( std::string expected,
|
||||
std::string actual,
|
||||
void CPPUNIT_API failNotEqual( string expected,
|
||||
string actual,
|
||||
SourceLine sourceLine = SourceLine(),
|
||||
std::string additionalMessage ="" );
|
||||
string additionalMessage ="" );
|
||||
|
||||
/*! Throws a NotEqualException with the specified message and location.
|
||||
* \param shouldFail if \c true then the exception is thrown. Otherwise
|
||||
@@ -79,10 +79,10 @@ namespace Asserter
|
||||
* \param sourceLine Location of the assertion.
|
||||
*/
|
||||
void CPPUNIT_API failNotEqualIf( bool shouldFail,
|
||||
std::string expected,
|
||||
std::string actual,
|
||||
string expected,
|
||||
string actual,
|
||||
SourceLine sourceLine = SourceLine(),
|
||||
std::string additionalMessage ="" );
|
||||
string additionalMessage ="" );
|
||||
|
||||
} // namespace Asserter
|
||||
} // namespace CppUnit
|
||||
|
||||
@@ -34,7 +34,7 @@ class TestResultCollector;
|
||||
* // if command line contains "-selftest" then this is the post build check
|
||||
* // => the output must be in the compiler error format.
|
||||
* bool selfTest = (argc > 1) &&
|
||||
* (std::string("-selftest") == argv[1]);
|
||||
* (string("-selftest") == argv[1]);
|
||||
*
|
||||
* CppUnit::TextUi::TestRunner runner;
|
||||
* runner.addTest( CppUnitTest::suite() ); // Add the top suite to the test runner
|
||||
@@ -44,7 +44,7 @@ class TestResultCollector;
|
||||
* // The test runner owns the new outputter.
|
||||
* runner.setOutputter( CppUnit::CompilerOutputter::defaultOutputter(
|
||||
* &runner.result(),
|
||||
* std::cerr ) );
|
||||
* cerr ) );
|
||||
* }
|
||||
*
|
||||
* // Run the test and don't wait a key if post build check.
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
/*! Constructs a CompilerOutputter object.
|
||||
*/
|
||||
CompilerOutputter( TestResultCollector *result,
|
||||
std::ostream &stream );
|
||||
ostream &stream );
|
||||
|
||||
/// Destructor.
|
||||
virtual ~CompilerOutputter();
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
/*! Creates an instance of an outputter that matches your current compiler.
|
||||
*/
|
||||
static CompilerOutputter *defaultOutputter( TestResultCollector *result,
|
||||
std::ostream &stream );
|
||||
ostream &stream );
|
||||
|
||||
void write();
|
||||
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
virtual void printFailureMessage( TestFailure *failure );
|
||||
virtual void printNotEqualMessage( Exception *thrownException );
|
||||
virtual void printDefaultMessage( Exception *thrownException );
|
||||
virtual std::string wrap( std::string message );
|
||||
virtual string wrap( string message );
|
||||
|
||||
private:
|
||||
/// Prevents the use of the copy constructor.
|
||||
@@ -93,12 +93,12 @@ private:
|
||||
/// Prevents the use of the copy operator.
|
||||
void operator =( const CompilerOutputter © );
|
||||
|
||||
typedef std::vector<std::string> Lines;
|
||||
static Lines splitMessageIntoLines( std::string message );
|
||||
typedef vector<string> Lines;
|
||||
static Lines splitMessageIntoLines( string message );
|
||||
|
||||
private:
|
||||
TestResultCollector *m_result;
|
||||
std::ostream &m_stream;
|
||||
ostream &m_stream;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -14,31 +14,31 @@ namespace CppUnit {
|
||||
* Exception is an exception that serves
|
||||
* descriptive strings through its what() method
|
||||
*/
|
||||
class CPPUNIT_API Exception : public std::exception
|
||||
class CPPUNIT_API Exception : public exception
|
||||
{
|
||||
public:
|
||||
|
||||
class Type
|
||||
{
|
||||
public:
|
||||
Type( std::string type ) : m_type ( type ) {}
|
||||
Type( string type ) : m_type ( type ) {}
|
||||
|
||||
bool operator ==( const Type &other ) const
|
||||
{
|
||||
return m_type == other.m_type;
|
||||
}
|
||||
private:
|
||||
const std::string m_type;
|
||||
const string m_type;
|
||||
};
|
||||
|
||||
|
||||
Exception( std::string message = "",
|
||||
Exception( string message = "",
|
||||
SourceLine sourceLine = SourceLine() );
|
||||
|
||||
#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
|
||||
Exception( std::string message,
|
||||
Exception( string message,
|
||||
long lineNumber,
|
||||
std::string fileName );
|
||||
string fileName );
|
||||
#endif
|
||||
|
||||
Exception (const Exception& other);
|
||||
@@ -53,9 +53,9 @@ public:
|
||||
|
||||
#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
|
||||
long lineNumber() const;
|
||||
std::string fileName() const;
|
||||
string fileName() const;
|
||||
|
||||
static const std::string UNKNOWNFILENAME;
|
||||
static const string UNKNOWNFILENAME;
|
||||
static const long UNKNOWNLINENUMBER;
|
||||
#endif
|
||||
|
||||
@@ -68,9 +68,9 @@ public:
|
||||
private:
|
||||
// VC++ does not recognize call to parent class when prefixed
|
||||
// with a namespace. This is a workaround.
|
||||
typedef std::exception SuperClass;
|
||||
typedef exception SuperClass;
|
||||
|
||||
std::string m_message;
|
||||
string m_message;
|
||||
SourceLine m_sourceLine;
|
||||
};
|
||||
|
||||
|
||||
@@ -19,16 +19,16 @@ public:
|
||||
* \param additionalMessage Additionnal information provided to further qualify
|
||||
* the inequality.
|
||||
*/
|
||||
NotEqualException( std::string expected,
|
||||
std::string actual,
|
||||
NotEqualException( string expected,
|
||||
string actual,
|
||||
SourceLine sourceLine = SourceLine(),
|
||||
std::string additionalMessage = "" );
|
||||
string additionalMessage = "" );
|
||||
|
||||
#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
|
||||
NotEqualException( std::string expected,
|
||||
std::string actual,
|
||||
NotEqualException( string expected,
|
||||
string actual,
|
||||
long lineNumber,
|
||||
std::string fileName );
|
||||
string fileName );
|
||||
#endif
|
||||
|
||||
NotEqualException( const NotEqualException &other );
|
||||
@@ -36,11 +36,11 @@ public:
|
||||
|
||||
virtual ~NotEqualException() throw();
|
||||
|
||||
std::string expectedValue() const;
|
||||
string expectedValue() const;
|
||||
|
||||
std::string actualValue() const;
|
||||
string actualValue() const;
|
||||
|
||||
std::string additionalMessage() const;
|
||||
string additionalMessage() const;
|
||||
|
||||
/*! Copy operator.
|
||||
* @param other Object to copy.
|
||||
@@ -55,9 +55,9 @@ public:
|
||||
static Type type();
|
||||
|
||||
private:
|
||||
std::string m_expected;
|
||||
std::string m_actual;
|
||||
std::string m_additionalMessage;
|
||||
string m_expected;
|
||||
string m_actual;
|
||||
string m_additionalMessage;
|
||||
};
|
||||
|
||||
} // namespace CppUnit
|
||||
|
||||
@@ -16,6 +16,11 @@
|
||||
*/
|
||||
|
||||
|
||||
#if defined(__POWERPC__) && defined(__BEOS__)
|
||||
#define CPPUNIT_HAVE_SSTREAM 1
|
||||
#undef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
|
||||
#endif
|
||||
|
||||
/* Define to 1 if you wish to have the old-style macros
|
||||
assert(), assertEqual(), assertDoublesEqual(), and assertLongsEqual() */
|
||||
#ifndef CPPUNIT_ENABLE_NAKED_ASSERT
|
||||
@@ -45,13 +50,13 @@
|
||||
/* perform portability hacks */
|
||||
|
||||
|
||||
/* Define CPPUNIT_SSTREAM as a stream with a "std::string str()"
|
||||
/* Define CPPUNIT_SSTREAM as a stream with a "string str()"
|
||||
* method.
|
||||
*/
|
||||
#if CPPUNIT_HAVE_SSTREAM
|
||||
# include <sstream>
|
||||
namespace CppUnit {
|
||||
class OStringStream : public std::ostringstream
|
||||
class OStringStream : public ostringstream
|
||||
{
|
||||
};
|
||||
}
|
||||
@@ -65,14 +70,14 @@
|
||||
# endif
|
||||
|
||||
namespace CppUnit {
|
||||
class OStringStream : public std::ostrstream
|
||||
class OStringStream : public ostrstream
|
||||
{
|
||||
public:
|
||||
std::string str()
|
||||
string str()
|
||||
{
|
||||
(*this) << '\0';
|
||||
std::string msg(std::ostrstream::str());
|
||||
std::ostrstream::freeze(false);
|
||||
string msg(ostrstream::str());
|
||||
ostrstream::freeze(false);
|
||||
return msg;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@ class CPPUNIT_API SourceLine
|
||||
public:
|
||||
SourceLine();
|
||||
|
||||
SourceLine( const std::string &fileName,
|
||||
SourceLine( const string &fileName,
|
||||
int lineNumber );
|
||||
|
||||
/// Destructor.
|
||||
@@ -42,13 +42,13 @@ public:
|
||||
|
||||
int lineNumber() const;
|
||||
|
||||
std::string fileName() const;
|
||||
string fileName() const;
|
||||
|
||||
bool operator ==( const SourceLine &other ) const;
|
||||
bool operator !=( const SourceLine &other ) const;
|
||||
|
||||
private:
|
||||
std::string m_fileName;
|
||||
string m_fileName;
|
||||
int m_lineNumber;
|
||||
};
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
* Each test has a name. This name may be used to find the
|
||||
* test in a suite or registry of tests.
|
||||
*/
|
||||
virtual std::string getName () const = 0;
|
||||
virtual string getName () const = 0;
|
||||
|
||||
/*! \brief Description of the test, for diagnostic output.
|
||||
*
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
* suite named <tt>complex_add</tt> may be described as
|
||||
* <tt>suite complex_add</tt>.
|
||||
*/
|
||||
virtual std::string toString () const = 0;
|
||||
virtual string toString () const = 0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -14,16 +14,16 @@ namespace CppUnit {
|
||||
*
|
||||
* \code
|
||||
* template<>
|
||||
* struct assertion_traits<std::string> // specialization for the std::string type
|
||||
* struct assertion_traits<string> // specialization for the string type
|
||||
* {
|
||||
* static bool equal( const std::string& x, const std::string& y )
|
||||
* static bool equal( const string& x, const string& y )
|
||||
* {
|
||||
* return x == y;
|
||||
* }
|
||||
*
|
||||
* static std::string toString( const std::string& x )
|
||||
* static string toString( const string& x )
|
||||
* {
|
||||
* std::string text = '"' + x + '"'; // adds quote around the string to see whitespace
|
||||
* string text = '"' + x + '"'; // adds quote around the string to see whitespace
|
||||
* OStringStream ost;
|
||||
* ost << text;
|
||||
* return ost.str();
|
||||
@@ -39,7 +39,7 @@ namespace CppUnit {
|
||||
return x == y;
|
||||
}
|
||||
|
||||
static std::string toString( const T& x )
|
||||
static string toString( const T& x )
|
||||
{
|
||||
OStringStream ost;
|
||||
ost << x;
|
||||
@@ -52,21 +52,21 @@ namespace CppUnit {
|
||||
{
|
||||
#ifdef CPPUNIT_ENABLE_SOURCELINE_DEPRECATED
|
||||
void CPPUNIT_API assertImplementation( bool condition,
|
||||
std::string conditionExpression = "",
|
||||
string conditionExpression = "",
|
||||
long lineNumber,
|
||||
std::string fileName );
|
||||
string fileName );
|
||||
|
||||
void CPPUNIT_API assertNotEqualImplementation( std::string expected,
|
||||
std::string actual,
|
||||
void CPPUNIT_API assertNotEqualImplementation( string expected,
|
||||
string actual,
|
||||
long lineNumber,
|
||||
std::string fileName );
|
||||
string fileName );
|
||||
|
||||
|
||||
template <class T>
|
||||
void assertEquals( const T& expected,
|
||||
const T& actual,
|
||||
long lineNumber,
|
||||
std::string fileName )
|
||||
string fileName )
|
||||
{
|
||||
if ( !assertion_traits<T>::equal(expected,actual) ) // lazy toString conversion...
|
||||
{
|
||||
@@ -81,7 +81,7 @@ namespace CppUnit {
|
||||
double actual,
|
||||
double delta,
|
||||
long lineNumber,
|
||||
std::string fileName );
|
||||
string fileName );
|
||||
|
||||
#else // using SourceLine
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace CppUnit {
|
||||
void assertEquals( const T& expected,
|
||||
const T& actual,
|
||||
SourceLine sourceLine,
|
||||
const std::string &message ="" )
|
||||
const string &message ="" )
|
||||
{
|
||||
if ( !assertion_traits<T>::equal(expected,actual) ) // lazy toString conversion...
|
||||
{
|
||||
@@ -166,7 +166,7 @@ namespace CppUnit {
|
||||
*
|
||||
* Requirement for \a expected and \a actual parameters:
|
||||
* - They are exactly of the same type
|
||||
* - They are serializable into a std::strstream using operator <<.
|
||||
* - They are serializable into a strstream using operator <<.
|
||||
* - They can be compared using operator ==.
|
||||
*
|
||||
* The last two requirements (serialization and comparison) can be
|
||||
@@ -189,7 +189,7 @@ namespace CppUnit {
|
||||
*
|
||||
* Requirement for \a expected and \a actual parameters:
|
||||
* - They are exactly of the same type
|
||||
* - They are serializable into a std::strstream using operator <<.
|
||||
* - They are serializable into a strstream using operator <<.
|
||||
* - They can be compared using operator ==.
|
||||
*
|
||||
* The last two requirements (serialization and comparison) can be
|
||||
|
||||
@@ -33,11 +33,11 @@ struct ExpectedExceptionTraits
|
||||
static void expectedException()
|
||||
{
|
||||
#if CPPUNIT_USE_TYPEINFO_NAME
|
||||
std::string message( "Expected exception of type " );
|
||||
string message( "Expected exception of type " );
|
||||
message += TypeInfoHelper::getClassName( typeid( ExceptionType ) );
|
||||
message += ", but got none";
|
||||
#else
|
||||
std::string message( "Expected exception but got none" );
|
||||
string message( "Expected exception but got none" );
|
||||
#endif
|
||||
throw Exception( message );
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
* \param name name of this TestCaller
|
||||
* \param test the method this TestCaller calls in runTest()
|
||||
*/
|
||||
TestCaller( std::string name, TestMethod test ) :
|
||||
TestCaller( string name, TestMethod test ) :
|
||||
TestCase( name ),
|
||||
m_ownFixture( true ),
|
||||
m_fixture( new Fixture() ),
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
* \param test the method this TestCaller calls in runTest()
|
||||
* \param fixture the Fixture to invoke the test method on.
|
||||
*/
|
||||
TestCaller(std::string name, TestMethod test, Fixture& fixture) :
|
||||
TestCaller(string name, TestMethod test, Fixture& fixture) :
|
||||
TestCase( name ),
|
||||
m_ownFixture( false ),
|
||||
m_fixture( &fixture ),
|
||||
@@ -145,7 +145,7 @@ public:
|
||||
* \param test the method this TestCaller calls in runTest()
|
||||
* \param fixture the Fixture to invoke the test method on.
|
||||
*/
|
||||
TestCaller(std::string name, TestMethod test, Fixture* fixture) :
|
||||
TestCaller(string name, TestMethod test, Fixture* fixture) :
|
||||
TestCase( name ),
|
||||
m_ownFixture( true ),
|
||||
m_fixture( fixture ),
|
||||
@@ -182,7 +182,7 @@ protected:
|
||||
m_fixture->tearDown ();
|
||||
}
|
||||
|
||||
std::string toString() const
|
||||
string toString() const
|
||||
{
|
||||
return "TestCaller " + getName();
|
||||
}
|
||||
|
||||
@@ -28,15 +28,15 @@ class CPPUNIT_API TestCase : public Test,
|
||||
{
|
||||
public:
|
||||
|
||||
TestCase( std::string Name );
|
||||
TestCase( string Name );
|
||||
//! \internal
|
||||
TestCase();
|
||||
~TestCase();
|
||||
|
||||
virtual void run(TestResult *result);
|
||||
virtual int countTestCases() const;
|
||||
std::string getName() const;
|
||||
std::string toString() const;
|
||||
string getName() const;
|
||||
string toString() const;
|
||||
|
||||
//! FIXME: what is this for?
|
||||
virtual TestResult *run();
|
||||
@@ -53,7 +53,7 @@ private:
|
||||
TestCase &operator=( const TestCase &other );
|
||||
|
||||
private:
|
||||
const std::string m_name;
|
||||
const string m_name;
|
||||
};
|
||||
|
||||
} // namespace CppUnit
|
||||
|
||||
@@ -37,9 +37,9 @@ public:
|
||||
|
||||
virtual bool isError() const;
|
||||
|
||||
virtual std::string failedTestName() const;
|
||||
virtual string failedTestName() const;
|
||||
|
||||
virtual std::string toString() const;
|
||||
virtual string toString() const;
|
||||
|
||||
virtual TestFailure *clone() const;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class TestFailure;
|
||||
class TestListener;
|
||||
|
||||
#if CPPUNIT_NEED_DLL_DECL
|
||||
template class CPPUNIT_API std::deque<TestListener *>;
|
||||
template class CPPUNIT_API deque<TestListener *>;
|
||||
#endif
|
||||
|
||||
/*! \brief Manages TestListener.
|
||||
@@ -65,7 +65,7 @@ protected:
|
||||
void addFailure( const TestFailure &failure );
|
||||
|
||||
protected:
|
||||
typedef std::deque<TestListener *> TestListeners;
|
||||
typedef deque<TestListener *> TestListeners;
|
||||
TestListeners m_listeners;
|
||||
bool m_stop;
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ namespace CppUnit
|
||||
|
||||
|
||||
#if CPPUNIT_NEED_DLL_DECL
|
||||
template class CPPUNIT_API std::deque<TestFailure *>;
|
||||
template class CPPUNIT_API std::deque<Test *>;
|
||||
template class CPPUNIT_API deque<TestFailure *>;
|
||||
template class CPPUNIT_API deque<Test *>;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ namespace CppUnit
|
||||
class CPPUNIT_API TestResultCollector : public TestSucessListener
|
||||
{
|
||||
public:
|
||||
typedef std::deque<TestFailure *> TestFailures;
|
||||
typedef std::deque<Test *> Tests;
|
||||
typedef deque<TestFailure *> TestFailures;
|
||||
typedef deque<Test *> Tests;
|
||||
|
||||
|
||||
/*! Constructs a TestResultCollector object.
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace CppUnit {
|
||||
class TestResult;
|
||||
|
||||
#if CPPUNIT_NEED_DLL_DECL
|
||||
template class CPPUNIT_API std::vector<Test *>;
|
||||
template class CPPUNIT_API vector<Test *>;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -44,16 +44,16 @@ class TestResult;
|
||||
class CPPUNIT_API TestSuite : public Test
|
||||
{
|
||||
public:
|
||||
TestSuite( std::string name = "" );
|
||||
TestSuite( string name = "" );
|
||||
~TestSuite();
|
||||
|
||||
void run( TestResult *result );
|
||||
int countTestCases() const;
|
||||
std::string getName() const;
|
||||
std::string toString() const;
|
||||
string getName() const;
|
||||
string toString() const;
|
||||
|
||||
void addTest( Test *test );
|
||||
const std::vector<Test *> &getTests() const;
|
||||
const vector<Test *> &getTests() const;
|
||||
|
||||
virtual void deleteContents();
|
||||
|
||||
@@ -62,8 +62,8 @@ private:
|
||||
TestSuite &operator =( const TestSuite &other );
|
||||
|
||||
private:
|
||||
std::vector<Test *> m_tests;
|
||||
const std::string m_name;
|
||||
vector<Test *> m_tests;
|
||||
const string m_name;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class CPPUNIT_API TextOutputter : public Outputter
|
||||
{
|
||||
public:
|
||||
TextOutputter( TestResultCollector *result,
|
||||
std::ostream &stream );
|
||||
ostream &stream );
|
||||
|
||||
/// Destructor.
|
||||
virtual ~TextOutputter();
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
|
||||
protected:
|
||||
TestResultCollector *m_result;
|
||||
std::ostream &m_stream;
|
||||
ostream &m_stream;
|
||||
|
||||
private:
|
||||
/// Prevents the use of the copy constructor.
|
||||
|
||||
@@ -25,29 +25,29 @@ public:
|
||||
virtual void addFailure( Test *test, Exception *e );
|
||||
virtual void addFailure( const TestFailure &failure );
|
||||
virtual void startTest( Test *test );
|
||||
virtual void print( std::ostream &stream );
|
||||
virtual void printFailures( std::ostream &stream );
|
||||
virtual void printHeader( std::ostream &stream );
|
||||
virtual void print( ostream &stream );
|
||||
virtual void printFailures( ostream &stream );
|
||||
virtual void printHeader( ostream &stream );
|
||||
|
||||
virtual void printFailure( TestFailure *failure,
|
||||
int failureNumber,
|
||||
std::ostream &stream );
|
||||
ostream &stream );
|
||||
virtual void printFailureListMark( int failureNumber,
|
||||
std::ostream &stream );
|
||||
ostream &stream );
|
||||
virtual void printFailureTestName( TestFailure *failure,
|
||||
std::ostream &stream );
|
||||
ostream &stream );
|
||||
virtual void printFailureType( TestFailure *failure,
|
||||
std::ostream &stream );
|
||||
ostream &stream );
|
||||
virtual void printFailureLocation( SourceLine sourceLine,
|
||||
std::ostream &stream );
|
||||
ostream &stream );
|
||||
virtual void printFailureDetail( Exception *thrownException,
|
||||
std::ostream &stream );
|
||||
virtual void printFailureWarning( std::ostream &stream );
|
||||
virtual void printStatistics( std::ostream &stream );
|
||||
ostream &stream );
|
||||
virtual void printFailureWarning( ostream &stream );
|
||||
virtual void printStatistics( ostream &stream );
|
||||
};
|
||||
|
||||
/** insertion operator for easy output */
|
||||
std::ostream &operator <<( std::ostream &stream,
|
||||
ostream &operator <<( ostream &stream,
|
||||
TextTestResult &result );
|
||||
|
||||
} // namespace CppUnit
|
||||
|
||||
@@ -36,8 +36,8 @@ public:
|
||||
* \param encoding Encoding used in the XML file (default is Latin-1).
|
||||
*/
|
||||
XmlOutputter( TestResultCollector *result,
|
||||
std::ostream &stream,
|
||||
std::string encoding = "ISO-8859-1" );
|
||||
ostream &stream,
|
||||
string encoding = "ISO-8859-1" );
|
||||
|
||||
/// Destructor.
|
||||
virtual ~XmlOutputter();
|
||||
@@ -56,33 +56,33 @@ public:
|
||||
class CPPUNIT_API Node
|
||||
{
|
||||
public:
|
||||
Node( std::string elementName,
|
||||
std::string content ="" );
|
||||
Node( std::string elementName,
|
||||
Node( string elementName,
|
||||
string content ="" );
|
||||
Node( string elementName,
|
||||
int numericContent );
|
||||
virtual ~Node();
|
||||
|
||||
void addAttribute( std::string attributeName,
|
||||
std::string value );
|
||||
void addAttribute( std::string attributeName,
|
||||
void addAttribute( string attributeName,
|
||||
string value );
|
||||
void addAttribute( string attributeName,
|
||||
int numericValue );
|
||||
void addNode( Node *node );
|
||||
|
||||
std::string toString() const;
|
||||
string toString() const;
|
||||
|
||||
private:
|
||||
typedef std::pair<std::string,std::string> Attribute;
|
||||
typedef pair<string,string> Attribute;
|
||||
|
||||
std::string attributesAsString() const;
|
||||
std::string escape( std::string value ) const;
|
||||
static std::string asString( int value );
|
||||
string attributesAsString() const;
|
||||
string escape( string value ) const;
|
||||
static string asString( int value );
|
||||
|
||||
private:
|
||||
std::string m_name;
|
||||
std::string m_content;
|
||||
typedef std::deque<Attribute> Attributes;
|
||||
string m_name;
|
||||
string m_content;
|
||||
typedef deque<Attribute> Attributes;
|
||||
Attributes m_attributes;
|
||||
typedef std::deque<Node *> Nodes;
|
||||
typedef deque<Node *> Nodes;
|
||||
Nodes m_nodes;
|
||||
};
|
||||
|
||||
@@ -90,7 +90,7 @@ public:
|
||||
virtual void writeProlog();
|
||||
virtual void writeTestsResult();
|
||||
|
||||
typedef std::map<Test *,TestFailure*> FailedTests;
|
||||
typedef map<Test *,TestFailure*> FailedTests;
|
||||
virtual Node *makeRootNode();
|
||||
virtual void addFailedTests( FailedTests &failedTests,
|
||||
Node *rootNode );
|
||||
@@ -111,8 +111,8 @@ protected:
|
||||
|
||||
protected:
|
||||
TestResultCollector *m_result;
|
||||
std::ostream &m_stream;
|
||||
std::string m_encoding;
|
||||
ostream &m_stream;
|
||||
string m_encoding;
|
||||
|
||||
private:
|
||||
/// Prevents the use of the copy constructor.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/* config/config.h. Generated automatically by configure. */
|
||||
/* config/config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* define if library uses std::string::compare(string,pos,n) */
|
||||
/* define if library uses string::compare(string,pos,n) */
|
||||
#ifndef CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST
|
||||
#define CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST 1
|
||||
#endif
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace CppUnit {
|
||||
/** Auto-register the suite factory in the specified registry.
|
||||
* \param name Name of the registry.
|
||||
*/
|
||||
AutoRegisterSuite( const std::string &name )
|
||||
AutoRegisterSuite( const string &name )
|
||||
{
|
||||
TestFactory *factory = new TestSuiteFactory<TestCaseType>();
|
||||
TestFactoryRegistry::getRegistry( name ).registerFactory( factory );
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace CppUnit
|
||||
#if CPPUNIT_USE_TYPEINFO_NAME
|
||||
# define __CPPUNIT_SUITE_CTOR_ARGS( ATestFixtureType )
|
||||
#else
|
||||
# define __CPPUNIT_SUITE_CTOR_ARGS( ATestFixtureType ) (std::string(#ATestFixtureType))
|
||||
# define __CPPUNIT_SUITE_CTOR_ARGS( ATestFixtureType ) (string(#ATestFixtureType))
|
||||
#endif
|
||||
|
||||
|
||||
@@ -196,13 +196,13 @@ namespace CppUnit
|
||||
* #include <vector>
|
||||
* class MyTest : public CppUnit::TestFixture {
|
||||
* CPPUNIT_TEST_SUITE( MyTest );
|
||||
* CPPUNIT_TEST_EXCEPTION( testVectorAtThrow, std::invalid_argument );
|
||||
* CPPUNIT_TEST_EXCEPTION( testVectorAtThrow, invalid_argument );
|
||||
* CPPUNIT_TEST_SUITE_END();
|
||||
* public:
|
||||
* void testVectorAtThrow()
|
||||
* {
|
||||
* std::vector<int> v;
|
||||
* v.at( 1 ); // must throw exception std::invalid_argument
|
||||
* vector<int> v;
|
||||
* v.at( 1 ); // must throw exception invalid_argument
|
||||
* }
|
||||
* };
|
||||
* \endcode
|
||||
@@ -303,7 +303,7 @@ namespace CppUnit
|
||||
* \code
|
||||
* // MySuites.h
|
||||
* namespace MySuites {
|
||||
* std::string math() {
|
||||
* string math() {
|
||||
* return "Math";
|
||||
* }
|
||||
* }
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
|
||||
void run( TestResult *result );
|
||||
int countTestCases() const;
|
||||
std::string toString() const;
|
||||
string toString() const;
|
||||
|
||||
private:
|
||||
RepeatedTest( const RepeatedTest & );
|
||||
|
||||
@@ -25,8 +25,8 @@ public:
|
||||
|
||||
void run (TestResult *result);
|
||||
int countTestCases () const;
|
||||
std::string getName () const;
|
||||
std::string toString () const;
|
||||
string getName () const;
|
||||
string toString () const;
|
||||
|
||||
protected:
|
||||
Test *m_test;
|
||||
@@ -53,11 +53,11 @@ inline void TestDecorator::run (TestResult *result)
|
||||
{ m_test->run (result); }
|
||||
|
||||
|
||||
inline std::string TestDecorator::toString () const
|
||||
inline string TestDecorator::toString () const
|
||||
{ return m_test->toString (); }
|
||||
|
||||
|
||||
inline std::string TestDecorator::getName () const
|
||||
inline string TestDecorator::getName () const
|
||||
{ return m_test->getName(); }
|
||||
|
||||
} // namespace CppUnit
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace CppUnit {
|
||||
class TestSuite;
|
||||
|
||||
#if CPPUNIT_NEED_DLL_DECL
|
||||
template class CPPUNIT_API std::map<std::string, TestFactory *>;
|
||||
template class CPPUNIT_API map<string, TestFactory *>;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public:
|
||||
* \param name Name of the registry. It is the name of TestSuite returned by
|
||||
* makeTest().
|
||||
*/
|
||||
TestFactoryRegistry( std::string name = "All Tests" );
|
||||
TestFactoryRegistry( string name = "All Tests" );
|
||||
|
||||
/// Destructor.
|
||||
virtual ~TestFactoryRegistry();
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
* \return Registry. If the registry does not exist, it is created with the
|
||||
* specified name.
|
||||
*/
|
||||
static TestFactoryRegistry &getRegistry( const std::string &name );
|
||||
static TestFactoryRegistry &getRegistry( const string &name );
|
||||
|
||||
/** Adds the registered tests to the specified suite.
|
||||
* \param suite Suite the tests are added to.
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
* \param factory Factory to register.
|
||||
* \deprecated Use registerFactory( TestFactory *) instead.
|
||||
*/
|
||||
void registerFactory( const std::string &name,
|
||||
void registerFactory( const string &name,
|
||||
TestFactory *factory );
|
||||
|
||||
/** Adds the specified TestFactory to the registry.
|
||||
@@ -130,10 +130,10 @@ private:
|
||||
void operator =( const TestFactoryRegistry © );
|
||||
|
||||
private:
|
||||
typedef std::map<std::string, TestFactory *> Factories;
|
||||
typedef map<string, TestFactory *> Factories;
|
||||
Factories m_factories;
|
||||
|
||||
std::string m_name;
|
||||
string m_name;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace CppUnit {
|
||||
{
|
||||
}
|
||||
|
||||
TestSuiteBuilder(std::string name) : m_suite( new TestSuite(name) )
|
||||
TestSuiteBuilder(string name) : m_suite( new TestSuite(name) )
|
||||
{
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace CppUnit {
|
||||
m_suite->addTest( test );
|
||||
}
|
||||
|
||||
void addTestCaller( std::string methodName,
|
||||
void addTestCaller( string methodName,
|
||||
TestMethod testMethod )
|
||||
{
|
||||
Test *test =
|
||||
@@ -66,7 +66,7 @@ namespace CppUnit {
|
||||
addTest( test );
|
||||
}
|
||||
|
||||
void addTestCaller( std::string methodName,
|
||||
void addTestCaller( string methodName,
|
||||
TestMethod testMethod,
|
||||
Fixture *fixture )
|
||||
{
|
||||
@@ -78,7 +78,7 @@ namespace CppUnit {
|
||||
}
|
||||
|
||||
template<typename ExceptionType>
|
||||
void addTestCallerForException( std::string methodName,
|
||||
void addTestCallerForException( string methodName,
|
||||
TestMethod testMethod,
|
||||
Fixture *fixture,
|
||||
ExceptionType *dummyPointer )
|
||||
@@ -91,13 +91,13 @@ namespace CppUnit {
|
||||
}
|
||||
|
||||
|
||||
std::string makeTestName( const std::string &methodName )
|
||||
string makeTestName( const string &methodName )
|
||||
{
|
||||
return m_suite->getName() + "." + methodName;
|
||||
}
|
||||
|
||||
private:
|
||||
std::auto_ptr<TestSuite> m_suite;
|
||||
auto_ptr<TestSuite> m_suite;
|
||||
};
|
||||
|
||||
} // namespace CppUnit
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace CppUnit {
|
||||
* the "class" prefix. If the name is not prefixed
|
||||
* by "class", it is returned as this.
|
||||
*/
|
||||
static std::string getClassName( const std::type_info &info );
|
||||
static string getClassName( const type_info &info );
|
||||
};
|
||||
|
||||
} // namespace CppUnit
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace TextUi
|
||||
* runner.addTest( ExampleTestCase::suite() );
|
||||
* runner.setOutputter( CppUnit::CompilerOutputter::defaultOutputter(
|
||||
* &runner.result(),
|
||||
* std::cerr ) );
|
||||
* cerr ) );
|
||||
* MyCustomProgressTestListener progress;
|
||||
* runner.eventManager().addListener( &progress );
|
||||
* runner.run( "", true ); // Run all tests and wait
|
||||
@@ -66,7 +66,7 @@ public:
|
||||
|
||||
virtual ~TestRunner();
|
||||
|
||||
bool run( std::string testName ="",
|
||||
bool run( string testName ="",
|
||||
bool doWait = false,
|
||||
bool doPrintResult = true,
|
||||
bool doPrintProgress = true );
|
||||
@@ -82,12 +82,12 @@ public:
|
||||
protected:
|
||||
virtual bool runTest( Test *test,
|
||||
bool doPrintProgress );
|
||||
virtual bool runTestByName( std::string testName,
|
||||
virtual bool runTestByName( string testName,
|
||||
bool printProgress );
|
||||
virtual void wait( bool doWait );
|
||||
virtual void printResult( bool doPrintResult );
|
||||
|
||||
virtual Test *findTestByName( std::string name ) const;
|
||||
virtual Test *findTestByName( string name ) const;
|
||||
|
||||
TestSuite *m_suite;
|
||||
TestResultCollector *m_result;
|
||||
|
||||
Reference in New Issue
Block a user