diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-01 08:41:50 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-01 08:41:50 +0200 |
commit | 678196b9a1146fd143cc9f9937183412243d1dc5 (patch) | |
tree | 067d258e722c83345f3a16b98533b2ee37703d35 /testtools/source | |
parent | 2093c7a27be60f99cb20aa5f5f088dc3606d4008 (diff) |
Replace remaining getCppuType et al with cppu::UnoType
Change-Id: I02c70b26b82d2d0357111a127aefc57d3be21320
Diffstat (limited to 'testtools/source')
-rw-r--r-- | testtools/source/bridgetest/bridgetest.cxx | 34 | ||||
-rw-r--r-- | testtools/source/performance/ubobject.cxx | 10 | ||||
-rw-r--r-- | testtools/source/performance/ubtest.cxx | 20 |
3 files changed, 32 insertions, 32 deletions
diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index 80e601b2d968..ea37b9a9c301 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -69,7 +69,7 @@ using namespace test::testtools::bridgetest; namespace bridge_test { -template< class T> +template<typename T, typename U = T> Sequence<T> cloneSequence(const Sequence<T>& val); @@ -270,12 +270,12 @@ static bool performAnyTest( const Reference< XBridgeTest > &xLBT, const TestData Any a; { - a.setValue( &(data.Bool) , getCppuBooleanType() ); + a.setValue( &(data.Bool) , cppu::UnoType<bool>::get() ); OSL_ASSERT( xLBT->transportAny( a ) == a ); } { - a.setValue( &(data.Char) , getCppuCharType() ); + a.setValue( &(data.Char) , cppu::UnoType<cppu::UnoCharType>::get() ); OSL_ASSERT( xLBT->transportAny( a ) == a ); } @@ -381,7 +381,7 @@ static bool performTest( 0xFEDCBA98, SAL_CONST_INT64(0x123456789ABCDEF0), SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359, TestEnum_LOLA, STRING_TEST_CONSTANT, xI, - Any(&xI, getCppuType((Reference< XInterface > const *) 0))); + Any(&xI, cppu::UnoType<XInterface>::get())); bRet &= check(aData.Any == xI, "### unexpected any!"); bRet &= check(!(aData.Any != xI), "### unexpected any!"); aData.Sequence.realloc(2); @@ -393,7 +393,7 @@ static bool performTest( (TestElement &) aSetData, aData.Bool, aData.Char, aData.Byte, aData.Short, aData.UShort, aData.Long, aData.ULong, aData.Hyper, aData.UHyper, aData.Float, aData.Double, aData.Enum, aData.String, - xI, Any(&xI, getCppuType((Reference< XInterface > const *) 0))); + xI, Any(&xI, cppu::UnoType<XInterface>::get())); aSetData.Sequence.realloc(2); aSetData.Sequence[0] = *(TestElement const *) &aSetData; // aSetData.Sequence[1] is empty @@ -659,9 +659,9 @@ static bool performTest( sal_Bool _aBool = true; sal_Int32 _aInt = 0xBABEBABE; float _aFloat = 3.14f; - Any _any1(&_aBool, getCppuBooleanType()); - Any _any2(&_aInt, getCppuType((sal_Int32 *) 0)); - Any _any3(&_aFloat, getCppuType((float *) 0)); + Any _any1(&_aBool, cppu::UnoType<bool>::get()); + Any _any2(&_aInt, cppu::UnoType<sal_Int32>::get()); + Any _any3(&_aFloat, cppu::UnoType<float>::get()); Any _arAny[] = { _any1, _any2, _any3 }; Reference< XInterface > _arObj[3]; _arObj[0] = new OWeakObject(); @@ -674,19 +674,19 @@ static bool performTest( SAL_CONST_INT64(0x123456789ABCDEF0), SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359, TestEnum_LOLA, STRING_TEST_CONSTANT, _arObj[0], - Any(&_arObj[0], getCppuType((Reference< XInterface > const *) 0))); + Any(&_arObj[0], cppu::UnoType<XInterface>::get())); assign( _arStruct[1], true, 'A', 17, 0x1234, 0xFEDC, 0x12345678, 0xFEDCBA98, SAL_CONST_INT64(0x123456789ABCDEF0), SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359, TestEnum_TWO, STRING_TEST_CONSTANT, _arObj[1], - Any(&_arObj[1], getCppuType((Reference< XInterface > const *) 0))); + Any(&_arObj[1], cppu::UnoType<XInterface>::get())); assign( _arStruct[2], true, 'B', 17, 0x1234, 0xFEDC, 0x12345678, 0xFEDCBA98, SAL_CONST_INT64(0x123456789ABCDEF0), SAL_CONST_UINT64(0xFEDCBA9876543210), 17.0815f, 3.1415926359, TestEnum_CHECK, STRING_TEST_CONSTANT, _arObj[2], - Any(&_arObj[2], getCppuType((Reference< XInterface > const *) 0))); + Any(&_arObj[2], cppu::UnoType<XInterface>::get())); { Sequence<sal_Bool> arBool(_arBool, 3); Sequence<sal_Unicode> arChar( _arChar, 3); @@ -759,10 +759,10 @@ static bool performTest( xBT2->setSequenceStruct(arStruct)); bRet &= check(seqStructRet == arStruct, "sequence test"); Sequence< sal_Bool > arBoolTemp(cloneSequence(arBool)); - Sequence< sal_Unicode > arCharTemp(cloneSequence(arChar)); + Sequence< sal_Unicode > arCharTemp(cloneSequence<sal_Unicode, cppu::UnoCharType>(arChar)); Sequence< sal_Int8 > arByteTemp(cloneSequence(arByte)); Sequence< sal_Int16 > arShortTemp(cloneSequence(arShort)); - Sequence< sal_uInt16 > arUShortTemp(cloneSequence(arUShort)); + Sequence< sal_uInt16 > arUShortTemp(cloneSequence<sal_uInt16, cppu::UnoUnsignedShortType>(arUShort)); Sequence< sal_Int32 > arLongTemp(cloneSequence(arLong)); Sequence< sal_uInt32 > arULongTemp(cloneSequence(arULong)); Sequence< sal_Int64 > arHyperTemp(cloneSequence(arHyper)); @@ -1071,10 +1071,10 @@ uno_Sequence* cloneSequence(const uno_Sequence* val, const Type& type) return retSeq; } -template< class T> +template<typename T, typename U> Sequence<T> cloneSequence(const Sequence<T>& val) { - Sequence<T> seq( cloneSequence(val.get(), getCppuType(&val)), SAL_NO_ACQUIRE); + Sequence<T> seq( cloneSequence(val.get(), cppu::UnoType<cppu::UnoSequenceType<U>>::get()), SAL_NO_ACQUIRE); return seq; } @@ -1115,7 +1115,7 @@ inline bool makeSurrogate( } cpp2uno.mapInterface( reinterpret_cast< void ** >( &unoI.m_pUnoI ), - rOriginal.get(), ::getCppuType( &rOriginal ) ); + rOriginal.get(), cppu::UnoType<decltype(rOriginal)>::get() ); if (! unoI.is()) { throw RuntimeException( @@ -1123,7 +1123,7 @@ inline bool makeSurrogate( } uno2cpp.mapInterface( reinterpret_cast< void ** >( &rOut ), - unoI.get(), ::getCppuType( &rOriginal ) ); + unoI.get(), cppu::UnoType<decltype(rOriginal)>::get() ); if (! rOut.is()) { throw RuntimeException( diff --git a/testtools/source/performance/ubobject.cxx b/testtools/source/performance/ubobject.cxx index 2a23d5c3a7eb..972f53e28646 100644 --- a/testtools/source/performance/ubobject.cxx +++ b/testtools/source/performance/ubobject.cxx @@ -77,20 +77,20 @@ public: { // execution time remains appr. constant any time Any aRet; - if (aType == ::getCppuType( (const Reference< XInterface > *)0 )) + if (aType == cppu::UnoType<XInterface>::get()) { void * p = (XInterface *)(XPerformanceTest *)this; - aRet.setValue( &p, ::getCppuType( (const Reference< XInterface > *)0 ) ); + aRet.setValue( &p, cppu::UnoType<XInterface>::get() ); } - if (aType == ::getCppuType( (const Reference< XPerformanceTest > *)0 )) + if (aType == cppu::UnoType<XPerformanceTest>::get()) { void * p = (XPerformanceTest *)this; - aRet.setValue( &p, ::getCppuType( (const Reference< XPerformanceTest > *)0 ) ); + aRet.setValue( &p, cppu::UnoType<XPerformanceTest>::get() ); } if (! aRet.hasValue()) { void * p = (XPerformanceTest *)this; - Any aDummy( &p, ::getCppuType( (const Reference< XPerformanceTest > *)0 ) ); + Any aDummy( &p, cppu::UnoType<XPerformanceTest>::get() ); } return aRet; } diff --git a/testtools/source/performance/ubtest.cxx b/testtools/source/performance/ubtest.cxx index 552eb4b49077..f1eabf2f7a8c 100644 --- a/testtools/source/performance/ubtest.cxx +++ b/testtools/source/performance/ubtest.cxx @@ -219,9 +219,9 @@ Reference< XSingleServiceFactory > loadLibComponentFactory( if (aCurrent2Env.is() && aEnv2Current.is()) { void * pSMgr = aCurrent2Env.mapInterface( - xSF.get(), ::getCppuType( (const Reference< XMultiServiceFactory > *)0 ) ); + xSF.get(), cppu::UnoType<XMultiServiceFactory>::get() ); void * pKey = aCurrent2Env.mapInterface( - xKey.get(), ::getCppuType( (const Reference< XRegistryKey > *)0 ) ); + xKey.get(), cppu::UnoType<XRegistryKey>::get() ); void * pSSF = (*((component_getFactoryFunc)pSym))( aImplName.getStr(), pSMgr, pKey ); @@ -235,7 +235,7 @@ Reference< XSingleServiceFactory > loadLibComponentFactory( { aEnv2Current.mapInterface( reinterpret_cast< void ** >( &xRet ), - pSSF, ::getCppuType( (const Reference< XSingleServiceFactory > *)0 ) ); + pSSF, cppu::UnoType<XSingleServiceFactory>::get() ); (*pEnv->pExtEnv->releaseInterface)( pEnv->pExtEnv, pSSF ); } } @@ -277,9 +277,9 @@ Reference< XSingleServiceFactory > loadLibComponentFactory( uno_Interface * pUComponentFactory = 0; uno_Interface * pUSFactory = (uno_Interface *)aCpp2Uno.mapInterface( - xSF.get(), ::getCppuType( (const Reference< XMultiServiceFactory > *)0 ) ); + xSF.get(), cppu::UnoType<XMultiServiceFactory>::get() ); uno_Interface * pUKey = (uno_Interface *)aCpp2Uno.mapInterface( - xKey.get(), ::getCppuType( (const Reference< XRegistryKey > *)0 ) ); + xKey.get(), cppu::UnoType<XRegistryKey>::get() ); pUComponentFactory = (*((CreateComponentFactoryFunc)pSym))( rImplName.getStr(), pUSFactory, pUKey ); @@ -293,7 +293,7 @@ Reference< XSingleServiceFactory > loadLibComponentFactory( { XSingleServiceFactory * pXFactory = (XSingleServiceFactory *)aUno2Cpp.mapInterface( - pUComponentFactory, ::getCppuType( (const Reference< XSingleServiceFactory > *)0 ) ); + pUComponentFactory, cppu::UnoType<XSingleServiceFactory>::get() ); (*pUComponentFactory->release)( pUComponentFactory ); if (pXFactory) @@ -385,7 +385,7 @@ static void createInstance( Reference< T > & rxOut, buf.append( "service instance \"" ); buf.append( rServiceName ); buf.append( "\" does not support demanded interface \"" ); - const Type & rType = ::getCppuType( (const Reference< T > *)0 ); + const Type & rType = cppu::UnoType<T>::get(); buf.append( rType.getTypeName() ); buf.append( "\"!" ); throw RuntimeException( buf.makeStringAndClear() ); @@ -563,8 +563,8 @@ static void benchmark( sal_Int64 i; sal_uInt32 tStart, tEnd; - const Type & rKnownType = ::getCppuType( (const Reference< XPerformanceTest > *)0 ); - const Type & rUnKnownType = ::getCppuType( (const Reference< XSet > *)0 ); + const Type & rKnownType = cppu::UnoType<XPerformanceTest>::get(); + const Type & rUnKnownType = cppu::UnoType<XSet>::get(); ComplexTypes aDummyStruct; @@ -1057,7 +1057,7 @@ sal_Int32 TestImpl::run( const Sequence< OUString > & rArgs ) Reference< XInterface > xMapped; Reference< XInterface > xDirect( getDirect() ); aMapping.mapInterface( reinterpret_cast< void ** >( &xMapped ), xDirect.get(), - ::getCppuType( &xDirect ) ); + cppu::UnoType<decltype(xDirect)>::get() ); if (! xMapped.is()) throw RuntimeException("mapping object failed!" ); |