diff options
author | Tor Lillqvist <tml@iki.fi> | 2012-04-16 01:35:00 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2012-04-16 01:46:37 +0200 |
commit | ae3f7ccaabefe3b2682706cecfa3b4b144d9cc04 (patch) | |
tree | 6526557726c5ad7f2033aff687c36d0c05a07890 /sal/cppunittester | |
parent | remove no longer used enumeration (diff) | |
download | core-ae3f7ccaabefe3b2682706cecfa3b4b144d9cc04.tar.gz core-ae3f7ccaabefe3b2682706cecfa3b4b144d9cc04.zip |
Recognize unoexceptionprotector and unobootstrapprotector
Diffstat (limited to 'sal/cppunittester')
-rw-r--r-- | sal/cppunittester/cppunittester.cxx | 17 |
1 files changed, 11 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 |