summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2012-04-16 01:35:00 +0200
committerTor Lillqvist <tml@iki.fi>2012-04-16 01:46:37 +0200
commitae3f7ccaabefe3b2682706cecfa3b4b144d9cc04 (patch)
tree6526557726c5ad7f2033aff687c36d0c05a07890 /sal
parente7b440a0afd700cfeed5418ad85a874ecae24100 (diff)
Recognize unoexceptionprotector and unobootstrapprotector
Diffstat (limited to 'sal')
-rw-r--r--sal/cppunittester/cppunittester.cxx17
-rw-r--r--sal/inc/cppunittester/protectorfactory.hxx1
2 files changed, 12 insertions, 6 deletions
diff --git a/sal/cppunittester/cppunittester.cxx b/sal/cppunittester/cppunittester.cxx
index 6cae612deb6d..9ec61c1b9878 100644
--- a/sal/cppunittester/cppunittester.cxx
+++ b/sal/cppunittester/cppunittester.cxx
@@ -214,17 +214,22 @@ SAL_IMPLEMENT_MAIN() {
if (rtl_getAppCommandArgCount() - index < 3) {
usageFailure();
}
-#ifndef DISABLE_DYNLOADING
rtl::OUString lib(getArgument(index + 1));
rtl::OUString sym(getArgument(index + 2));
+#ifndef DISABLE_DYNLOADING
modules.push_back(new osl::Module(lib, SAL_LOADMODULE_GLOBAL));
oslGenericFunction fn = modules.back().getFunctionSymbol(sym);
#else
- // The only "protector" we ever use is the unoexceptionprotector...
- // Oh the joys of over-engineering.
- rtl::OUString lib(RTL_CONSTASCII_USTRINGPARAM("<static>"));
- rtl::OUString sym(RTL_CONSTASCII_USTRINGPARAM("unoexceptionprotector"));
- oslGenericFunction fn = (oslGenericFunction) unoexceptionprotector;
+ oslGenericFunction fn;
+ if (sym == "unoexceptionprotector")
+ fn = (oslGenericFunction) unoexceptionprotector;
+ else if (sym == "unobootstrapprotector")
+ fn = (oslGenericFunction) unobootstrapprotector;
+ else
+ {
+ fprintf(stderr, "Only unoexceptionprotector or unobootstrapprotector protectors allowed\n");
+ assert(!"unrecognized protector");
+ }
#endif
CppUnit::Protector *protector = fn == 0
? 0
diff --git a/sal/inc/cppunittester/protectorfactory.hxx b/sal/inc/cppunittester/protectorfactory.hxx
index b666412cb51d..e12afe7ed7b3 100644
--- a/sal/inc/cppunittester/protectorfactory.hxx
+++ b/sal/inc/cppunittester/protectorfactory.hxx
@@ -45,6 +45,7 @@ namespace cppunittester
#ifdef DISABLE_DYNLOADING
extern "C" CppUnit::Protector *unoexceptionprotector();
+extern "C" CppUnit::Protector *unobootstrapprotector();
#endif
#endif