summaryrefslogtreecommitdiff
path: root/src/cppunit/ProtectorContext.h
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2002-07-16 21:59:22 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2002-07-16 21:59:22 +0000
commit2a31073734be6e44e477079699578820282b7345 (patch)
tree70b18c3fc851173fe5fd69a7d844640ab6b780d2 /src/cppunit/ProtectorContext.h
parent251c1ff8aecaa608ef9e6041c2691d369430bf7b (diff)
downloadcppunit-2a31073734be6e44e477079699578820282b7345.tar.gz
Include/cppunit/Protector.
include/cppunit/Protector.h: * src/cppunit/Protector.cpp: added. Base class for protectors. * src/cppunit/DefaultProtector.h: * src/cppunit/DefaultProtector.cpp: added. Implementation of the default protector used to catch std::exception and any other exception. * src/cppunit/ProtectorChain.h: * src/cppunit/ProtectorChain.cpp: added. Implementation of a chain of protector, allowing catching custom exception and implementation of expected exception. * src/cppunit/TestCase.cpp: * src/cppunit/TestResult.cpp: updated to use protector.
Diffstat (limited to 'src/cppunit/ProtectorContext.h')
-rw-r--r--src/cppunit/ProtectorContext.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/cppunit/ProtectorContext.h b/src/cppunit/ProtectorContext.h
new file mode 100644
index 0000000..6a8d97a
--- /dev/null
+++ b/src/cppunit/ProtectorContext.h
@@ -0,0 +1,33 @@
+#ifndef CPPUNIT_PROTECTORCONTEXT_H
+#define CPPUNIT_PROTECTORCONTEXT_H
+
+#include <cppunit/Portability.h>
+#include <string>
+
+CPPUNIT_NS_BEGIN
+
+class Test;
+class TestResult;
+
+
+class CPPUNIT_API ProtectorContext
+{
+public:
+ ProtectorContext( Test *test,
+ TestResult *result,
+ const std::string &shortDescription )
+ : m_test( test )
+ , m_result( result )
+ , m_shortDescription( shortDescription )
+ {
+ }
+
+ Test *m_test;
+ TestResult *m_result;
+ std::string m_shortDescription;
+};
+
+
+CPPUNIT_NS_END
+
+#endif // CPPUNIT_PROTECTORCONTEXT_H \ No newline at end of file