summaryrefslogtreecommitdiff
path: root/testtools/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-04-13 09:57:50 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-04-13 09:57:50 +0100
commit5775fc209164484b24526ad011c3a239ddfcae0c (patch)
tree0fa3d2c7b4a5fc3e327fd79b15d45d43cd45cd13 /testtools/source
parente59c44bd442fb12624b3233d25fba7f061e88be5 (diff)
catch by const reference
Diffstat (limited to 'testtools/source')
-rw-r--r--testtools/source/bridgetest/bridgetest.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx
index 96232a470717..13fef199ee2c 100644
--- a/testtools/source/bridgetest/bridgetest.cxx
+++ b/testtools/source/bridgetest/bridgetest.cxx
@@ -547,21 +547,21 @@ static sal_Bool performTest(
try {
xLBT->getRaiseAttr1();
bRet &= check(false, "getRaiseAttr1 did not throw");
- } catch (RuntimeException &) {
+ } catch (const RuntimeException &) {
} catch (...) {
bRet &= check(false, "getRaiseAttr1 threw wrong type");
}
try {
xLBT->setRaiseAttr1(0);
bRet &= check(false, "setRaiseAttr1 did not throw");
- } catch (IllegalArgumentException &) {
+ } catch (const IllegalArgumentException &) {
} catch (...) {
bRet &= check(false, "setRaiseAttr1 threw wrong type");
}
try {
xLBT->getRaiseAttr2();
bRet &= check(false, "getRaiseAttr2 did not throw");
- } catch (IllegalArgumentException &) {
+ } catch (const IllegalArgumentException &) {
} catch (...) {
bRet &= check(false, "getRaiseAttr2 threw wrong type");
}
@@ -907,7 +907,7 @@ static sal_Bool performTest(
// available in Java, while the server is, the logic is reversed here:
try {
xBT2->testConstructorsService(xContext);
- } catch (BadConstructorArguments &) {
+ } catch (const BadConstructorArguments &) {
bRet = false;
}
if (!noCurrentContext) {
@@ -947,7 +947,7 @@ static sal_Bool raiseOnewayException( const Reference < XBridgeTest > & xLBT )
// When it flies, it must contain the correct elements.
xLBT->raiseRuntimeExceptionOneway( sCompare, x );
}
- catch( RuntimeException & e )
+ catch( const RuntimeException & e )
{
bReturn = (
#if OSL_DEBUG_LEVEL == 0
@@ -975,14 +975,14 @@ static sal_Bool raiseException( const Reference< XBridgeTest > & xLBT )
5, OUSTR(STRING_TEST_CONSTANT),
xLBT->getInterface() );
}
- catch (IllegalArgumentException aExc)
+ catch (const IllegalArgumentException &rExc)
{
- if (aExc.ArgumentPosition == 5 &&
+ if (rExc.ArgumentPosition == 5 &&
#if OSL_DEBUG_LEVEL == 0
// java stack traces trash Message
- aExc.Message.compareToAscii( STRING_TEST_CONSTANT ) == 0 &&
+ rExc.Message.compareToAscii( STRING_TEST_CONSTANT ) == 0 &&
#endif
- aExc.Context == xLBT->getInterface())
+ rExc.Context == xLBT->getInterface())
{
#ifdef COMPCHECK
//When we check if a new compiler still works then we must not call
@@ -1022,7 +1022,7 @@ static sal_Bool raiseException( const Reference< XBridgeTest > & xLBT )
xLBT->setRuntimeException( 0xcafebabe );
}
}
- catch (Exception & rExc)
+ catch (const Exception & rExc)
{
if (rExc.Context == xLBT->getInterface()
#if OSL_DEBUG_LEVEL == 0
@@ -1236,7 +1236,7 @@ sal_Int32 TestBridgeImpl::run( const Sequence< OUString > & rArgs )
Reference< XInterface >() );
}
}
- catch (Exception & exc)
+ catch (const Exception & exc)
{
OString cstr( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) );
fprintf( stderr, "exception occurred: %s\n", cstr.getStr() );