summaryrefslogtreecommitdiff
path: root/src/cppunit/TestResult.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cppunit/TestResult.cpp')
-rw-r--r--src/cppunit/TestResult.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cppunit/TestResult.cpp b/src/cppunit/TestResult.cpp
index 2b20e4c..cf03dd4 100644
--- a/src/cppunit/TestResult.cpp
+++ b/src/cppunit/TestResult.cpp
@@ -3,6 +3,9 @@
#include <cppunit/TestListener.h>
#include <cppunit/TestResult.h>
#include <algorithm>
+#include "DefaultProtector.h"
+#include "ProtectorChain.h"
+#include "ProtectorContext.h"
CPPUNIT_NS_BEGIN
@@ -10,7 +13,9 @@ CPPUNIT_NS_BEGIN
/// Construct a TestResult
TestResult::TestResult( SynchronizationObject *syncObject )
: SynchronizedObject( syncObject )
+ , m_protectorChain( new ProtectorChain() )
{
+ m_protectorChain->push( new DefaultProtector() );
reset();
}
@@ -18,6 +23,7 @@ TestResult::TestResult( SynchronizationObject *syncObject )
/// Destroys a test result
TestResult::~TestResult()
{
+ delete m_protectorChain;
}
@@ -184,4 +190,14 @@ TestResult::endTestRun( Test *test )
}
+bool
+TestResult::protect( const Functor &functor,
+ Test *test,
+ const std::string &shortDescription )
+{
+ ProtectorContext context( test, this, shortDescription );
+ return m_protectorChain->protect( functor, context );
+}
+
+
CPPUNIT_NS_END