diff options
Diffstat (limited to 'cppuhelper/test/testimplhelper.cxx')
-rw-r--r-- | cppuhelper/test/testimplhelper.cxx | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/cppuhelper/test/testimplhelper.cxx b/cppuhelper/test/testimplhelper.cxx index b3c2638739c3..703c44ebebbb 100644 --- a/cppuhelper/test/testimplhelper.cxx +++ b/cppuhelper/test/testimplhelper.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -91,7 +91,7 @@ using namespace com::sun::star::uno; struct TestImpl : public ImplHelper4< CA, DBA, FE, G > { sal_Int32 nRef; - + virtual ~TestImpl() { OSL_TRACE( "> TestImpl dtor called... <\n" ); } @@ -101,7 +101,7 @@ struct TestImpl : public ImplHelper4< CA, DBA, FE, G > { ++nRef; } virtual void SAL_CALL release( ) throw() { if (! --nRef) delete this; } - + // A virtual OUString SAL_CALL a() throw(RuntimeException) { return OUString( RTL_CONSTASCII_USTRINGPARAM("a") ); } @@ -130,7 +130,7 @@ struct TestWeakAggImpl : public WeakAggImplHelper4< CA, DBA, FE, G > { virtual ~TestWeakAggImpl() { OSL_TRACE( "> TestWeakAggImpl dtor called... <\n" ); } - + // A virtual OUString SAL_CALL a() throw(RuntimeException) { return OUString( RTL_CONSTASCII_USTRINGPARAM("a") ); } @@ -161,7 +161,7 @@ struct TestWeakImpl : public WeakImplHelper4< CA, DBA, FE, G > virtual ~TestWeakImpl() { OSL_TRACE( "> TestWeakImpl dtor called... <\n" ); } - + // A virtual OUString SAL_CALL a() throw(RuntimeException) { return OUString( RTL_CONSTASCII_USTRINGPARAM("a") ); } @@ -210,7 +210,7 @@ struct TestWeakComponentImpl : public WeakComponentImplHelper4< CA, DBA, FE, G > void SAL_CALL disposing() { OSL_TRACE( "> TestWeakComponentImpl disposing called... <\n" ); } - + // A virtual OUString SAL_CALL a() throw(RuntimeException) { return OUString( RTL_CONSTASCII_USTRINGPARAM("a") ); } @@ -246,7 +246,7 @@ struct TestWeakAggComponentImpl : public WeakAggComponentImplHelper4< CA, DBA, F void SAL_CALL disposing() { OSL_TRACE( "> TestWeakAggComponentImpl disposing called... <\n" ); } - + // A virtual OUString SAL_CALL a() throw(RuntimeException) { return OUString( RTL_CONSTASCII_USTRINGPARAM("a") ); } @@ -295,7 +295,7 @@ struct TestImplInh : public ImplInheritanceHelper2< TestWeakImpl, H, I > virtual ~TestImplInh() { OSL_TRACE( "> TestWeakImplInh dtor called... <\n" ); } - + // H virtual OUString SAL_CALL h() throw(RuntimeException) { return OUString( RTL_CONSTASCII_USTRINGPARAM("h") ); } @@ -309,7 +309,7 @@ struct TestAggImplInh : public AggImplInheritanceHelper2< TestWeakAggImpl, H, I { virtual ~TestAggImplInh() { OSL_TRACE( "> TestAggImplInh dtor called... <\n" ); } - + // H virtual OUString SAL_CALL h() throw(RuntimeException) { return OUString( RTL_CONSTASCII_USTRINGPARAM("h2") ); } @@ -348,7 +348,7 @@ static void dotest( const Reference< XInterface > & xOriginal ) { ::fprintf( stderr, n < 15 ? "%x " : "%x \n", id[ n ] ); } - + Reference< A > xa( xOriginal, UNO_QUERY ); OSL_ENSURE( xa->a().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("a") ), "### A failed!" ); Reference< BA > xba( xa, UNO_QUERY ); @@ -372,14 +372,14 @@ static void dotest( const Reference< XInterface > & xOriginal ) // type provider Reference< lang::XTypeProvider > xProv( xg, UNO_QUERY ); Sequence< Type > aTypes( xProv->getTypes() ); - + // CA, DBA, FE, G, XTypeProvider OSL_ASSERT( isIn( aTypes, "test.CA" ) ); OSL_ASSERT( isIn( aTypes, "test.DBA" ) ); OSL_ASSERT( isIn( aTypes, "test.FE") ); OSL_ASSERT( isIn( aTypes, "test.G") ); OSL_ASSERT( isIn( aTypes, "com.sun.star.lang.XTypeProvider") ); - + Reference< XWeak > xWeak( xg, UNO_QUERY ); if (xWeak.is()) { @@ -390,7 +390,7 @@ static void dotest( const Reference< XInterface > & xOriginal ) { OSL_ASSERT( isIn( aTypes, "com.sun.star.lang.XComponent") ); } - + Reference< XAggregation > xAgg( xg, UNO_QUERY ); if (xAgg.is()) { @@ -406,7 +406,7 @@ static void dotest( const Reference< XInterface > & xOriginal ) { OSL_ASSERT( isIn( aTypes, "test.I") ); } - + OSL_ENSURE( xg == xOriginal, "### root!" ); } @@ -455,7 +455,7 @@ void test_ImplHelper( const Reference< lang::XMultiServiceFactory > & /*xSF*/ ) xTP3->getImplementationId() != xTP5->getImplementationId() && xTP4->getImplementationId() != xTP5->getImplementationId() ); // - + dotest( xImpl ); dotest( xWeakImpl ); dotest( xWeakAggImpl ); @@ -469,7 +469,7 @@ void test_ImplHelper( const Reference< lang::XMultiServiceFactory > & /*xSF*/ ) Reference< I > xI( xH, UNO_QUERY ); OSL_ASSERT( xH->h().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("h") ) ); OSL_ASSERT( xI->i().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("i") ) ); - + xWeakAggImpl = (OWeakObject *)new TestAggImplInh(); Reference< lang::XTypeProvider > xTP7( xWeakAggImpl, UNO_QUERY ); dotest( xWeakAggImpl ); @@ -506,7 +506,7 @@ void test_ImplHelper( const Reference< lang::XMultiServiceFactory > & /*xSF*/ ) { Any a( getCaughtException() ); OSL_ASSERT( a == exc ); - + try { throwException( a ); @@ -514,7 +514,7 @@ void test_ImplHelper( const Reference< lang::XMultiServiceFactory > & /*xSF*/ ) catch (lang::IllegalAccessException & e) { OSL_ASSERT( exc.Message == e.Message && exc.Context == e.Context ); - + try { throw_one( exc ); @@ -538,7 +538,7 @@ void test_ImplHelper( const Reference< lang::XMultiServiceFactory > & /*xSF*/ ) } } OSL_ASSERT( exc_succ ); - + try { throwException( makeAny( RuntimeException( |