summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-30 15:59:34 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-30 15:59:34 +0100
commitcdb04bb015275f739ebcb0f79445bbb5bae01cb9 (patch)
treee43edd72793b55c776f9a657430ea78db7889c4f
parentd0a8f0e6b201d78b09868c9cc41aaac5f62c894d (diff)
extend CppUnit::Protector for context-less protection
-rw-r--r--sal/inc/cppunittester/protectorfactory.hxx22
-rw-r--r--sal/inc/sal/cppunit.h12
2 files changed, 26 insertions, 8 deletions
diff --git a/sal/inc/cppunittester/protectorfactory.hxx b/sal/inc/cppunittester/protectorfactory.hxx
index c309dbe8a..916f89f74 100644
--- a/sal/inc/cppunittester/protectorfactory.hxx
+++ b/sal/inc/cppunittester/protectorfactory.hxx
@@ -32,14 +32,20 @@
#include "sal/types.h"
-namespace CppUnit { class Protector; }
-
-namespace cppunittester {
-
-// The type of CppUnit::Protector factory functions that can be plugged into
-// cppunittester:
-extern "C" typedef CppUnit::Protector * SAL_CALL ProtectorFactory();
-
+#include <cppunit/Protector.h>
+
+namespace cppunittester
+{
+ class LibreOfficeProtector : public CppUnit::Protector
+ {
+ public:
+ virtual bool protect(CppUnit::Functor const & functor) = 0;
+ using CppUnit::Protector::protect;
+ };
+
+ // The type of CppUnit::Protector factory functions that can be plugged into
+ // cppunittester:
+ extern "C" typedef LibreOfficeProtector * SAL_CALL ProtectorFactory();
}
#endif
diff --git a/sal/inc/sal/cppunit.h b/sal/inc/sal/cppunit.h
index d0b3e6099..41c465d62 100644
--- a/sal/inc/sal/cppunit.h
+++ b/sal/inc/sal/cppunit.h
@@ -35,6 +35,18 @@
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
+#include <cppunit/Protector.h>
+
+namespace cppunittester
+{
+ class LibreOfficeProtecter : public CppUnit::Protector
+ {
+ public:
+ virtual bool protect(CppUnit::Functor const & functor) = 0;
+ using CppUnit::Protector::protect;
+ };
+}
+
#undef CPPUNIT_PLUGIN_EXPORT
#define CPPUNIT_PLUGIN_EXPORT extern "C" SAL_DLLPUBLIC_EXPORT