diff --git a/headers/tools/cppunit/TestCase.h b/headers/tools/cppunit/TestCase.h index 4052979491..14aa89164e 100644 --- a/headers/tools/cppunit/TestCase.h +++ b/headers/tools/cppunit/TestCase.h @@ -8,7 +8,7 @@ //! Base class for single threaded unit tests class BTestCase : public CppUnit::TestCase { public: - BTestCase(std::string Name = ""); + BTestCase(string Name = ""); //! Displays the next sub test progress indicator (i.e. [0][1][2][3]...). virtual void NextSubTest(); diff --git a/headers/tools/cppunit/TestShell.h b/headers/tools/cppunit/TestShell.h index 2069ebe65a..b989c9a78f 100644 --- a/headers/tools/cppunit/TestShell.h +++ b/headers/tools/cppunit/TestShell.h @@ -48,13 +48,13 @@ typedef CppUnit::SynchronizedObject::SynchronizationObject SyncObject; */ class BTestShell { public: - BTestShell(const std::string &description = "", SyncObject *syncObject = 0); + BTestShell(const string &description = "", SyncObject *syncObject = 0); virtual ~BTestShell(); // This function is used to add the tests for a given kit (as contained // in a BTestSuite object) to the list of available tests. The shell assumes // ownership of the BTestSuite object. Each test in the kit is added to - // the list of tests via a call to AddTest(std::string + // the list of tests via a call to AddTest(string status_t AddSuite(BTestSuite *kit); // This function is used to add test suites to the list of available @@ -64,7 +64,7 @@ public: // when the program is run with "--list" as an argument. Usually the // given suite would be a test suite for an entire class, but that's // not a requirement. - void AddTest(const std::string &name, CppUnit::Test* test); + void AddTest(const string &name, CppUnit::Test* test); // This function loads all the test addons it finds in the given // directory, returning the number of tests actually loaded. @@ -104,18 +104,18 @@ public: bool WasDebuggerCalled(); protected: - typedef std::map TestMap; - typedef std::map SuiteMap; + typedef map TestMap; + typedef map SuiteMap; VerbosityLevel fVerbosityLevel; - std::set fTestsToRun; - std::set fSuitesToRun; + set fTestsToRun; + set fSuitesToRun; TestMap fTests; SuiteMap fSuites; - std::set fLibDirs; + set fLibDirs; CppUnit::TestResult fTestResults; CppUnit::TestResultCollector fResultsCollector; - std::string fDescription; + string fDescription; static BTestShell* fGlobalShell; static const char indent[]; bool fListTestsAndExit; @@ -149,7 +149,7 @@ protected: bool ProcessArguments(int argc, char *argv[]); //! Processes a single argument, given by the \c arg parameter. - virtual bool ProcessArgument(std::string arg, int argc, char *argv[]); + virtual bool ProcessArgument(string arg, int argc, char *argv[]); //! Makes any necessary pre-test preparations void InitOutput(); diff --git a/headers/tools/cppunit/TestSuite.h b/headers/tools/cppunit/TestSuite.h index 3e1f5f0f56..c32ad7c20b 100644 --- a/headers/tools/cppunit/TestSuite.h +++ b/headers/tools/cppunit/TestSuite.h @@ -10,22 +10,22 @@ class CppUnit::TestResult; //! Groups together a set of tests for a given kit. class BTestSuite : public CppUnit::Test { public: - BTestSuite( std::string name = "" ); + BTestSuite( string name = "" ); virtual ~BTestSuite(); virtual void run( CppUnit::TestResult *result ); virtual int countTestCases() const; - virtual std::string getName() const; - virtual std::string toString() const; + virtual string getName() const; + virtual string toString() const; - virtual void addTest(std::string name, CppUnit::Test *test); + virtual void addTest(string name, CppUnit::Test *test); virtual void deleteContents(); - const std::map &getTests() const; + const map &getTests() const; protected: - std::map fTests; - const std::string fName; + map fTests; + const string fName; private: BTestSuite(const BTestSuite &other); diff --git a/headers/tools/cppunit/TestUtils.h b/headers/tools/cppunit/TestUtils.h index 24fc345f01..48fe0c661e 100644 --- a/headers/tools/cppunit/TestUtils.h +++ b/headers/tools/cppunit/TestUtils.h @@ -26,7 +26,7 @@ Equals(const A &a, const B &b, const C &c) } // Returns a string version of the given integer -std::string IntToStr(int i); +string IntToStr(int i); // Calls system() with the concatenated string of command and parameter. void ExecCommand(const char *command, const char *parameter); diff --git a/headers/tools/cppunit/ThreadedTestCase.h b/headers/tools/cppunit/ThreadedTestCase.h index 5a61f900b8..d62a67c7d0 100644 --- a/headers/tools/cppunit/ThreadedTestCase.h +++ b/headers/tools/cppunit/ThreadedTestCase.h @@ -11,7 +11,7 @@ //! Base class for single threaded unit tests class BThreadedTestCase : public BTestCase { public: - BThreadedTestCase(std::string Name = "", std::string progressSeparator = "."); + BThreadedTestCase(string Name = "", string progressSeparator = "."); virtual ~BThreadedTestCase(); /*! \brief Displays the next sub test progress indicator for the @@ -33,24 +33,24 @@ public: //! Restores the current working directory to last directory saved by a call to SaveCWD(). void RestoreCWD(const char *alternate = NULL); - void InitThreadInfo(thread_id id, std::string threadName); + void InitThreadInfo(thread_id id, string threadName); bool RegisterForUse(); void UnregisterForUse(); - std::vector& AcquireUpdateList(); + vector& AcquireUpdateList(); void ReleaseUpdateList(); protected: bool fInUse; // friend class ThreadManager; - std::string fProgressSeparator; + string fProgressSeparator; struct ThreadSubTestInfo { - std::string name; + string name; int32 subTestNum; }; - std::map fNumberMap; - std::vector fUpdateList; + map fNumberMap; + vector fUpdateList; BLocker *fUpdateLock; }; diff --git a/headers/tools/cppunit/cppunit/Asserter.h b/headers/tools/cppunit/cppunit/Asserter.h index 808b909c05..1bfb5813b8 100644 --- a/headers/tools/cppunit/cppunit/Asserter.h +++ b/headers/tools/cppunit/cppunit/Asserter.h @@ -18,12 +18,12 @@ namespace CppUnit * #include * * 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 diff --git a/headers/tools/cppunit/cppunit/CompilerOutputter.h b/headers/tools/cppunit/cppunit/CompilerOutputter.h index 0075972bc0..ac17c2bc92 100644 --- a/headers/tools/cppunit/cppunit/CompilerOutputter.h +++ b/headers/tools/cppunit/cppunit/CompilerOutputter.h @@ -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 Lines; - static Lines splitMessageIntoLines( std::string message ); + typedef vector Lines; + static Lines splitMessageIntoLines( string message ); private: TestResultCollector *m_result; - std::ostream &m_stream; + ostream &m_stream; }; diff --git a/headers/tools/cppunit/cppunit/Exception.h b/headers/tools/cppunit/cppunit/Exception.h index 505d16edf8..491bda454f 100644 --- a/headers/tools/cppunit/cppunit/Exception.h +++ b/headers/tools/cppunit/cppunit/Exception.h @@ -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; }; diff --git a/headers/tools/cppunit/cppunit/NotEqualException.h b/headers/tools/cppunit/cppunit/NotEqualException.h index 52cc7d2d97..3963295e2a 100644 --- a/headers/tools/cppunit/cppunit/NotEqualException.h +++ b/headers/tools/cppunit/cppunit/NotEqualException.h @@ -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 diff --git a/headers/tools/cppunit/cppunit/Portability.h b/headers/tools/cppunit/cppunit/Portability.h index 902de567f4..c1151042c7 100644 --- a/headers/tools/cppunit/cppunit/Portability.h +++ b/headers/tools/cppunit/cppunit/Portability.h @@ -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 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; } }; diff --git a/headers/tools/cppunit/cppunit/SourceLine.h b/headers/tools/cppunit/cppunit/SourceLine.h index 5d2a3c1ce2..c10d548124 100644 --- a/headers/tools/cppunit/cppunit/SourceLine.h +++ b/headers/tools/cppunit/cppunit/SourceLine.h @@ -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; }; diff --git a/headers/tools/cppunit/cppunit/Test.h b/headers/tools/cppunit/cppunit/Test.h index 2ee2a483e3..83f963d04c 100644 --- a/headers/tools/cppunit/cppunit/Test.h +++ b/headers/tools/cppunit/cppunit/Test.h @@ -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 complex_add may be described as * suite complex_add. */ - virtual std::string toString () const = 0; + virtual string toString () const = 0; }; diff --git a/headers/tools/cppunit/cppunit/TestAssert.h b/headers/tools/cppunit/cppunit/TestAssert.h index 2f47f59b4d..a42133e2f5 100644 --- a/headers/tools/cppunit/cppunit/TestAssert.h +++ b/headers/tools/cppunit/cppunit/TestAssert.h @@ -14,16 +14,16 @@ namespace CppUnit { * * \code * template<> - * struct assertion_traits // specialization for the std::string type + * struct assertion_traits // 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 void assertEquals( const T& expected, const T& actual, long lineNumber, - std::string fileName ) + string fileName ) { if ( !assertion_traits::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::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 diff --git a/headers/tools/cppunit/cppunit/TestCaller.h b/headers/tools/cppunit/cppunit/TestCaller.h index 785301901b..e00734ed67 100644 --- a/headers/tools/cppunit/cppunit/TestCaller.h +++ b/headers/tools/cppunit/cppunit/TestCaller.h @@ -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(); } diff --git a/headers/tools/cppunit/cppunit/TestCase.h b/headers/tools/cppunit/cppunit/TestCase.h index f9cb1d911a..2ba8397709 100644 --- a/headers/tools/cppunit/cppunit/TestCase.h +++ b/headers/tools/cppunit/cppunit/TestCase.h @@ -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 diff --git a/headers/tools/cppunit/cppunit/TestFailure.h b/headers/tools/cppunit/cppunit/TestFailure.h index a610072a68..cbafbec94a 100644 --- a/headers/tools/cppunit/cppunit/TestFailure.h +++ b/headers/tools/cppunit/cppunit/TestFailure.h @@ -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; diff --git a/headers/tools/cppunit/cppunit/TestResult.h b/headers/tools/cppunit/cppunit/TestResult.h index b573cf3b38..c480fcb287 100644 --- a/headers/tools/cppunit/cppunit/TestResult.h +++ b/headers/tools/cppunit/cppunit/TestResult.h @@ -19,7 +19,7 @@ class TestFailure; class TestListener; #if CPPUNIT_NEED_DLL_DECL - template class CPPUNIT_API std::deque; + template class CPPUNIT_API deque; #endif /*! \brief Manages TestListener. @@ -65,7 +65,7 @@ protected: void addFailure( const TestFailure &failure ); protected: - typedef std::deque TestListeners; + typedef deque TestListeners; TestListeners m_listeners; bool m_stop; diff --git a/headers/tools/cppunit/cppunit/TestResultCollector.h b/headers/tools/cppunit/cppunit/TestResultCollector.h index a9cbcfe8da..49da58a27c 100644 --- a/headers/tools/cppunit/cppunit/TestResultCollector.h +++ b/headers/tools/cppunit/cppunit/TestResultCollector.h @@ -17,8 +17,8 @@ namespace CppUnit #if CPPUNIT_NEED_DLL_DECL - template class CPPUNIT_API std::deque; - template class CPPUNIT_API std::deque; + template class CPPUNIT_API deque; + template class CPPUNIT_API deque; #endif @@ -38,8 +38,8 @@ namespace CppUnit class CPPUNIT_API TestResultCollector : public TestSucessListener { public: - typedef std::deque TestFailures; - typedef std::deque Tests; + typedef deque TestFailures; + typedef deque Tests; /*! Constructs a TestResultCollector object. diff --git a/headers/tools/cppunit/cppunit/TestSuite.h b/headers/tools/cppunit/cppunit/TestSuite.h index 3cd77cb853..a0162172b0 100644 --- a/headers/tools/cppunit/cppunit/TestSuite.h +++ b/headers/tools/cppunit/cppunit/TestSuite.h @@ -17,7 +17,7 @@ namespace CppUnit { class TestResult; #if CPPUNIT_NEED_DLL_DECL - template class CPPUNIT_API std::vector; + template class CPPUNIT_API vector; #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 &getTests() const; + const vector &getTests() const; virtual void deleteContents(); @@ -62,8 +62,8 @@ private: TestSuite &operator =( const TestSuite &other ); private: - std::vector m_tests; - const std::string m_name; + vector m_tests; + const string m_name; }; diff --git a/headers/tools/cppunit/cppunit/TextOutputter.h b/headers/tools/cppunit/cppunit/TextOutputter.h index db09575a50..b0e0654f8b 100644 --- a/headers/tools/cppunit/cppunit/TextOutputter.h +++ b/headers/tools/cppunit/cppunit/TextOutputter.h @@ -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. diff --git a/headers/tools/cppunit/cppunit/TextTestResult.h b/headers/tools/cppunit/cppunit/TextTestResult.h index 0453ed8627..ea0007c38c 100644 --- a/headers/tools/cppunit/cppunit/TextTestResult.h +++ b/headers/tools/cppunit/cppunit/TextTestResult.h @@ -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 diff --git a/headers/tools/cppunit/cppunit/XmlOutputter.h b/headers/tools/cppunit/cppunit/XmlOutputter.h index 80fbcee551..3a08af5c7c 100644 --- a/headers/tools/cppunit/cppunit/XmlOutputter.h +++ b/headers/tools/cppunit/cppunit/XmlOutputter.h @@ -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 Attribute; + typedef pair 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 Attributes; + string m_name; + string m_content; + typedef deque Attributes; Attributes m_attributes; - typedef std::deque Nodes; + typedef deque Nodes; Nodes m_nodes; }; @@ -90,7 +90,7 @@ public: virtual void writeProlog(); virtual void writeTestsResult(); - typedef std::map FailedTests; + typedef map 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. diff --git a/headers/tools/cppunit/cppunit/config-auto.h b/headers/tools/cppunit/cppunit/config-auto.h index 1f83a5a2fc..9d3f28a7de 100644 --- a/headers/tools/cppunit/cppunit/config-auto.h +++ b/headers/tools/cppunit/cppunit/config-auto.h @@ -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 diff --git a/headers/tools/cppunit/cppunit/extensions/AutoRegisterSuite.h b/headers/tools/cppunit/cppunit/extensions/AutoRegisterSuite.h index 8af34895a4..abbf79ab48 100644 --- a/headers/tools/cppunit/cppunit/extensions/AutoRegisterSuite.h +++ b/headers/tools/cppunit/cppunit/extensions/AutoRegisterSuite.h @@ -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(); TestFactoryRegistry::getRegistry( name ).registerFactory( factory ); diff --git a/headers/tools/cppunit/cppunit/extensions/HelperMacros.h b/headers/tools/cppunit/cppunit/extensions/HelperMacros.h index 142cd1d7f8..e8ffd1bc9f 100644 --- a/headers/tools/cppunit/cppunit/extensions/HelperMacros.h +++ b/headers/tools/cppunit/cppunit/extensions/HelperMacros.h @@ -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 * 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 v; - * v.at( 1 ); // must throw exception std::invalid_argument + * vector 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"; * } * } diff --git a/headers/tools/cppunit/cppunit/extensions/RepeatedTest.h b/headers/tools/cppunit/cppunit/extensions/RepeatedTest.h index 067fd20da6..2fbe920c34 100644 --- a/headers/tools/cppunit/cppunit/extensions/RepeatedTest.h +++ b/headers/tools/cppunit/cppunit/extensions/RepeatedTest.h @@ -24,7 +24,7 @@ public: void run( TestResult *result ); int countTestCases() const; - std::string toString() const; + string toString() const; private: RepeatedTest( const RepeatedTest & ); diff --git a/headers/tools/cppunit/cppunit/extensions/TestDecorator.h b/headers/tools/cppunit/cppunit/extensions/TestDecorator.h index c3dc34329f..5b4d4fcbdc 100644 --- a/headers/tools/cppunit/cppunit/extensions/TestDecorator.h +++ b/headers/tools/cppunit/cppunit/extensions/TestDecorator.h @@ -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 diff --git a/headers/tools/cppunit/cppunit/extensions/TestFactoryRegistry.h b/headers/tools/cppunit/cppunit/extensions/TestFactoryRegistry.h index 6553fe5742..72a0083ce5 100644 --- a/headers/tools/cppunit/cppunit/extensions/TestFactoryRegistry.h +++ b/headers/tools/cppunit/cppunit/extensions/TestFactoryRegistry.h @@ -17,7 +17,7 @@ namespace CppUnit { class TestSuite; #if CPPUNIT_NEED_DLL_DECL - template class CPPUNIT_API std::map; + template class CPPUNIT_API map; #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 Factories; + typedef map Factories; Factories m_factories; - std::string m_name; + string m_name; }; diff --git a/headers/tools/cppunit/cppunit/extensions/TestSuiteBuilder.h b/headers/tools/cppunit/cppunit/extensions/TestSuiteBuilder.h index 1f3e028747..0217e2d8ca 100644 --- a/headers/tools/cppunit/cppunit/extensions/TestSuiteBuilder.h +++ b/headers/tools/cppunit/cppunit/extensions/TestSuiteBuilder.h @@ -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 - 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 m_suite; + auto_ptr m_suite; }; } // namespace CppUnit diff --git a/headers/tools/cppunit/cppunit/extensions/TypeInfoHelper.h b/headers/tools/cppunit/cppunit/extensions/TypeInfoHelper.h index 5199a705ed..60bfcfc793 100644 --- a/headers/tools/cppunit/cppunit/extensions/TypeInfoHelper.h +++ b/headers/tools/cppunit/cppunit/extensions/TypeInfoHelper.h @@ -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 diff --git a/headers/tools/cppunit/cppunit/ui/text/TestRunner.h b/headers/tools/cppunit/cppunit/ui/text/TestRunner.h index 6bfa6c9d17..999c1d4455 100644 --- a/headers/tools/cppunit/cppunit/ui/text/TestRunner.h +++ b/headers/tools/cppunit/cppunit/ui/text/TestRunner.h @@ -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; diff --git a/src/tools/cppunit/TestCase.cpp b/src/tools/cppunit/TestCase.cpp index 2b9a52082f..6065b56cf4 100644 --- a/src/tools/cppunit/TestCase.cpp +++ b/src/tools/cppunit/TestCase.cpp @@ -4,7 +4,7 @@ #include #include -BTestCase::BTestCase(std::string name) +BTestCase::BTestCase(string name) : CppUnit::TestCase(name) , fValidCWD(false) , fSubTestNum(0) diff --git a/src/tools/cppunit/TestShell.cpp b/src/tools/cppunit/TestShell.cpp index 31247f8c65..bb1244232b 100644 --- a/src/tools/cppunit/TestShell.cpp +++ b/src/tools/cppunit/TestShell.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -20,13 +21,12 @@ #include #include - #include BTestShell *BTestShell::fGlobalShell = NULL; const char BTestShell::indent[] = " "; -BTestShell::BTestShell(const std::string &description, SyncObject *syncObject) +BTestShell::BTestShell(const string &description, SyncObject *syncObject) : fVerbosityLevel(v2) , fTestResults(syncObject) , fDescription(description) @@ -72,7 +72,7 @@ BTestShell::AddSuite(BTestSuite *suite) { } void -BTestShell::AddTest(const std::string &name, CppUnit::Test *test) { +BTestShell::AddTest(const string &name, CppUnit::Test *test) { if (test != NULL) fTests[name] = test; else @@ -153,8 +153,8 @@ BTestShell::Run(int argc, char *argv[]) { suite.addTest( i->second ); } else { - std::set::const_iterator i; - std::set suitesToRemove; + set::const_iterator i; + set suitesToRemove; // Add all the tests from any specified suites to the list of // tests to run (since we use a set, this eliminates the concern @@ -312,7 +312,7 @@ BTestShell::ProcessArguments(int argc, char *argv[]) { // Handle each command line argument (skipping the first // which is just the app name) for (int i = 1; i < argc; i++) { - std::string str(argv[i]); + string str(argv[i]); if (!ProcessArgument(str, argc, argv)) return false; @@ -322,7 +322,7 @@ BTestShell::ProcessArguments(int argc, char *argv[]) { } bool -BTestShell::ProcessArgument(std::string arg, int argc, char *argv[]) { +BTestShell::ProcessArgument(string arg, int argc, char *argv[]) { if (arg == "--help") { PrintDescription(argc, argv); PrintHelp(); @@ -419,7 +419,7 @@ BTestShell::LoadDynamicSuites() { cout << "------------------------------------------------------------------------------" << endl; } - std::set::iterator i; + set::iterator i; for (i = fLibDirs.begin(); i != fLibDirs.end(); i++) { BDirectory libDir((*i).c_str()); if (Verbosity() >= v3) diff --git a/src/tools/cppunit/TestSuite.cpp b/src/tools/cppunit/TestSuite.cpp index dd9f4278ff..b41994bb37 100644 --- a/src/tools/cppunit/TestSuite.cpp +++ b/src/tools/cppunit/TestSuite.cpp @@ -3,7 +3,7 @@ #include // Default constructor -BTestSuite::BTestSuite( std::string name ) +BTestSuite::BTestSuite( string name ) : fName(name) { } @@ -17,7 +17,7 @@ BTestSuite::~BTestSuite() { // Deletes all tests in the suite. void BTestSuite::deleteContents() { - for ( std::map::iterator it = fTests.begin(); + for ( map::iterator it = fTests.begin(); it != fTests.end(); ++it) delete it->second; @@ -28,7 +28,7 @@ BTestSuite::deleteContents() { /// Runs the tests and collects their result in a TestResult. void BTestSuite::run( CppUnit::TestResult *result ) { - for ( std::map::iterator it = fTests.begin(); + for ( map::iterator it = fTests.begin(); it != fTests.end(); ++it ) { @@ -46,7 +46,7 @@ int BTestSuite::countTestCases() const { int count = 0; - for ( std::map::const_iterator it = fTests.begin(); + for ( map::const_iterator it = fTests.begin(); it != fTests.end(); ++it ) count += it->second->countTestCases(); @@ -57,26 +57,26 @@ BTestSuite::countTestCases() const { // Adds a test to the suite. void -BTestSuite::addTest(std::string name, CppUnit::Test *test) { +BTestSuite::addTest(string name, CppUnit::Test *test) { fTests[name] = test; } // Returns a string representation of the test suite. -std::string +string BTestSuite::toString() const { return "suite " + getName(); } // Returns the name of the test suite. -std::string +string BTestSuite::getName() const { return fName; } -const std::map & +const map & BTestSuite::getTests() const { return fTests; } diff --git a/src/tools/cppunit/TestUtils.cpp b/src/tools/cppunit/TestUtils.cpp index 0a2886f566..9112769436 100644 --- a/src/tools/cppunit/TestUtils.cpp +++ b/src/tools/cppunit/TestUtils.cpp @@ -3,12 +3,13 @@ #include #include #include +#include status_t DecodeResult(status_t result) { if (!BTestShell::GlobalBeVerbose()) return result; - std::string str; + string str; switch (result) { case B_OK: @@ -177,10 +178,10 @@ status_t DecodeResult(status_t result) { return result; } -std::string IntToStr(int i) { +string IntToStr(int i) { char num[32]; sprintf(num, "%d", i); - return std::string(num); + return string(num); } void ExecCommand(const char *command) { diff --git a/src/tools/cppunit/ThreadedTestCase.cpp b/src/tools/cppunit/ThreadedTestCase.cpp index 6d19a76fc5..61038c82fb 100644 --- a/src/tools/cppunit/ThreadedTestCase.cpp +++ b/src/tools/cppunit/ThreadedTestCase.cpp @@ -3,7 +3,7 @@ #include #include -BThreadedTestCase::BThreadedTestCase(std::string name, std::string progressSeparator) +BThreadedTestCase::BThreadedTestCase(string name, string progressSeparator) : BTestCase(name) , fProgressSeparator(progressSeparator) , fUpdateLock(new BLocker()) @@ -15,7 +15,7 @@ BThreadedTestCase::~BThreadedTestCase() { delete fUpdateLock; // Clean up - for (std::map::iterator i = fNumberMap.begin(); + for (map::iterator i = fNumberMap.begin(); i != fNumberMap.end(); i++) { @@ -31,13 +31,13 @@ BThreadedTestCase::NextSubTest() { { // Acquire the update lock BAutolock lock(fUpdateLock); - std::map::iterator i = fNumberMap.find(id); + map::iterator i = fNumberMap.find(id); if (i != fNumberMap.end() && i->second) { // Handle multi-threaded case ThreadSubTestInfo *info = i->second; char num[32]; sprintf(num, "%ld", info->subTestNum++); - std::string str = std::string("[") + info->name + fProgressSeparator + num + "]"; + string str = string("[") + info->name + fProgressSeparator + num + "]"; fUpdateList.push_back(str); return; } @@ -72,16 +72,16 @@ BThreadedTestCase::Outputf(const char *str, ...) { { // Acquire the update lock and post our update BAutolock lock(fUpdateLock); - fUpdateList.push_back(std::string(msg)); + fUpdateList.push_back(string(msg)); } } } } void -BThreadedTestCase::InitThreadInfo(thread_id id, std::string threadName) { +BThreadedTestCase::InitThreadInfo(thread_id id, string threadName) { BAutolock lock(fUpdateLock); // Lock the number map - std::map::iterator i = fNumberMap.find(id); + map::iterator i = fNumberMap.find(id); if (i != fNumberMap.end() && i->second) { i->second->name = threadName; i->second->subTestNum = 0; @@ -108,7 +108,7 @@ BThreadedTestCase::UnregisterForUse() { fInUse = false; } -std::vector& +vector& BThreadedTestCase::AcquireUpdateList() { fUpdateLock->Lock(); return fUpdateList; diff --git a/src/tools/cppunit/cppunit/Asserter.cpp b/src/tools/cppunit/cppunit/Asserter.cpp index 29c5201413..552d05a161 100644 --- a/src/tools/cppunit/cppunit/Asserter.cpp +++ b/src/tools/cppunit/cppunit/Asserter.cpp @@ -11,7 +11,7 @@ namespace Asserter void -fail( std::string message, +fail( string message, SourceLine sourceLine ) { throw Exception( message, sourceLine ); @@ -20,7 +20,7 @@ fail( std::string message, void failIf( bool shouldFail, - std::string message, + string message, SourceLine location ) { if ( shouldFail ) @@ -29,10 +29,10 @@ failIf( bool shouldFail, void -failNotEqual( std::string expected, - std::string actual, +failNotEqual( string expected, + string actual, SourceLine sourceLine, - std::string additionalMessage ) + string additionalMessage ) { throw NotEqualException( expected, actual, @@ -43,10 +43,10 @@ failNotEqual( std::string expected, void failNotEqualIf( bool shouldFail, - std::string expected, - std::string actual, + string expected, + string actual, SourceLine sourceLine, - std::string additionalMessage ) + string additionalMessage ) { if ( shouldFail ) failNotEqual( expected, actual, sourceLine, additionalMessage ); diff --git a/src/tools/cppunit/cppunit/CompilerOutputter.cpp b/src/tools/cppunit/cppunit/CompilerOutputter.cpp index 4e03334874..3e976865d7 100644 --- a/src/tools/cppunit/cppunit/CompilerOutputter.cpp +++ b/src/tools/cppunit/cppunit/CompilerOutputter.cpp @@ -10,7 +10,7 @@ namespace CppUnit { CompilerOutputter::CompilerOutputter( TestResultCollector *result, - std::ostream &stream ) : + ostream &stream ) : m_result( result ), m_stream( stream ) { @@ -24,7 +24,7 @@ CompilerOutputter::~CompilerOutputter() CompilerOutputter * CompilerOutputter::defaultOutputter( TestResultCollector *result, - std::ostream &stream ) + ostream &stream ) { return new CompilerOutputter( result, stream ); // For automatic adpatation... @@ -46,7 +46,7 @@ void CompilerOutputter::printSucess() { m_stream << "OK (" << m_result->runTests() << ")" - << std::endl; + << endl; } @@ -99,7 +99,7 @@ CompilerOutputter::printFailureType( TestFailure *failure ) void CompilerOutputter::printFailedTestName( TestFailure *failure ) { - m_stream << std::endl; + m_stream << endl; m_stream << "Test name: " << failure->failedTestName(); } @@ -107,13 +107,13 @@ CompilerOutputter::printFailedTestName( TestFailure *failure ) void CompilerOutputter::printFailureMessage( TestFailure *failure ) { - m_stream << std::endl; + m_stream << endl; Exception *thrownException = failure->thrownException(); if ( thrownException->isInstanceOf( NotEqualException::type() ) ) printNotEqualMessage( thrownException ); else printDefaultMessage( thrownException ); - m_stream << std::endl; + m_stream << endl; } @@ -122,13 +122,13 @@ CompilerOutputter::printNotEqualMessage( Exception *thrownException ) { NotEqualException *e = (NotEqualException *)thrownException; m_stream << wrap( "- Expected : " + e->expectedValue() ); - m_stream << std::endl; + m_stream << endl; m_stream << wrap( "- Actual : " + e->actualValue() ); - m_stream << std::endl; + m_stream << endl; if ( !e->additionalMessage().empty() ) { m_stream << wrap( e->additionalMessage() ); - m_stream << std::endl; + m_stream << endl; } } @@ -136,36 +136,36 @@ CompilerOutputter::printNotEqualMessage( Exception *thrownException ) void CompilerOutputter::printDefaultMessage( Exception *thrownException ) { - std::string wrappedMessage = wrap( thrownException->what() ); - m_stream << wrappedMessage << std::endl; + string wrappedMessage = wrap( thrownException->what() ); + m_stream << wrappedMessage << endl; } void CompilerOutputter::printStatistics() { - m_stream << "Failures !!!" << std::endl; + m_stream << "Failures !!!" << endl; m_stream << "Run: " << m_result->runTests() << " " << "Failure total: " << m_result->testFailuresTotal() << " " << "Failures: " << m_result->testFailures() << " " << "Errors: " << m_result->testErrors() - << std::endl; + << endl; } -std::string -CompilerOutputter::wrap( std::string message ) +string +CompilerOutputter::wrap( string message ) { Lines lines = splitMessageIntoLines( message ); - std::string wrapped; + string wrapped; for ( Lines::iterator it = lines.begin(); it != lines.end(); ++it ) { - std::string line( *it ); + string line( *it ); const int maxLineLength = 80; int index =0; while ( index < (int)line.length() ) { - std::string line( line.substr( index, maxLineLength ) ); + string line( line.substr( index, maxLineLength ) ); wrapped += line; index += maxLineLength; if ( index < (int)line.length() ) @@ -178,14 +178,14 @@ CompilerOutputter::wrap( std::string message ) CompilerOutputter::Lines -CompilerOutputter::splitMessageIntoLines( std::string message ) +CompilerOutputter::splitMessageIntoLines( string message ) { Lines lines; - std::string::iterator itStart = message.begin(); + string::iterator itStart = message.begin(); while ( true ) { - std::string::iterator itEol = std::find( itStart, + string::iterator itEol = find( itStart, message.end(), '\n' ); lines.push_back( message.substr( itStart - message.begin(), diff --git a/src/tools/cppunit/cppunit/Exception.cpp b/src/tools/cppunit/cppunit/Exception.cpp index add261adbd..a3a7eead9d 100644 --- a/src/tools/cppunit/cppunit/Exception.cpp +++ b/src/tools/cppunit/cppunit/Exception.cpp @@ -8,7 +8,7 @@ namespace CppUnit { /*! * \deprecated Use SourceLine::isValid() instead. */ -const std::string Exception::UNKNOWNFILENAME = ""; +const string Exception::UNKNOWNFILENAME = ""; /*! * \deprecated Use SourceLine::isValid() instead. @@ -19,7 +19,7 @@ const long Exception::UNKNOWNLINENUMBER = -1; /// Construct the exception Exception::Exception( const Exception &other ) : - std::exception( other ) + exception( other ) { m_message = other.m_message; m_sourceLine = other.m_sourceLine; @@ -29,7 +29,7 @@ Exception::Exception( const Exception &other ) : /*! * \deprecated Use other constructor instead. */ -Exception::Exception( std::string message, +Exception::Exception( string message, SourceLine sourceLine ) : m_message( message ), m_sourceLine( sourceLine ) @@ -41,9 +41,9 @@ Exception::Exception( std::string message, /*! * \deprecated Use other constructor instead. */ -Exception::Exception( std::string message, +Exception::Exception( string message, long lineNumber, - std::string fileName ) : + string fileName ) : m_message( message ), m_sourceLine( fileName, lineNumber ) { @@ -63,7 +63,7 @@ Exception::operator =( const Exception& other ) { // Don't call superclass operator =(). VC++ STL implementation // has a bug. It calls the destructor and copy constructor of -// std::exception() which reset the virtual table to std::exception. +// exception() which reset the virtual table to exception. // SuperClass::operator =(other); if ( &other != this ) @@ -102,7 +102,7 @@ Exception::lineNumber() const /// The file in which the error occurred -std::string +string Exception::fileName() const { return m_sourceLine.isValid() ? m_sourceLine.fileName() : diff --git a/src/tools/cppunit/cppunit/NotEqualException.cpp b/src/tools/cppunit/cppunit/NotEqualException.cpp index 738961d64f..9709d5df8e 100644 --- a/src/tools/cppunit/cppunit/NotEqualException.cpp +++ b/src/tools/cppunit/cppunit/NotEqualException.cpp @@ -3,10 +3,10 @@ namespace CppUnit { -NotEqualException::NotEqualException( std::string expected, - std::string actual, +NotEqualException::NotEqualException( string expected, + string actual, SourceLine sourceLine , - std::string additionalMessage ) : + string additionalMessage ) : Exception( "Expected: " + expected + ", but was: " + actual + "." + additionalMessage , @@ -22,10 +22,10 @@ NotEqualException::NotEqualException( std::string expected, /*! * \deprecated Use other constructor instead. */ -NotEqualException::NotEqualException( std::string expected, - std::string actual, +NotEqualException::NotEqualException( string expected, + string actual, long lineNumber, - std::string fileName ) : + string fileName ) : Exception( "Expected: " + expected + ", but was: " + actual, lineNumber, fileName ), @@ -87,21 +87,21 @@ NotEqualException::type() } -std::string +string NotEqualException::expectedValue() const { return m_expected; } -std::string +string NotEqualException::actualValue() const { return m_actual; } -std::string +string NotEqualException::additionalMessage() const { return m_additionalMessage; diff --git a/src/tools/cppunit/cppunit/RepeatedTest.cpp b/src/tools/cppunit/cppunit/RepeatedTest.cpp index bfe1f72510..f8d68fccee 100644 --- a/src/tools/cppunit/cppunit/RepeatedTest.cpp +++ b/src/tools/cppunit/cppunit/RepeatedTest.cpp @@ -14,7 +14,7 @@ RepeatedTest::countTestCases() const // Returns the name of the test instance. -std::string +string RepeatedTest::toString() const { return TestDecorator::toString () + " (repeated)"; diff --git a/src/tools/cppunit/cppunit/SourceLine.cpp b/src/tools/cppunit/cppunit/SourceLine.cpp index feb356e7cb..bd12d8a8e2 100644 --- a/src/tools/cppunit/cppunit/SourceLine.cpp +++ b/src/tools/cppunit/cppunit/SourceLine.cpp @@ -10,7 +10,7 @@ SourceLine::SourceLine() : } -SourceLine::SourceLine( const std::string &fileName, +SourceLine::SourceLine( const string &fileName, int lineNumber ) : m_fileName( fileName ), m_lineNumber( lineNumber ) @@ -37,7 +37,7 @@ SourceLine::lineNumber() const } -std::string +string SourceLine::fileName() const { return m_fileName; diff --git a/src/tools/cppunit/cppunit/TestAssert.cpp b/src/tools/cppunit/cppunit/TestAssert.cpp index b5999e1ec8..d64ca05102 100644 --- a/src/tools/cppunit/cppunit/TestAssert.cpp +++ b/src/tools/cppunit/cppunit/TestAssert.cpp @@ -15,9 +15,9 @@ namespace CppUnit { /// Check for a failed general assertion void TestAssert::assertImplementation( bool condition, - std::string conditionExpression, + string conditionExpression, long lineNumber, - std::string fileName ) + string fileName ) { Asserter::failIf( condition, conditionExpression, @@ -27,10 +27,10 @@ TestAssert::assertImplementation( bool condition, /// Reports failed equality void -TestAssert::assertNotEqualImplementation( std::string expected, - std::string actual, +TestAssert::assertNotEqualImplementation( string expected, + string actual, long lineNumber, - std::string fileName ) + string fileName ) { Asserter::failNotEqual( expected, actual, @@ -44,7 +44,7 @@ TestAssert::assertEquals( double expected, double actual, double delta, long lineNumber, - std::string fileName ) + string fileName ) { if (fabs (expected - actual) > delta) assertNotEqualImplementation( assertion_traits::toString(expected), diff --git a/src/tools/cppunit/cppunit/TestCase.cpp b/src/tools/cppunit/cppunit/TestCase.cpp index b2edb90a75..3394a113b3 100644 --- a/src/tools/cppunit/cppunit/TestCase.cpp +++ b/src/tools/cppunit/cppunit/TestCase.cpp @@ -33,7 +33,7 @@ TestCase::run( TestResult *result ) Exception *copy = e.clone(); result->addFailure( this, copy ); } - catch ( std::exception &e ) { + catch ( exception &e ) { result->addError( this, new Exception( e.what() ) ); } catch (...) { @@ -77,7 +77,7 @@ TestCase::runTest() /** Constructs a test case. * \param name the name of the TestCase. **/ -TestCase::TestCase( std::string name ) +TestCase::TestCase( string name ) : m_name(name) { } @@ -108,7 +108,7 @@ TestCase::countTestCases() const /// Returns the name of the test case -std::string +string TestCase::getName() const { return m_name; @@ -116,13 +116,13 @@ TestCase::getName() const /// Returns the name of the test case instance -std::string +string TestCase::toString() const { - std::string className; + string className; #if CPPUNIT_USE_TYPEINFO_NAME - const std::type_info& thisClass = typeid( *this ); + const type_info& thisClass = typeid( *this ); className = thisClass.name(); #else className = "TestCase"; diff --git a/src/tools/cppunit/cppunit/TestFactoryRegistry.cpp b/src/tools/cppunit/cppunit/TestFactoryRegistry.cpp index d46ff29b6c..f3b98e2624 100644 --- a/src/tools/cppunit/cppunit/TestFactoryRegistry.cpp +++ b/src/tools/cppunit/cppunit/TestFactoryRegistry.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #if CPPUNIT_USE_TYPEINFO_NAME @@ -26,17 +27,17 @@ public: static NamedRegistries &getInstance(); - TestFactoryRegistry &getRegistry( std::string name ); + TestFactoryRegistry &getRegistry( string name ); void wasDestroyed( TestFactory *factory ); bool needDestroy( TestFactory *factory ); private: - typedef std::map Registries; + typedef map Registries; Registries m_registries; - typedef std::set Factories; + typedef set Factories; Factories m_factoriesToDestroy; Factories m_destroyedFactories; }; @@ -63,13 +64,24 @@ NamedRegistries::getInstance() TestFactoryRegistry & -NamedRegistries::getRegistry( std::string name ) +NamedRegistries::getRegistry( string name ) { Registries::const_iterator foundIt = m_registries.find( name ); if ( foundIt == m_registries.end() ) { TestFactoryRegistry *factory = new TestFactoryRegistry( name ); +#if defined(__POWERPC__) && defined(__BEOS__) + m_registries.insert( + pair< + const basic_string< char, char_traits< char>, allocator >, + CppUnit::TestFactoryRegistry* + >( + name, factory + ) + ); +#else m_registries.insert( std::make_pair( name, factory ) ); +#endif m_factoriesToDestroy.insert( factory ); return *factory; } @@ -93,7 +105,7 @@ NamedRegistries::needDestroy( TestFactory *factory ) -TestFactoryRegistry::TestFactoryRegistry( std::string name ) : +TestFactoryRegistry::TestFactoryRegistry( string name ) : m_name( name ) { } @@ -125,14 +137,14 @@ TestFactoryRegistry::getRegistry() TestFactoryRegistry & -TestFactoryRegistry::getRegistry( const std::string &name ) +TestFactoryRegistry::getRegistry( const string &name ) { return NamedRegistries::getInstance().getRegistry( name ); } void -TestFactoryRegistry::registerFactory( const std::string &name, +TestFactoryRegistry::registerFactory( const string &name, TestFactory *factory ) { m_factories[name] = factory; diff --git a/src/tools/cppunit/cppunit/TestFailure.cpp b/src/tools/cppunit/cppunit/TestFailure.cpp index 84044271d4..17b9d9c762 100644 --- a/src/tools/cppunit/cppunit/TestFailure.cpp +++ b/src/tools/cppunit/cppunit/TestFailure.cpp @@ -53,7 +53,7 @@ TestFailure::isError() const /// Gets the name of the failed test. -std::string +string TestFailure::failedTestName() const { return m_failedTest->getName(); @@ -61,7 +61,7 @@ TestFailure::failedTestName() const /// Returns a short description of the failure. -std::string +string TestFailure::toString() const { return m_failedTest->toString() + ": " + m_thrownException->what(); diff --git a/src/tools/cppunit/cppunit/TestResult.cpp b/src/tools/cppunit/cppunit/TestResult.cpp index d5644a49f4..8f1206f660 100644 --- a/src/tools/cppunit/cppunit/TestResult.cpp +++ b/src/tools/cppunit/cppunit/TestResult.cpp @@ -120,7 +120,7 @@ void TestResult::removeListener ( TestListener *listener ) { ExclusiveZone zone( m_syncObject ); - m_listeners.erase( std::remove( m_listeners.begin(), + m_listeners.erase( remove( m_listeners.begin(), m_listeners.end(), listener ), m_listeners.end()); diff --git a/src/tools/cppunit/cppunit/TestRunner.cpp b/src/tools/cppunit/cppunit/TestRunner.cpp index f6b210c8e6..818ba02f89 100644 --- a/src/tools/cppunit/cppunit/TestRunner.cpp +++ b/src/tools/cppunit/cppunit/TestRunner.cpp @@ -20,7 +20,7 @@ TestRunner::TestRunner( Outputter *outputter ) , m_outputter( outputter ) { if ( !m_outputter ) - m_outputter = new TextOutputter( m_result, std::cout ); + m_outputter = new TextOutputter( m_result, cout ); m_eventManager->addListener( m_result ); } @@ -61,7 +61,7 @@ TestRunner::addTest( Test *test ) * failed or was not found. */ bool -TestRunner::run( std::string testName, +TestRunner::run( string testName, bool doWait, bool doPrintResult, bool doPrintProgress ) @@ -74,7 +74,7 @@ TestRunner::run( std::string testName, bool -TestRunner::runTestByName( std::string testName, +TestRunner::runTestByName( string testName, bool doPrintProgress ) { if ( testName.empty() ) @@ -84,7 +84,7 @@ TestRunner::runTestByName( std::string testName, if ( test != NULL ) return runTest( test, doPrintProgress ); - std::cout << "Test " << testName << " not found." << std::endl; + cout << "Test " << testName << " not found." << endl; return false; } @@ -94,8 +94,8 @@ TestRunner::wait( bool doWait ) { if ( doWait ) { - std::cout << " to continue" << std::endl; - std::cin.get (); + cout << " to continue" << endl; + cin.get (); } } @@ -103,16 +103,16 @@ TestRunner::wait( bool doWait ) void TestRunner::printResult( bool doPrintResult ) { - std::cout << std::endl; + cout << endl; if ( doPrintResult ) m_outputter->write(); } Test * -TestRunner::findTestByName( std::string name ) const +TestRunner::findTestByName( string name ) const { - for ( std::vector::const_iterator it = m_suite->getTests().begin(); + for ( vector::const_iterator it = m_suite->getTests().begin(); it != m_suite->getTests().end(); ++it ) { diff --git a/src/tools/cppunit/cppunit/TestSuite.cpp b/src/tools/cppunit/cppunit/TestSuite.cpp index 7659939d2d..057e7e5b44 100644 --- a/src/tools/cppunit/cppunit/TestSuite.cpp +++ b/src/tools/cppunit/cppunit/TestSuite.cpp @@ -4,7 +4,7 @@ namespace CppUnit { /// Default constructor -TestSuite::TestSuite( std::string name ) +TestSuite::TestSuite( string name ) : m_name( name ) { } @@ -21,7 +21,7 @@ TestSuite::~TestSuite() void TestSuite::deleteContents() { - for ( std::vector::iterator it = m_tests.begin(); + for ( vector::iterator it = m_tests.begin(); it != m_tests.end(); ++it) delete *it; @@ -33,7 +33,7 @@ TestSuite::deleteContents() void TestSuite::run( TestResult *result ) { - for ( std::vector::iterator it = m_tests.begin(); + for ( vector::iterator it = m_tests.begin(); it != m_tests.end(); ++it ) { @@ -52,7 +52,7 @@ TestSuite::countTestCases() const { int count = 0; - for ( std::vector::const_iterator it = m_tests.begin(); + for ( vector::const_iterator it = m_tests.begin(); it != m_tests.end(); ++it ) count += (*it)->countTestCases(); @@ -70,7 +70,7 @@ TestSuite::addTest( Test *test ) /// Returns a string representation of the test suite. -std::string +string TestSuite::toString() const { return "suite " + getName(); @@ -78,14 +78,14 @@ TestSuite::toString() const /// Returns the name of the test suite. -std::string +string TestSuite::getName() const { return m_name; } -const std::vector & +const vector & TestSuite::getTests() const { return m_tests; diff --git a/src/tools/cppunit/cppunit/TextOutputter.cpp b/src/tools/cppunit/cppunit/TextOutputter.cpp index fc32598ffc..edee2a838d 100644 --- a/src/tools/cppunit/cppunit/TextOutputter.cpp +++ b/src/tools/cppunit/cppunit/TextOutputter.cpp @@ -10,7 +10,7 @@ namespace CppUnit TextOutputter::TextOutputter( TestResultCollector *result, - std::ostream &stream ) + ostream &stream ) : m_result( result ) , m_stream( stream ) { @@ -26,9 +26,9 @@ void TextOutputter::write() { printHeader(); - m_stream << std::endl; + m_stream << endl; printFailures(); - m_stream << std::endl; + m_stream << endl; } @@ -39,7 +39,7 @@ TextOutputter::printFailures() int failureNumber = 1; while ( itFailure != m_result->failures().end() ) { - m_stream << std::endl; + m_stream << endl; printFailure( *itFailure++, failureNumber++ ); } } @@ -56,9 +56,9 @@ TextOutputter::printFailure( TestFailure *failure, printFailureType( failure ); m_stream << ' '; printFailureLocation( failure->sourceLine() ); - m_stream << std::endl; + m_stream << endl; printFailureDetail( failure->thrownException() ); - m_stream << std::endl; + m_stream << endl; } @@ -102,12 +102,12 @@ TextOutputter::printFailureDetail( Exception *thrownException ) if ( thrownException->isInstanceOf( NotEqualException::type() ) ) { NotEqualException *e = (NotEqualException*)thrownException; - m_stream << "expected: " << e->expectedValue() << std::endl + m_stream << "expected: " << e->expectedValue() << endl << "but was: " << e->actualValue(); if ( !e->additionalMessage().empty() ) { - m_stream << std::endl; - m_stream << "additional message:" << std::endl + m_stream << endl; + m_stream << "additional message:" << endl << e->additionalMessage(); } } @@ -122,11 +122,11 @@ void TextOutputter::printHeader() { if ( m_result->wasSuccessful() ) - m_stream << std::endl << "OK (" << m_result->runTests () << " tests)" - << std::endl; + m_stream << endl << "OK (" << m_result->runTests () << " tests)" + << endl; else { - m_stream << std::endl; + m_stream << endl; printFailureWarning(); printStatistics(); } @@ -136,19 +136,19 @@ TextOutputter::printHeader() void TextOutputter::printFailureWarning() { - m_stream << "!!!FAILURES!!!" << std::endl; + m_stream << "!!!FAILURES!!!" << endl; } void TextOutputter::printStatistics() { - m_stream << "Test Results:" << std::endl; + m_stream << "Test Results:" << endl; m_stream << "Run: " << m_result->runTests() << " Failures: " << m_result->testFailures() << " Errors: " << m_result->testErrors() - << std::endl; + << endl; } diff --git a/src/tools/cppunit/cppunit/TextTestProgressListener.cpp b/src/tools/cppunit/cppunit/TextTestProgressListener.cpp index bd86ddf59d..71e1bcf44f 100644 --- a/src/tools/cppunit/cppunit/TextTestProgressListener.cpp +++ b/src/tools/cppunit/cppunit/TextTestProgressListener.cpp @@ -20,24 +20,24 @@ TextTestProgressListener::~TextTestProgressListener() void TextTestProgressListener::startTest( Test *test ) { - std::cerr << "."; - std::cerr.flush(); + cerr << "."; + cerr.flush(); } void TextTestProgressListener::addFailure( const TestFailure &failure ) { - std::cerr << ( failure.isError() ? "E" : "F" ); - std::cerr.flush(); + cerr << ( failure.isError() ? "E" : "F" ); + cerr.flush(); } void TextTestProgressListener::done() { - std::cerr << std::endl; - std::cerr.flush(); + cerr << endl; + cerr.flush(); } } // namespace CppUnit diff --git a/src/tools/cppunit/cppunit/TextTestResult.cpp b/src/tools/cppunit/cppunit/TextTestResult.cpp index 1fdc55a188..2ada378c87 100644 --- a/src/tools/cppunit/cppunit/TextTestResult.cpp +++ b/src/tools/cppunit/cppunit/TextTestResult.cpp @@ -26,7 +26,7 @@ void TextTestResult::addFailure( const TestFailure &failure ) { TestResultCollector::addFailure( failure ); - std::cerr << ( failure.isError() ? "E" : "F" ); + cerr << ( failure.isError() ? "E" : "F" ); } @@ -34,18 +34,18 @@ void TextTestResult::startTest( Test *test ) { TestResultCollector::startTest (test); - std::cerr << "."; + cerr << "."; } void -TextTestResult::printFailures( std::ostream &stream ) +TextTestResult::printFailures( ostream &stream ) { TestFailures::const_iterator itFailure = failures().begin(); int failureNumber = 1; while ( itFailure != failures().end() ) { - stream << std::endl; + stream << endl; printFailure( *itFailure++, failureNumber++, stream ); } } @@ -54,7 +54,7 @@ TextTestResult::printFailures( std::ostream &stream ) void TextTestResult::printFailure( TestFailure *failure, int failureNumber, - std::ostream &stream ) + ostream &stream ) { printFailureListMark( failureNumber, stream ); stream << ' '; @@ -63,15 +63,15 @@ TextTestResult::printFailure( TestFailure *failure, printFailureType( failure, stream ); stream << ' '; printFailureLocation( failure->sourceLine(), stream ); - stream << std::endl; + stream << endl; printFailureDetail( failure->thrownException(), stream ); - stream << std::endl; + stream << endl; } void TextTestResult::printFailureListMark( int failureNumber, - std::ostream &stream ) + ostream &stream ) { stream << failureNumber << ")"; } @@ -79,7 +79,7 @@ TextTestResult::printFailureListMark( int failureNumber, void TextTestResult::printFailureTestName( TestFailure *failure, - std::ostream &stream ) + ostream &stream ) { stream << "test: " << failure->failedTest()->getName(); } @@ -87,7 +87,7 @@ TextTestResult::printFailureTestName( TestFailure *failure, void TextTestResult::printFailureType( TestFailure *failure, - std::ostream &stream ) + ostream &stream ) { stream << "(" << (failure->isError() ? "E" : "F") @@ -97,7 +97,7 @@ TextTestResult::printFailureType( TestFailure *failure, void TextTestResult::printFailureLocation( SourceLine sourceLine, - std::ostream &stream ) + ostream &stream ) { if ( !sourceLine.isValid() ) return; @@ -109,17 +109,17 @@ TextTestResult::printFailureLocation( SourceLine sourceLine, void TextTestResult::printFailureDetail( Exception *thrownException, - std::ostream &stream ) + ostream &stream ) { if ( thrownException->isInstanceOf( NotEqualException::type() ) ) { NotEqualException *e = (NotEqualException*)thrownException; - stream << "expected: " << e->expectedValue() << std::endl + stream << "expected: " << e->expectedValue() << endl << "but was: " << e->actualValue(); if ( !e->additionalMessage().empty() ) { - stream << std::endl; - stream << "additional message:" << std::endl + stream << endl; + stream << "additional message:" << endl << e->additionalMessage(); } } @@ -131,23 +131,23 @@ TextTestResult::printFailureDetail( Exception *thrownException, void -TextTestResult::print( std::ostream& stream ) +TextTestResult::print( ostream& stream ) { printHeader( stream ); - stream << std::endl; + stream << endl; printFailures( stream ); } void -TextTestResult::printHeader( std::ostream &stream ) +TextTestResult::printHeader( ostream &stream ) { if (wasSuccessful ()) - stream << std::endl << "OK (" << runTests () << " tests)" - << std::endl; + stream << endl << "OK (" << runTests () << " tests)" + << endl; else { - stream << std::endl; + stream << endl; printFailureWarning( stream ); printStatistics( stream ); } @@ -155,26 +155,26 @@ TextTestResult::printHeader( std::ostream &stream ) void -TextTestResult::printFailureWarning( std::ostream &stream ) +TextTestResult::printFailureWarning( ostream &stream ) { - stream << "!!!FAILURES!!!" << std::endl; + stream << "!!!FAILURES!!!" << endl; } void -TextTestResult::printStatistics( std::ostream &stream ) +TextTestResult::printStatistics( ostream &stream ) { - stream << "Test Results:" << std::endl; + stream << "Test Results:" << endl; stream << "Run: " << runTests() << " Failures: " << testFailures() << " Errors: " << testErrors() - << std::endl; + << endl; } -std::ostream & -operator <<( std::ostream &stream, +ostream & +operator <<( ostream &stream, TextTestResult &result ) { result.print (stream); return stream; diff --git a/src/tools/cppunit/cppunit/TypeInfoHelper.cpp b/src/tools/cppunit/cppunit/TypeInfoHelper.cpp index cf0a8c1031..e8318835fa 100644 --- a/src/tools/cppunit/cppunit/TypeInfoHelper.cpp +++ b/src/tools/cppunit/cppunit/TypeInfoHelper.cpp @@ -8,11 +8,11 @@ namespace CppUnit { -std::string -TypeInfoHelper::getClassName( const std::type_info &info ) +string +TypeInfoHelper::getClassName( const type_info &info ) { - static std::string classPrefix( "class " ); - std::string name( info.name() ); + static const string classPrefix( "class " ); + string name( info.name() ); bool has_class_prefix = 0 == #if CPPUNIT_FUNC_STRING_COMPARE_STRING_FIRST diff --git a/src/tools/cppunit/cppunit/XmlOutputter.cpp b/src/tools/cppunit/cppunit/XmlOutputter.cpp index 9a3c5ca9d3..8a480d058d 100644 --- a/src/tools/cppunit/cppunit/XmlOutputter.cpp +++ b/src/tools/cppunit/cppunit/XmlOutputter.cpp @@ -14,15 +14,15 @@ namespace CppUnit // ////////////////////////////////////////////////////////////////// -XmlOutputter::Node::Node( std::string elementName, - std::string content ) : +XmlOutputter::Node::Node( string elementName, + string content ) : m_name( elementName ), m_content( content ) { } -XmlOutputter::Node::Node( std::string elementName, +XmlOutputter::Node::Node( string elementName, int numericContent ) : m_name( elementName ) { @@ -39,15 +39,15 @@ XmlOutputter::Node::~Node() void -XmlOutputter::Node::addAttribute( std::string attributeName, - std::string value ) +XmlOutputter::Node::addAttribute( string attributeName, + string value ) { m_attributes.push_back( Attribute( attributeName, value ) ); } void -XmlOutputter::Node::addAttribute( std::string attributeName, +XmlOutputter::Node::addAttribute( string attributeName, int numericValue ) { addAttribute( attributeName, asString( numericValue ) ); @@ -61,10 +61,10 @@ XmlOutputter::Node::addNode( Node *node ) } -std::string +string XmlOutputter::Node::toString() const { - std::string element = "<"; + string element = "<"; element += m_name; element += " "; element += attributesAsString(); @@ -87,10 +87,10 @@ XmlOutputter::Node::toString() const } -std::string +string XmlOutputter::Node::attributesAsString() const { - std::string attributes; + string attributes; Attributes::const_iterator itAttribute = m_attributes.begin(); while ( itAttribute != m_attributes.end() ) { @@ -104,10 +104,10 @@ XmlOutputter::Node::attributesAsString() const } -std::string -XmlOutputter::Node::escape( std::string value ) const +string +XmlOutputter::Node::escape( string value ) const { - std::string escaped; + string escaped; for ( int index =0; index < (int)value.length(); ++index ) { char c = value[index ]; @@ -137,7 +137,7 @@ XmlOutputter::Node::escape( std::string value ) const } // should be somewhere else... Future CppUnit::String ? -std::string +string XmlOutputter::Node::asString( int value ) { OStringStream stream; @@ -152,8 +152,8 @@ XmlOutputter::Node::asString( int value ) // ////////////////////////////////////////////////////////////////// XmlOutputter::XmlOutputter( TestResultCollector *result, - std::ostream &stream, - std::string encoding ) : + ostream &stream, + string encoding ) : m_result( result ), m_stream( stream ), m_encoding( encoding ) @@ -179,7 +179,7 @@ XmlOutputter::writeProlog() { m_stream << "" - << std::endl; + << endl; } @@ -216,7 +216,12 @@ XmlOutputter::fillFailedTestsMap( FailedTests &failedTests ) while ( itFailure != failures.end() ) { TestFailure *failure = *itFailure++; - failedTests.insert( std::make_pair(failure->failedTest(), failure ) ); + failedTests.insert( + pair< CppUnit::Test* const, CppUnit::TestFailure* + >( + failure->failedTest(), failure + ) + ); } }