summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-02-11 12:14:00 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-02-11 12:14:00 (GMT)
commit0efa7c32aaf21a29b42b5926cc116007056843be (patch)
tree882f663a5dd0e65694bf6077b71086dd77fd7ff8 /3rdParty/CppUnit/src/TestCase.cpp
parent1d20eabbc32274b491b4c2bedf73d19933d97bfd (diff)
downloadswift-0efa7c32aaf21a29b42b5926cc116007056843be.zip
swift-0efa7c32aaf21a29b42b5926cc116007056843be.tar.bz2
Moved some modules into separate git modules.
Diffstat (limited to '3rdParty/CppUnit/src/TestCase.cpp')
m---------3rdParty/CppUnit0
-rw-r--r--3rdParty/CppUnit/src/TestCase.cpp137
2 files changed, 0 insertions, 137 deletions
diff --git a/3rdParty/CppUnit b/3rdParty/CppUnit
new file mode 160000
+Subproject b4c34eb947c6497c6387c55c7581ec875f4e7d4
diff --git a/3rdParty/CppUnit/src/TestCase.cpp b/3rdParty/CppUnit/src/TestCase.cpp
deleted file mode 100644
index 13c0525..0000000
--- a/3rdParty/CppUnit/src/TestCase.cpp
+++ /dev/null
@@ -1,137 +0,0 @@
-#include <cppunit/Portability.h>
-#include <cppunit/Exception.h>
-#include <cppunit/Protector.h>
-#include <cppunit/TestCase.h>
-#include <cppunit/TestResult.h>
-#include <stdexcept>
-
-#if CPPUNIT_USE_TYPEINFO_NAME
-# include <typeinfo>
-#endif
-
-CPPUNIT_NS_BEGIN
-
-/*! \brief Functor to call test case method (Implementation).
- *
- * Implementation detail.
- */
-class TestCaseMethodFunctor : public Functor
-{
-public:
- typedef void (TestCase::*Method)();
-
- TestCaseMethodFunctor( TestCase *target,
- Method method )
- : m_target( target )
- , m_method( method )
- {
- }
-
- bool operator()() const
- {
- (m_target->*m_method)();
- return true;
- }
-
-private:
- TestCase *m_target;
- Method m_method;
-};
-
-
-/** Constructs a test case.
- * \param name the name of the TestCase.
- **/
-TestCase::TestCase( const std::string &name )
- : m_name(name)
-{
-}
-
-
-/// Run the test and catch any exceptions that are triggered by it
-void
-TestCase::run( TestResult *result )
-{
- result->startTest(this);
-/*
- try {
- setUp();
-
- try {
- runTest();
- }
- catch ( Exception &e ) {
- Exception *copy = e.clone();
- result->addFailure( this, copy );
- }
- catch ( std::exception &e ) {
- result->addError( this, new Exception( Message( "uncaught std::exception",
- e.what() ) ) );
- }
- catch (...) {
- Exception *e = new Exception( Message( "uncaught unknown exception" ) );
- result->addError( this, e );
- }
-
- try {
- tearDown();
- }
- catch (...) {
- result->addError( this, new Exception( Message( "tearDown() failed" ) ) );
- }
- }
- catch (...) {
- result->addError( this, new Exception( Message( "setUp() failed" ) ) );
- }
-*/
- if ( result->protect( TestCaseMethodFunctor( this, &TestCase::setUp ),
- this,
- "setUp() failed" ) )
- {
- result->protect( TestCaseMethodFunctor( this, &TestCase::runTest ),
- this );
- }
-
- result->protect( TestCaseMethodFunctor( this, &TestCase::tearDown ),
- this,
- "tearDown() failed" );
-
- result->endTest( this );
-}
-
-
-/// All the work for runTest is deferred to subclasses
-void
-TestCase::runTest()
-{
-}
-
-
-/** Constructs a test case for a suite.
- * \deprecated This constructor was used by fixture when TestFixture did not exist.
- * Have your fixture inherits TestFixture instead of TestCase.
- * \internal
- * This TestCase was intended for use by the TestCaller and should not
- * be used by a test case for which run() is called.
- **/
-TestCase::TestCase()
- : m_name( "" )
-{
-}
-
-
-/// Destructs a test case
-TestCase::~TestCase()
-{
-}
-
-
-/// Returns the name of the test case
-std::string
-TestCase::getName() const
-{
- return m_name;
-}
-
-
-CPPUNIT_NS_END