summaryrefslogtreecommitdiffstats
path: root/stoc/test
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2011-12-27 00:12:38 +0900
committerTakeshi Abe <tabe@fixedpoint.jp>2011-12-27 10:17:15 +0900
commitc936e5062770ba100c2eddd7889b51d271c6c73c (patch)
tree7ab2701dce9bfea7ac5b3b319a05a1aeb4a25cad /stoc/test
parentUse default UI_SANS (dropping Culmus fonts), but keep Tahoma first (for Windows) (diff)
downloadcore-c936e5062770ba100c2eddd7889b51d271c6c73c.tar.gz
core-c936e5062770ba100c2eddd7889b51d271c6c73c.zip
catch exception by constant reference
Diffstat (limited to 'stoc/test')
-rw-r--r--stoc/test/excomp/excomp.cxx2
-rw-r--r--stoc/test/javavm/jvm_interaction/interactionhandler.cxx10
-rw-r--r--stoc/test/javavm/testjavavm.cxx2
-rw-r--r--stoc/test/security/test_security.cxx4
-rw-r--r--stoc/test/testconv.cxx6
-rw-r--r--stoc/test/testcorefl.cxx2
-rw-r--r--stoc/test/testiadapter.cxx8
-rw-r--r--stoc/test/testintrosp.cxx8
-rw-r--r--stoc/test/testproxyfac.cxx4
-rw-r--r--stoc/test/testregistry.cxx2
-rw-r--r--stoc/test/testsmgr2.cxx2
-rw-r--r--stoc/test/testsmgr_cpnt.cxx2
12 files changed, 26 insertions, 26 deletions
diff --git a/stoc/test/excomp/excomp.cxx b/stoc/test/excomp/excomp.cxx
index bdca65649a90..d896b6890dbd 100644
--- a/stoc/test/excomp/excomp.cxx
+++ b/stoc/test/excomp/excomp.cxx
@@ -108,7 +108,7 @@ SAL_IMPLEMENT_MAIN()
compName2,
Reference< XSimpleRegistry >() );
}
- catch( CannotRegisterImplementationException& e)
+ catch(const CannotRegisterImplementationException& e)
{
TEST_ENSHURE( e.Message.getLength(), OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US).getStr() );
}
diff --git a/stoc/test/javavm/jvm_interaction/interactionhandler.cxx b/stoc/test/javavm/jvm_interaction/interactionhandler.cxx
index 6cc36eba5bcc..e0758c93a99e 100644
--- a/stoc/test/javavm/jvm_interaction/interactionhandler.cxx
+++ b/stoc/test/javavm/jvm_interaction/interactionhandler.cxx
@@ -153,27 +153,27 @@ sal_Bool test1(const Reference< XMultiServiceFactory > & xMgr )
{
anyVM = xVM->getJavaVM( Sequence<sal_Int8>(arId, 16));
}
- catch (JavaNotConfiguredException& e)
+ catch (const JavaNotConfiguredException& e)
{
OString msg= OUStringToOString(e.Message, osl_getThreadTextEncoding());
printf("JavaNotConfiguredException: %s\n", msg.getStr());
}
- catch (JavaVMCreationFailureException& e)
+ catch (const JavaVMCreationFailureException& e)
{
OString msg= OUStringToOString(e.Message, osl_getThreadTextEncoding());
printf("JavaVMCreationFailureException: %s\n", msg.getStr());
}
- catch (MissingJavaRuntimeException& e)
+ catch (const MissingJavaRuntimeException& e)
{
OString msg= OUStringToOString(e.Message, osl_getThreadTextEncoding());
printf("MissingJavaRuntimeException: %s\n", msg.getStr());
}
- catch (JavaDisabledException& e)
+ catch (const JavaDisabledException& e)
{
OString msg= OUStringToOString(e.Message, osl_getThreadTextEncoding());
printf("JavaDisabledException: %s\n", msg.getStr());
}
- catch (RuntimeException & e)
+ catch (const RuntimeException & e)
{
OString msg= OUStringToOString(e.Message, osl_getThreadTextEncoding());
printf("###RuntimeException: %s\n", msg.getStr());
diff --git a/stoc/test/javavm/testjavavm.cxx b/stoc/test/javavm/testjavavm.cxx
index 2ec3c3a80c4f..99e06be062e8 100644
--- a/stoc/test/javavm/testjavavm.cxx
+++ b/stoc/test/javavm/testjavavm.cxx
@@ -151,7 +151,7 @@ SAL_IMPLEMENT_MAIN()
bSucc = testJavaVM( xMgr );
}
- catch (Exception & rExc)
+ catch (const Exception & rExc)
{
OSL_FAIL( "### exception occurred!" );
OString aMsg( OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) );
diff --git a/stoc/test/security/test_security.cxx b/stoc/test/security/test_security.cxx
index f2b4f36337aa..08ecd5b17762 100644
--- a/stoc/test/security/test_security.cxx
+++ b/stoc/test/security/test_security.cxx
@@ -173,7 +173,7 @@ Any user_CurrentContext::getValueByName( OUString const & name )
check; \
} \
} \
- catch (RuntimeException & exc) \
+ catch (const RuntimeException & exc) \
{ \
OUStringBuffer buf( 64 ); \
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("[line ") ); \
@@ -513,7 +513,7 @@ SAL_IMPLEMENT_MAIN()
::fprintf( stderr, "security test succeeded.\n" );
return 0;
}
- catch (Exception & exc)
+ catch (const Exception & exc)
{
OString str( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) );
::fprintf( stderr, "[security test] error: %s!\n", str.getStr() );
diff --git a/stoc/test/testconv.cxx b/stoc/test/testconv.cxx
index 70b94523231a..477e0d322c70 100644
--- a/stoc/test/testconv.cxx
+++ b/stoc/test/testconv.cxx
@@ -183,7 +183,7 @@ static sal_Bool convertTo( const Type & rDestType, const Any & rVal, sal_Bool bE
aRet = s_xConverter->convertTo( rVal, rDestType );
bCanConvert = sal_True;
}
- catch (Exception & rExc)
+ catch (const Exception & rExc)
{
aExcMsg = OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US );
}
@@ -237,7 +237,7 @@ static sal_Bool convertTo( const Type & rDestType, const Any & rVal, sal_Bool bE
aRet2 = s_xConverter->convertTo( aRet, rVal.getValueType() );
bReConvert = sal_True;
}
- catch (Exception & rExc)
+ catch (const Exception & rExc)
{
aExcMsg = OUStringToOString( rExc.Message, RTL_TEXTENCODING_ISO_8859_1 );
}
@@ -690,7 +690,7 @@ SAL_IMPLEMENT_MAIN()
test_Conversion( xMgr );
}
- catch (Exception & rExc)
+ catch (const Exception & rExc)
{
OSL_FAIL( "### exception occurred!" );
OString aMsg( OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) );
diff --git a/stoc/test/testcorefl.cxx b/stoc/test/testcorefl.cxx
index 224cb53253e3..505fceb9bd35 100644
--- a/stoc/test/testcorefl.cxx
+++ b/stoc/test/testcorefl.cxx
@@ -399,7 +399,7 @@ SAL_IMPLEMENT_MAIN()
Reference< XComponent >( xContext, UNO_QUERY )->dispose();
}
- catch (Exception & rExc)
+ catch (const Exception & rExc)
{
OSL_FAIL( "### exception occurred!" );
OString aMsg(
diff --git a/stoc/test/testiadapter.cxx b/stoc/test/testiadapter.cxx
index 8b3c59b0a8f3..28468ce25f1d 100644
--- a/stoc/test/testiadapter.cxx
+++ b/stoc/test/testiadapter.cxx
@@ -530,7 +530,7 @@ Any XLB_Invocation::invoke( const OUString & rFunctionName,
bImplementedMethod = false;
}
}
- catch (IllegalArgumentException & rExc)
+ catch (const IllegalArgumentException & rExc)
{
// thrown by raiseException() call
InvocationTargetException aExc;
@@ -905,7 +905,7 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT )
aRet.Enum, aRet.String, aRet.Interface, aRet.Any, aRet.Sequence, aRet2 );
return sal_False;
}
- catch (IllegalArgumentException aExc)
+ catch (const IllegalArgumentException &aExc)
{
OSL_ENSURE( aExc.ArgumentPosition == 5 &&
// aExc.Context == xLBT &&
@@ -938,7 +938,7 @@ sal_Bool raiseException( const Reference<XLanguageBindingTest > & xLBT )
return sal_False;
}
}
- catch (Exception & aExc)
+ catch (const Exception & aExc)
{
OSL_ENSURE( //aExc.Context == xLBT &&
aExc.Message.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dum dum dum ich tanz im kreis herum...")),
@@ -1058,7 +1058,7 @@ SAL_IMPLEMENT_MAIN()
}
}
}
- catch (Exception & rExc)
+ catch (const Exception & rExc)
{
fprintf( stderr, "> exception occurred: " );
OString aMsg( OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) );
diff --git a/stoc/test/testintrosp.cxx b/stoc/test/testintrosp.cxx
index f04e8fb9cf90..ac9b1b03df57 100644
--- a/stoc/test/testintrosp.cxx
+++ b/stoc/test/testintrosp.cxx
@@ -1054,7 +1054,7 @@ static sal_Bool test_introsp( Reference< XMultiServiceFactory > xMgr,
{
xPropSet->setPropertyValue( aPropName, aNewVal );
}
- catch(UnknownPropertyException e1)
+ catch(const UnknownPropertyException &)
{
}
@@ -1088,7 +1088,7 @@ static sal_Bool test_introsp( Reference< XMultiServiceFactory > xMgr,
{
Property aGetProp = xAccess->getProperty( aWDemandedName, nConcepts );
}
- catch (RuntimeException e1)
+ catch (const RuntimeException &)
{
aErrorStr = "property \"";
aErrorStr += aDemandedName;
@@ -1174,7 +1174,7 @@ static sal_Bool test_introsp( Reference< XMultiServiceFactory > xMgr,
Reference< XIdlMethod > xGetMethod = xAccess->getMethod( aWDemandedName, nRealConcepts );
TEST_ENSHURE( xGetMethod == rxMethod , aErrorStr.getStr() );
}
- catch (RuntimeException e1)
+ catch (const RuntimeException &)
{
aErrorStr = "method \"";
aErrorStr += aDemandedName;
@@ -1237,7 +1237,7 @@ SAL_IMPLEMENT_MAIN()
bSucc = test_introsp( xMgr, xRefl, xIntrosp );
fprintf(stderr, "after test_introsp\n" );
}
- catch (Exception & rExc)
+ catch (const Exception & rExc)
{
OSL_FAIL( "### exception occurred!" );
OString aMsg( OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) );
diff --git a/stoc/test/testproxyfac.cxx b/stoc/test/testproxyfac.cxx
index ff9defabc311..40e8c60d97f4 100644
--- a/stoc/test/testproxyfac.cxx
+++ b/stoc/test/testproxyfac.cxx
@@ -225,7 +225,7 @@ static void test_proxyfac_(
Reference< registry::XRegistryKey >(
xMaster, UNO_QUERY_THROW );
}
- catch (lang::DisposedException & exc)
+ catch (const lang::DisposedException & exc)
{
if (! exc.Message.equalsAsciiL(
RTL_CONSTASCII_STRINGPARAM("my test exception") ))
@@ -328,7 +328,7 @@ SAL_IMPLEMENT_MAIN()
xProxyFac );
uno_dumpEnvironment( stdout, cpp_env.get(), 0 );
}
- catch (Exception & rExc)
+ catch (const Exception & rExc)
{
(void)rExc;
OSL_ENSURE(
diff --git a/stoc/test/testregistry.cxx b/stoc/test/testregistry.cxx
index 19d94fa7365c..5eddcf6aa7e3 100644
--- a/stoc/test/testregistry.cxx
+++ b/stoc/test/testregistry.cxx
@@ -649,7 +649,7 @@ void test_DefaultRegistry(
{
xReg->close();
}
- catch(InvalidRegistryException& e)
+ catch(const InvalidRegistryException& e)
{
(void)e;
TEST_ENSHURE(0, OUStringToOString(e.Message,RTL_TEXTENCODING_ASCII_US).getStr());
diff --git a/stoc/test/testsmgr2.cxx b/stoc/test/testsmgr2.cxx
index 8160dfc20e5a..288d3f08b70d 100644
--- a/stoc/test/testsmgr2.cxx
+++ b/stoc/test/testsmgr2.cxx
@@ -107,7 +107,7 @@ SAL_IMPLEMENT_MAIN()
fprintf( stderr, "missing DisposedException!\n" );
return 1;
}
- catch ( Exception & e )
+ catch ( const Exception & e )
{
OString o = OUStringToOString( e.Message , RTL_TEXTENCODING_ASCII_US );
printf( "%s\n" , o.getStr() );
diff --git a/stoc/test/testsmgr_cpnt.cxx b/stoc/test/testsmgr_cpnt.cxx
index 420fd7c7133e..7e9296a75938 100644
--- a/stoc/test/testsmgr_cpnt.cxx
+++ b/stoc/test/testsmgr_cpnt.cxx
@@ -258,7 +258,7 @@ extern "C" void SAL_CALL test_ServiceManager()
// register the services via writeComponentRegInfo (see at end of this file)
xInst->registerImplementation(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")), atUModule2, Reference< XSimpleRegistry >() );
}
- catch( CannotRegisterImplementationException e ) {
+ catch(const CannotRegisterImplementationException &) {
TEST_ENSHURE( 0, "register implementation failed" );
}