* fix gcc4 build of cppunit library by explicitly spelling out std:: in

the headers and importing the required classes in the implementation files
* automatic whitespace cleanup

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30586 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2009-05-02 19:04:52 +00:00
parent 226136446a
commit 58481f0f6e
50 changed files with 683 additions and 605 deletions
+34 -34
View File
@@ -33,18 +33,18 @@ struct ExpectedExceptionTraits
static void expectedException()
{
#if CPPUNIT_USE_TYPEINFO_NAME
string message( "Expected exception of type " );
std::string message( "Expected exception of type " );
message += TypeInfoHelper::getClassName( typeid( ExceptionType ) );
message += ", but got none";
#else
string message( "Expected exception but got none" );
std::string message( "Expected exception but got none" );
#endif
throw Exception( message );
}
};
/*! \brief (Implementation) Traits specialization used by TestCaller to
/*! \brief (Implementation) Traits specialization used by TestCaller to
* expect no exception.
*
* This class is an implementation detail. You should never use this class directly.
@@ -65,13 +65,13 @@ struct ExpectedExceptionTraits<NoExceptionExpected>
/*! \brief Generate a test case from a fixture method.
* \ingroup WritingTestFixture
*
* A test caller provides access to a test case method
* on a test fixture class. Test callers are useful when
* you want to run an individual test or add it to a
* A test caller provides access to a test case method
* on a test fixture class. Test callers are useful when
* you want to run an individual test or add it to a
* suite.
* Test Callers invoke only one Test (i.e. test method) on one
* Test Callers invoke only one Test (i.e. test method) on one
* Fixture of a TestFixture.
*
*
* Here is an example:
* \code
* class MathTest : public CppUnit::TestFixture {
@@ -94,16 +94,16 @@ struct ExpectedExceptionTraits<NoExceptionExpected>
*
* You can use a TestCaller to bind any test method on a TestFixture
* class, as long as it accepts void and returns void.
*
*
* \see TestCase
*/
template <typename Fixture,
template <typename Fixture,
typename ExpectedException = NoExceptionExpected>
class TestCaller : public TestCase
{
{
typedef void (Fixture::*TestMethod)();
public:
/*!
* Constructor for TestCaller. This constructor builds a new Fixture
@@ -111,8 +111,8 @@ public:
* \param name name of this TestCaller
* \param test the method this TestCaller calls in runTest()
*/
TestCaller( string name, TestMethod test ) :
TestCase( name ),
TestCaller( std::string name, TestMethod test ) :
TestCase( name ),
m_ownFixture( true ),
m_fixture( new Fixture() ),
m_test( test )
@@ -120,7 +120,7 @@ public:
}
/*!
* Constructor for TestCaller.
* Constructor for TestCaller.
* This constructor does not create a new Fixture instance but accepts
* an existing one as parameter. The TestCaller will not own the
* Fixture object.
@@ -128,16 +128,16 @@ public:
* \param test the method this TestCaller calls in runTest()
* \param fixture the Fixture to invoke the test method on.
*/
TestCaller(string name, TestMethod test, Fixture& fixture) :
TestCase( name ),
TestCaller(std::string name, TestMethod test, Fixture& fixture) :
TestCase( name ),
m_ownFixture( false ),
m_fixture( &fixture ),
m_test( test )
{
}
/*!
* Constructor for TestCaller.
* Constructor for TestCaller.
* This constructor does not create a new Fixture instance but accepts
* an existing one as parameter. The TestCaller will own the
* Fixture object and delete it in its destructor.
@@ -145,15 +145,15 @@ public:
* \param test the method this TestCaller calls in runTest()
* \param fixture the Fixture to invoke the test method on.
*/
TestCaller(string name, TestMethod test, Fixture* fixture) :
TestCase( name ),
TestCaller(std::string name, TestMethod test, Fixture* fixture) :
TestCase( name ),
m_ownFixture( true ),
m_fixture( fixture ),
m_test( test )
{
}
~TestCaller()
~TestCaller()
{
if (m_ownFixture)
delete m_fixture;
@@ -161,7 +161,7 @@ public:
protected:
void runTest()
{
{
try {
(m_fixture->*m_test)();
}
@@ -170,25 +170,25 @@ protected:
}
ExpectedExceptionTraits<ExpectedException>::expectedException();
}
}
void setUp()
{
m_fixture->setUp ();
{
m_fixture->setUp ();
}
void tearDown()
{
m_fixture->tearDown ();
{
m_fixture->tearDown ();
}
string toString() const
{
return "TestCaller " + getName();
std::string toString() const
{
return "TestCaller " + getName();
}
private:
TestCaller( const TestCaller &other );
private:
TestCaller( const TestCaller &other );
TestCaller &operator =( const TestCaller &other );
private: