diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-06-02 16:12:08 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-06-02 16:48:34 -0500 |
commit | acb7bd175abe6c7f793cc673feaab46c90b9a260 (patch) | |
tree | 206be73ecd4a2af07310e8efe348f9647382d331 /stoc/test | |
parent | targeted string re-work (diff) | |
download | core-acb7bd175abe6c7f793cc673feaab46c90b9a260.tar.gz core-acb7bd175abe6c7f793cc673feaab46c90b9a260.zip |
targeted string re-work
Change-Id: I145731d9f28faf0065f5960f2c5a32f27d8c8620
Diffstat (limited to 'stoc/test')
-rw-r--r-- | stoc/test/excomp/excomp.cxx | 22 | ||||
-rw-r--r-- | stoc/test/excomp/excomp1.cxx | 10 | ||||
-rw-r--r-- | stoc/test/excomp/excomp2.cxx | 10 | ||||
-rw-r--r-- | stoc/test/registry_tdprovider/testregistrytdprovider.cxx | 309 | ||||
-rw-r--r-- | stoc/test/tdmanager/testtdmanager.cxx | 73 | ||||
-rw-r--r-- | stoc/test/testcorefl.cxx | 137 | ||||
-rw-r--r-- | stoc/test/testsmgr.cxx | 2 |
7 files changed, 217 insertions, 346 deletions
diff --git a/stoc/test/excomp/excomp.cxx b/stoc/test/excomp/excomp.cxx index fb831c14ce74..0a2ab4e16ad7 100644 --- a/stoc/test/excomp/excomp.cxx +++ b/stoc/test/excomp/excomp.cxx @@ -70,35 +70,35 @@ OUString getExePath() SAL_IMPLEMENT_MAIN() { #ifdef UNX - OUString compName1(RTL_CONSTASCII_USTRINGPARAM("libexcomp1.so")); - OUString compName2(RTL_CONSTASCII_USTRINGPARAM("libexcomp2.so")); + OUString compName1("libexcomp1.so"); + OUString compName2("libexcomp2.so"); #else - OUString compName1(RTL_CONSTASCII_USTRINGPARAM("excomp1")); - OUString compName2(RTL_CONSTASCII_USTRINGPARAM("excomp2")); + OUString compName1("excomp1"); + OUString compName2("excomp2"); #endif OUString exePath( getExePath() ); OUString excompRdb(exePath); - excompRdb += OUString(RTL_CONSTASCII_USTRINGPARAM("excomp.rdb")); + excompRdb += OUString("excomp.rdb"); Reference< XMultiServiceFactory > xSMgr = ::cppu::createRegistryServiceFactory( excompRdb ); OSL_ENSURE( xSMgr.is(), "excomp error 0" ); typelib_TypeDescription* pTypeDesc = NULL; - OUString sType(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.XTextDocument")); + OUString sType("com.sun.star.text.XTextDocument"); typelib_typedescription_getByName( &pTypeDesc, sType.pData); // typelib_InterfaceTypeDescription* pInterDesc = (typelib_InterfaceTypeDescription*)pTypeDesc; - Reference< XInterface > xIFace = xSMgr->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration"))); + Reference< XInterface > xIFace = xSMgr->createInstance(OUString("com.sun.star.registry.ImplementationRegistration")); Reference< XImplementationRegistration > xImpReg( xIFace, UNO_QUERY); OSL_ENSURE( xImpReg.is(), "excomp error 1" ); try { - xImpReg->registerImplementation(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")), + xImpReg->registerImplementation(OUString("com.sun.star.loader.SharedLibrary"), compName1, Reference< XSimpleRegistry >() ); - xImpReg->registerImplementation(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")), + xImpReg->registerImplementation(OUString("com.sun.star.loader.SharedLibrary"), compName2, Reference< XSimpleRegistry >() ); } @@ -107,10 +107,10 @@ SAL_IMPLEMENT_MAIN() OSL_ENSURE( e.Message.getLength(), OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US).getStr() ); } - Reference< XTest > xTest1( xSMgr->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("example.ExampleComponent1"))), + Reference< XTest > xTest1( xSMgr->createInstance(OUString("example.ExampleComponent1")), UNO_QUERY); OSL_ENSURE( xTest1.is(), "excomp error 2" ); - Reference< XTest > xTest2( xSMgr->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("example.ExampleComponent2"))), + Reference< XTest > xTest2( xSMgr->createInstance(OUString("example.ExampleComponent2")), UNO_QUERY); OSL_ENSURE( xTest2.is(), "excomp error 3" ); diff --git a/stoc/test/excomp/excomp1.cxx b/stoc/test/excomp/excomp1.cxx index c22fb7afce25..c08a4559151d 100644 --- a/stoc/test/excomp/excomp1.cxx +++ b/stoc/test/excomp/excomp1.cxx @@ -93,7 +93,7 @@ OUString SAL_CALL ExampleComponent1Impl::getImplementationName( ) throw(RuntimeException) { Guard< Mutex > aGuard( m_mutex ); - return OUString( RTL_CONSTASCII_USTRINGPARAM(IMPLNAME1) ); + return OUString( IMPLNAME1 ); } //************************************************************************* @@ -120,7 +120,7 @@ Sequence<OUString> SAL_CALL ExampleComponent1Impl::getSupportedServiceNames( ) //************************************************************************* Sequence<OUString> SAL_CALL ExampleComponent1Impl::getSupportedServiceNames_Static( ) { - OUString aName( RTL_CONSTASCII_USTRINGPARAM(SERVICENAME1) ); + OUString aName( SERVICENAME1 ); return Sequence< OUString >( &aName, 1 ); } @@ -128,7 +128,7 @@ Sequence<OUString> SAL_CALL ExampleComponent1Impl::getSupportedServiceNames_Stat OUString SAL_CALL ExampleComponent1Impl::getMessage() throw(RuntimeException) { Guard< Mutex > aGuard( m_mutex ); - return OUString(RTL_CONSTASCII_USTRINGPARAM("Lalelu nur der Mann im Mond schaut zu ...")); + return OUString("Lalelu nur der Mann im Mond schaut zu ..."); } @@ -163,7 +163,7 @@ sal_Bool SAL_CALL component_writeInfo( // ExampleComponent1 Reference< XRegistryKey > xNewKey( reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( - OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLNAME1 "/UNO/SERVICES") ) ) ); + OUString( "/" IMPLNAME1 "/UNO/SERVICES" ) ) ); const Sequence< OUString > & rSNL = ::excomp_impl::ExampleComponent1Impl::getSupportedServiceNames_Static(); @@ -190,7 +190,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( { Reference< XSingleServiceFactory > xFactory( createSingleFactory( reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), - OUString( RTL_CONSTASCII_USTRINGPARAM(IMPLNAME1) ), + OUString( IMPLNAME1 ), ::excomp_impl::ExampleComponent1_CreateInstance, ::excomp_impl::ExampleComponent1Impl::getSupportedServiceNames_Static() ) ); diff --git a/stoc/test/excomp/excomp2.cxx b/stoc/test/excomp/excomp2.cxx index 6da256e9745f..2d5bc23705a2 100644 --- a/stoc/test/excomp/excomp2.cxx +++ b/stoc/test/excomp/excomp2.cxx @@ -163,7 +163,7 @@ OUString SAL_CALL ExampleComponent2Impl::getImplementationName( ) throw(RuntimeException) { Guard< Mutex > aGuard( m_mutex ); - return OUString( RTL_CONSTASCII_USTRINGPARAM(IMPLNAME2) ); + return OUString( IMPLNAME2 ); } //************************************************************************* @@ -190,7 +190,7 @@ Sequence<OUString> SAL_CALL ExampleComponent2Impl::getSupportedServiceNames( ) //************************************************************************* Sequence<OUString> SAL_CALL ExampleComponent2Impl::getSupportedServiceNames_Static( ) { - OUString aName( RTL_CONSTASCII_USTRINGPARAM(SERVICENAME2) ); + OUString aName( SERVICENAME2 ); return Sequence< OUString >( &aName, 1 ); } @@ -198,7 +198,7 @@ Sequence<OUString> SAL_CALL ExampleComponent2Impl::getSupportedServiceNames_Stat OUString SAL_CALL ExampleComponent2Impl::getMessage() throw(RuntimeException) { Guard< Mutex > aGuard( m_mutex ); - return OUString(RTL_CONSTASCII_USTRINGPARAM("Alle meine Entchen schwimmen auf dem See, schwimmen auf dem See ...")); + return OUString("Alle meine Entchen schwimmen auf dem See, schwimmen auf dem See ..."); } @@ -234,7 +234,7 @@ sal_Bool SAL_CALL component_writeInfo( // ExampleComponent2 Reference< XRegistryKey > xNewKey( reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( - OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLNAME2 "/UNO/SERVICES") ) ) ); + OUString( "/" IMPLNAME2 "/UNO/SERVICES" ) ) ); const Sequence< OUString > & rSNL = ::excomp2_impl::ExampleComponent2Impl::getSupportedServiceNames_Static(); @@ -261,7 +261,7 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( { Reference< XSingleServiceFactory > xFactory( createSingleFactory( reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), - OUString( RTL_CONSTASCII_USTRINGPARAM(IMPLNAME2) ), + OUString( IMPLNAME2 ), ::excomp2_impl::ExampleComponent2_CreateInstance, ::excomp2_impl::ExampleComponent2Impl::getSupportedServiceNames_Static() ) ); diff --git a/stoc/test/registry_tdprovider/testregistrytdprovider.cxx b/stoc/test/registry_tdprovider/testregistrytdprovider.cxx index 20ea509be5aa..1a3c1cd96069 100644 --- a/stoc/test/registry_tdprovider/testregistrytdprovider.cxx +++ b/stoc/test/registry_tdprovider/testregistrytdprovider.cxx @@ -136,12 +136,10 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) css::uno::Sequence< css::uno::Any > args(1); args[0] = css::uno::Reference< css::beans::XPropertySet >( factory, css::uno::UNO_QUERY_THROW)->getPropertyValue( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Registry"))); + rtl::OUString("Registry")); css::uno::Reference< css::container::XHierarchicalNameAccess > provider( factory->createInstanceWithArgumentsAndContext( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.stoc.RegistryTypeDescriptionProvider")), + rtl::OUString( "com.sun.star.comp.stoc.RegistryTypeDescriptionProvider"), args, m_context), css::uno::UNO_QUERY_THROW); @@ -154,87 +152,65 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) assertEqual< bool >( false, provider->hasByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("[][]boolean")))); + rtl::OUString( "[][]boolean"))); assertEqual< bool >( false, provider->hasByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Struct3<boolean,boolean>")))); + rtl::OUString( "test.registrytdprovider.Struct3<boolean,boolean>"))); assertEqual< bool >( false, provider->hasByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.uno.XComponentContext::getValueByName")))); + rtl::OUString( "com.sun.star.uno.XComponentContext::getValueByName"))); css::uno::Reference< css::reflection::XCompoundTypeDescription > exception; exception = css::uno::Reference< css::reflection::XCompoundTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.Exception"))), + rtl::OUString( "com.sun.star.uno.Exception")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_EXCEPTION, exception->getTypeClass()); - assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.Exception")), + assertEqual( rtl::OUString( "com.sun.star.uno.Exception"), exception->getName()); assertFalse(exception->getBaseType().is()); exception = css::uno::Reference< css::reflection::XCompoundTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.uno.RuntimeException"))), + rtl::OUString( "com.sun.star.uno.RuntimeException")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_EXCEPTION, exception->getTypeClass()); - assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException")), + assertEqual( rtl::OUString( "com.sun.star.uno.RuntimeException"), exception->getName()); - assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.Exception")), + assertEqual( rtl::OUString( "com.sun.star.uno.Exception"), exception->getBaseType()->getName()); css::uno::Reference< css::reflection::XStructTypeDescription > structure; structure = css::uno::Reference< css::reflection::XStructTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Struct2"))), + rtl::OUString( "test.registrytdprovider.Struct2")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_STRUCT, structure->getTypeClass()); - assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Struct2")), + assertEqual( rtl::OUString( "test.registrytdprovider.Struct2"), structure->getName()); assertFalse(structure->getBaseType().is()); assertEqual< sal_Int32 >(1, structure->getMemberTypes().getLength()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Struct1")), + rtl::OUString( "test.registrytdprovider.Struct1"), structure->getMemberTypes()[0]->getName()); assertEqual< sal_Int32 >(1, structure->getMemberNames().getLength()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("s1")), + rtl::OUString("s1"), structure->getMemberNames()[0]); assertEqual< sal_Int32 >(0, structure->getTypeParameters().getLength()); assertEqual< sal_Int32 >(0, structure->getTypeArguments().getLength()); structure = css::uno::Reference< css::reflection::XStructTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Struct3"))), + rtl::OUString( "test.registrytdprovider.Struct3")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_STRUCT, structure->getTypeClass()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Struct3")), + rtl::OUString( "test.registrytdprovider.Struct3"), structure->getName()); assertFalse(structure->getBaseType().is()); assertEqual< sal_Int32 >(1, structure->getMemberTypes().getLength()); @@ -242,47 +218,41 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) css::uno::TypeClass_UNKNOWN, structure->getMemberTypes()[0]->getTypeClass()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("U")), + rtl::OUString("U"), structure->getMemberTypes()[0]->getName()); assertEqual< sal_Int32 >(1, structure->getMemberNames().getLength()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("s2")), + rtl::OUString("s2"), structure->getMemberNames()[0]); assertEqual< sal_Int32 >(2, structure->getTypeParameters().getLength()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("T")), + rtl::OUString("T"), structure->getTypeParameters()[0]); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("U")), + rtl::OUString("U"), structure->getTypeParameters()[1]); assertEqual< sal_Int32 >(0, structure->getTypeArguments().getLength()); structure = css::uno::Reference< css::reflection::XStructTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Struct4"))), + rtl::OUString( "test.registrytdprovider.Struct4")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_STRUCT, structure->getTypeClass()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Struct4")), + rtl::OUString( "test.registrytdprovider.Struct4"), structure->getName()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Struct2")), + rtl::OUString( "test.registrytdprovider.Struct2"), structure->getBaseType()->getName()); assertEqual< sal_Int32 >(1, structure->getMemberTypes().getLength()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Struct3<" + rtl::OUString( "test.registrytdprovider.Struct3<" "test.registrytdprovider.Struct2," - "test.registrytdprovider.Struct3<boolean,any>>")), + "test.registrytdprovider.Struct3<boolean,any>>"), structure->getMemberTypes()[0]->getName()); assertEqual< sal_Int32 >(1, structure->getMemberNames().getLength()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("s2")), + rtl::OUString("s2"), structure->getMemberNames()[0]); assertEqual< sal_Int32 >(0, structure->getTypeParameters().getLength()); assertEqual< sal_Int32 >(0, structure->getTypeArguments().getLength()); @@ -293,22 +263,18 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) interface = css::uno::Reference< css::reflection::XInterfaceTypeDescription2 >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.XTest1"))), + rtl::OUString( "test.registrytdprovider.XTest1")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_INTERFACE, interface->getTypeClass()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.XTest1")), + rtl::OUString( "test.registrytdprovider.XTest1"), interface->getName()); css::uno::Sequence< css::uno::Reference< css::reflection::XTypeDescription > > bases( interface->getBaseTypes()); assertEqual< sal_Int32 >(1, bases.getLength()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.XInterface")), + rtl::OUString( "com.sun.star.uno.XInterface"), bases[0]->getName()); css::uno::Sequence< css::uno::Reference< css::reflection::XTypeDescription > > @@ -316,7 +282,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) assertEqual< sal_Int32 >(1, optionalBases.getLength()); assertEqual( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.XBase")), + "test.registrytdprovider.XBase"), optionalBases[0]->getName()); css::uno::Sequence< css::uno::Reference< @@ -341,16 +307,15 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) assertEqual( css::uno::TypeClass_INTERFACE_ATTRIBUTE, attribute->getTypeClass()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.XTest1::a1")), + rtl::OUString( "test.registrytdprovider.XTest1::a1"), attribute->getName()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("a1")), + rtl::OUString("a1"), attribute->getMemberName()); assertEqual< sal_Int32 >(3, attribute->getPosition()); assertEqual< bool >(false, attribute->isReadOnly()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("short")), + rtl::OUString("short"), attribute->getType()->getName()); assertEqual< bool >(true, attribute->isBound()); getExceptions = attribute->getGetExceptions(); @@ -364,39 +329,32 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) assertEqual( css::uno::TypeClass_INTERFACE_ATTRIBUTE, attribute->getTypeClass()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.XTest1::a2")), + rtl::OUString( "test.registrytdprovider.XTest1::a2"), attribute->getName()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("a2")), + rtl::OUString("a2"), attribute->getMemberName()); assertEqual< sal_Int32 >(4, attribute->getPosition()); assertEqual< bool >(false, attribute->isReadOnly()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("long")), + rtl::OUString("long"), attribute->getType()->getName()); assertEqual< bool >(false, attribute->isBound()); getExceptions = attribute->getGetExceptions(); assertEqual< sal_Int32 >(2, getExceptions.getLength()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.lang.WrappedTargetException")), + rtl::OUString( "com.sun.star.lang.WrappedTargetException"), getExceptions[0]->getName()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException")), + rtl::OUString( "com.sun.star.uno.RuntimeException"), getExceptions[1]->getName()); setExceptions = attribute->getSetExceptions(); assertEqual< sal_Int32 >(2, setExceptions.getLength()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.Exception")), + rtl::OUString( "com.sun.star.uno.Exception"), setExceptions[0]->getName()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.lang.WrappedTargetException")), + rtl::OUString( "com.sun.star.lang.WrappedTargetException"), setExceptions[1]->getName()); attribute = css::uno::Reference< @@ -406,23 +364,21 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) css::uno::TypeClass_INTERFACE_ATTRIBUTE, attribute->getTypeClass()); assertEqual( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.XTest1::a3")), + "test.registrytdprovider.XTest1::a3"), attribute->getName()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("a3")), + rtl::OUString("a3"), attribute->getMemberName()); assertEqual< sal_Int32 >(5, attribute->getPosition()); assertEqual< bool >(true, attribute->isReadOnly()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("hyper")), + rtl::OUString("hyper"), attribute->getType()->getName()); assertEqual< bool >(true, attribute->isBound()); getExceptions = attribute->getGetExceptions(); assertEqual< sal_Int32 >(1, getExceptions.getLength()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.lang.WrappedTargetException")), + rtl::OUString( "com.sun.star.lang.WrappedTargetException"), getExceptions[0]->getName()); setExceptions = attribute->getSetExceptions(); assertEqual< sal_Int32 >(0, setExceptions.getLength()); @@ -432,28 +388,26 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) members[3], css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_INTERFACE_METHOD, method->getTypeClass()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.XTest1::f1")), + rtl::OUString( "test.registrytdprovider.XTest1::f1"), method->getName()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("f1")), + rtl::OUString("f1"), method->getMemberName()); assertEqual< sal_Int32 >(6, method->getPosition()); assertEqual< bool >(false, method->isOneway()); assertEqual< sal_Int32 >(1, method->getParameters().getLength()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("p")), + rtl::OUString("p"), method->getParameters()[0]->getName()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("any")), + rtl::OUString("any"), method->getParameters()[0]->getType()->getName()); assertEqual< bool >(false, method->getParameters()[0]->isIn()); assertEqual< bool >(true, method->getParameters()[0]->isOut()); assertEqual< sal_Int32 >(0, method->getParameters()[0]->getPosition()); assertEqual< sal_Int32 >(1, method->getExceptions().getLength()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException")), + rtl::OUString( "com.sun.star.uno.RuntimeException"), method->getExceptions()[0]->getName()); method = css::uno::Reference< @@ -461,11 +415,10 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) members[4], css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_INTERFACE_METHOD, method->getTypeClass()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.XTest1::f2")), + rtl::OUString( "test.registrytdprovider.XTest1::f2"), method->getName()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("f2")), + rtl::OUString("f2"), method->getMemberName()); assertEqual< sal_Int32 >(7, method->getPosition()); assertEqual< bool >(true, method->isOneway()); @@ -475,19 +428,15 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) interface = css::uno::Reference< css::reflection::XInterfaceTypeDescription2 >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.XTest2"))), + rtl::OUString( "test.registrytdprovider.XTest2")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_INTERFACE, interface->getTypeClass()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.XTest2")), + rtl::OUString( "test.registrytdprovider.XTest2"), interface->getName()); assertEqual< sal_Int32 >(1, interface->getBaseTypes().getLength()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Typedef2")), + rtl::OUString( "test.registrytdprovider.Typedef2"), interface->getBaseTypes()[0]->getName()); assertEqual< sal_Int32 >(0, interface->getOptionalBaseTypes().getLength()); assertEqual< sal_Int32 >(0, interface->getMembers().getLength()); @@ -496,14 +445,11 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) service = css::uno::Reference< css::reflection::XServiceTypeDescription2 >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Service1"))), + rtl::OUString( "test.registrytdprovider.Service1")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_SERVICE, service->getTypeClass()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Service1")), + rtl::OUString( "test.registrytdprovider.Service1"), service->getName()); assertEqual< sal_Int32 >(0, service->getMandatoryServices().getLength()); assertEqual< sal_Int32 >(0, service->getOptionalServices().getLength()); @@ -512,26 +458,26 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) assertEqual< bool >(true, service->isSingleInterfaceBased()); assertEqual( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.XTest1")), + "test.registrytdprovider.XTest1"), service->getInterface()->getName()); assertEqual< sal_Int32 >(2, service->getConstructors().getLength()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("c1")), + rtl::OUString("c1"), service->getConstructors()[0]->getName()); assertEqual< sal_Int32 >( 0, service->getConstructors()[0]->getParameters().getLength()); assertEqual< sal_Int32 >( 0, service->getConstructors()[0]->getExceptions().getLength()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("c2")), + rtl::OUString("c2"), service->getConstructors()[1]->getName()); assertEqual< sal_Int32 >( 1, service->getConstructors()[1]->getParameters().getLength()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("p")), + rtl::OUString("p"), service->getConstructors()[1]->getParameters()[0]->getName()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("any")), + rtl::OUString("any"), (service->getConstructors()[1]->getParameters()[0]->getType()-> getName())); assertEqual< bool >( @@ -546,32 +492,26 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) assertEqual< sal_Int32 >( 1, service->getConstructors()[1]->getExceptions().getLength()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.uno.RuntimeException")), + rtl::OUString( "com.sun.star.uno.RuntimeException"), service->getConstructors()[1]->getExceptions()[0]->getName()); service = css::uno::Reference< css::reflection::XServiceTypeDescription2 >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Service2"))), + rtl::OUString( "test.registrytdprovider.Service2")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_SERVICE, service->getTypeClass()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Service2")), + rtl::OUString( "test.registrytdprovider.Service2"), service->getName()); assertEqual< sal_Int32 >(0, service->getMandatoryServices().getLength()); assertEqual< sal_Int32 >(0, service->getOptionalServices().getLength()); assertEqual< sal_Int32 >(1, service->getMandatoryInterfaces().getLength()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.XTest1")), + rtl::OUString( "test.registrytdprovider.XTest1"), service->getMandatoryInterfaces()[0]->getName()); assertEqual< sal_Int32 >(1, service->getOptionalInterfaces().getLength()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.XBase")), + rtl::OUString( "test.registrytdprovider.XBase"), service->getOptionalInterfaces()[0]->getName()); assertEqual< bool >(false, service->isSingleInterfaceBased()); assertFalse(service->getInterface().is()); @@ -579,14 +519,12 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) service = css::uno::Reference< css::reflection::XServiceTypeDescription2 >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Service3"))), + rtl::OUString( "test.registrytdprovider.Service3")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_SERVICE, service->getTypeClass()); assertEqual( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Service3")), + "test.registrytdprovider.Service3"), service->getName()); assertEqual< sal_Int32 >(0, service->getMandatoryServices().getLength()); assertEqual< sal_Int32 >(0, service->getOptionalServices().getLength()); @@ -595,7 +533,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) assertEqual< bool >(true, service->isSingleInterfaceBased()); assertEqual( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Typedef2")), + "test.registrytdprovider.Typedef2"), service->getInterface()->getName()); assertEqual< sal_Int32 >(0, service->getConstructors().getLength()); @@ -605,37 +543,33 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) singleton = css::uno::Reference< css::reflection::XSingletonTypeDescription2 >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Singleton1"))), + rtl::OUString( "test.registrytdprovider.Singleton1")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_SINGLETON, singleton->getTypeClass()); assertEqual( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Singleton1")), + "test.registrytdprovider.Singleton1"), singleton->getName()); assertFalse(singleton->getService().is()); assertEqual< bool >(true, singleton->isInterfaceBased()); assertEqual( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.XTest1")), + "test.registrytdprovider.XTest1"), singleton->getInterface()->getName()); singleton = css::uno::Reference< css::reflection::XSingletonTypeDescription2 >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Singleton2"))), + rtl::OUString( "test.registrytdprovider.Singleton2")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_SINGLETON, singleton->getTypeClass()); assertEqual( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Singleton2")), + "test.registrytdprovider.Singleton2"), singleton->getName()); assertEqual( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Service1")), + "test.registrytdprovider.Service1"), singleton->getService()->getName()); assertEqual< bool >(false, singleton->isInterfaceBased()); assertFalse(singleton->getInterface().is()); @@ -643,29 +577,25 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) singleton = css::uno::Reference< css::reflection::XSingletonTypeDescription2 >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Singleton3"))), + rtl::OUString( "test.registrytdprovider.Singleton3")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_SINGLETON, singleton->getTypeClass()); assertEqual( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Singleton3")), + "test.registrytdprovider.Singleton3"), singleton->getName()); assertFalse(singleton->getService().is()); assertEqual< bool >(true, singleton->isInterfaceBased()); assertEqual( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.Typedef2")), + "test.registrytdprovider.Typedef2"), singleton->getInterface()->getName()); css::uno::Reference< css::reflection::XPublished > published; published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Enum1"))), + rtl::OUString( "test.registrytdprovider.Enum1")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -673,9 +603,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Enum2"))), + rtl::OUString( "test.registrytdprovider.Enum2")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -683,9 +611,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Struct1"))), + rtl::OUString( "test.registrytdprovider.Struct1")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -693,9 +619,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Struct2"))), + rtl::OUString( "test.registrytdprovider.Struct2")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -703,9 +627,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Struct3"))), + rtl::OUString( "test.registrytdprovider.Struct3")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -713,18 +635,14 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XStructTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Struct3"))), + rtl::OUString( "test.registrytdprovider.Struct3")), css::uno::UNO_QUERY_THROW)->getMemberTypes()[0], css::uno::UNO_QUERY); assertFalse(published.is()); published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Struct3a"))), + rtl::OUString( "test.registrytdprovider.Struct3a")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -732,9 +650,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Exception1"))), + rtl::OUString( "test.registrytdprovider.Exception1")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -742,9 +658,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Exception2"))), + rtl::OUString( "test.registrytdprovider.Exception2")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -752,9 +666,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.XTest1"))), + rtl::OUString( "test.registrytdprovider.XTest1")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -762,9 +674,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.XTest2"))), + rtl::OUString( "test.registrytdprovider.XTest2")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -772,9 +682,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Typedef1"))), + rtl::OUString( "test.registrytdprovider.Typedef1")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -782,9 +690,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Typedef2"))), + rtl::OUString( "test.registrytdprovider.Typedef2")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -796,9 +702,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Consts1"))), + rtl::OUString( "test.registrytdprovider.Consts1")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -806,9 +710,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Consts2"))), + rtl::OUString( "test.registrytdprovider.Consts2")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -816,17 +718,14 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider"))), + rtl::OUString( "test.registrytdprovider")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertFalse(published.is()); published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Service1"))), + rtl::OUString( "test.registrytdprovider.Service1")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -834,9 +733,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Service2"))), + rtl::OUString( "test.registrytdprovider.Service2")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -844,9 +741,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Singleton2"))), + rtl::OUString( "test.registrytdprovider.Singleton2")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -854,9 +749,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) published = css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( provider->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.registrytdprovider.Singleton1"))), + rtl::OUString( "test.registrytdprovider.Singleton1")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY); assertTrue(published.is()); @@ -866,7 +759,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const &) } rtl::OUString Service::getImplementationName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("test.registrytdprovider.impl")); + return rtl::OUString("test.registrytdprovider.impl"); } css::uno::Sequence< rtl::OUString > Service::getSupportedServiceNames() { @@ -902,9 +795,9 @@ namespace { bool writeInfo(void * registryKey, rtl::OUString const & implementationName, css::uno::Sequence< rtl::OUString > const & serviceNames) { - rtl::OUString keyName(RTL_CONSTASCII_USTRINGPARAM("/")); + rtl::OUString keyName("/"); keyName += implementationName; - keyName += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); + keyName += rtl::OUString("/UNO/SERVICES"); css::uno::Reference< css::registry::XRegistryKey > key; try { key = static_cast< css::registry::XRegistryKey * >(registryKey)-> diff --git a/stoc/test/tdmanager/testtdmanager.cxx b/stoc/test/tdmanager/testtdmanager.cxx index 9789f20520bd..69bc43e0708d 100644 --- a/stoc/test/tdmanager/testtdmanager.cxx +++ b/stoc/test/tdmanager/testtdmanager.cxx @@ -134,9 +134,8 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const & arguments) css::uno::Reference< css::container::XHierarchicalNameAccess > manager( m_context->getValueByName( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "/singletons/" - "com.sun.star.reflection.theTypeDescriptionManager"))), + "com.sun.star.reflection.theTypeDescriptionManager")), css::uno::UNO_QUERY_THROW); //////////////////////////////////////// @@ -155,17 +154,15 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const & arguments) css::uno::Reference<css::registry::XSimpleRegistry> xReg( m_context->getServiceManager()->createInstanceWithContext( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.registry.SimpleRegistry") ), + rtl::OUString( "com.sun.star.registry.SimpleRegistry" ), m_context ), css::uno::UNO_QUERY_THROW ); xReg->open( url, true /* read-only */, false /* ! create */ ); css::uno::Any arg( css::uno::makeAny(xReg) ); css::uno::Reference<css::container::XHierarchicalNameAccess> xTDprov( m_context->getServiceManager()-> createInstanceWithArgumentsAndContext( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.comp.stoc." - "RegistryTypeDescriptionProvider") ), + rtl::OUString( "com.sun.star.comp.stoc." + "RegistryTypeDescriptionProvider" ), css::uno::Sequence<css::uno::Any>( &arg, 1 ), m_context ), css::uno::UNO_QUERY_THROW ); try { @@ -186,79 +183,67 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const & arguments) css::uno::Reference< css::reflection::XIndirectTypeDescription > sequence( manager->getByHierarchicalName( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[][]boolean"))), + rtl::OUString("[][]boolean")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_SEQUENCE, sequence->getTypeClass()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[][]boolean")), + rtl::OUString("[][]boolean"), sequence->getName()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[]boolean")), + rtl::OUString("[]boolean"), sequence->getReferencedType()->getName()); css::uno::Reference< css::reflection::XStructTypeDescription > structure( manager->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.tdmanager.Struct<boolean,test.tdmanager.Struct<" - "any,com.sun.star.uno.XInterface>>"))), + rtl::OUString( "test.tdmanager.Struct<boolean,test.tdmanager.Struct<" + "any,com.sun.star.uno.XInterface>>")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_STRUCT, structure->getTypeClass()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.tdmanager.Struct<boolean,test.tdmanager.Struct<" - "any,com.sun.star.uno.XInterface>>")), + rtl::OUString( "test.tdmanager.Struct<boolean,test.tdmanager.Struct<" + "any,com.sun.star.uno.XInterface>>"), structure->getName()); assertEqual< bool >(false, structure->getBaseType().is()); assertEqual< sal_Int32 >(1, structure->getMemberTypes().getLength()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.tdmanager.Struct<any,com.sun.star.uno.XInterface>")), + rtl::OUString( "test.tdmanager.Struct<any,com.sun.star.uno.XInterface>"), structure->getMemberTypes()[0]->getName()); assertEqual< sal_Int32 >(1, structure->getMemberNames().getLength()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("s")), + rtl::OUString("s"), structure->getMemberNames()[0]); assertEqual< sal_Int32 >(0, structure->getTypeParameters().getLength()); assertEqual< sal_Int32 >(2, structure->getTypeArguments().getLength()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("boolean")), + rtl::OUString("boolean"), structure->getTypeArguments()[0]->getName()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "test.tdmanager.Struct<any,com.sun.star.uno.XInterface>")), + rtl::OUString( "test.tdmanager.Struct<any,com.sun.star.uno.XInterface>"), structure->getTypeArguments()[1]->getName()); css::uno::Reference< css::reflection::XInterfaceMethodTypeDescription > method( manager->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.uno.XComponentContext::getValueByName"))), + rtl::OUString( "com.sun.star.uno.XComponentContext::getValueByName")), css::uno::UNO_QUERY_THROW); assertEqual(css::uno::TypeClass_INTERFACE_METHOD, method->getTypeClass()); assertEqual( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.uno.XComponentContext::getValueByName")), + rtl::OUString( "com.sun.star.uno.XComponentContext::getValueByName"), method->getName()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("getValueByName")), + rtl::OUString("getValueByName"), method->getMemberName()); assertEqual< sal_Int32 >(3, method->getPosition()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("any")), + rtl::OUString("any"), method->getReturnType()->getName()); assertEqual< bool >(false, method->isOneway()); assertEqual< sal_Int32 >(1, method->getParameters().getLength()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), + rtl::OUString("Name"), method->getParameters()[0]->getName()); assertEqual( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("string")), + rtl::OUString("string"), method->getParameters()[0]->getType()->getName()); assertEqual< bool >(true, method->getParameters()[0]->isIn()); assertEqual< bool >(false, method->getParameters()[0]->isOut()); @@ -269,25 +254,21 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const & arguments) css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( manager->getByHierarchicalName( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("[]boolean"))), + rtl::OUString("[]boolean")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY).is()); assertFalse( css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( manager->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.beans.XIntroTest::ObjectName"))), + rtl::OUString( "com.sun.star.beans.XIntroTest::ObjectName")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY).is()); assertFalse( css::uno::Reference< css::reflection::XPublished >( css::uno::Reference< css::reflection::XTypeDescription >( manager->getByHierarchicalName( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.beans.XIntroTest::writeln"))), + rtl::OUString( "com.sun.star.beans.XIntroTest::writeln")), css::uno::UNO_QUERY_THROW), css::uno::UNO_QUERY).is()); //TODO: check that the reflection of a property of an accumulation-based @@ -297,7 +278,7 @@ sal_Int32 Service::run(css::uno::Sequence< rtl::OUString > const & arguments) } rtl::OUString Service::getImplementationName() { - return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("test.tdmanager.impl")); + return rtl::OUString("test.tdmanager.impl"); } css::uno::Sequence< rtl::OUString > Service::getSupportedServiceNames() { @@ -333,9 +314,9 @@ namespace { bool writeInfo(void * registryKey, rtl::OUString const & implementationName, css::uno::Sequence< rtl::OUString > const & serviceNames) { - rtl::OUString keyName(RTL_CONSTASCII_USTRINGPARAM("/")); + rtl::OUString keyName("/"); keyName += implementationName; - keyName += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES")); + keyName += rtl::OUString("/UNO/SERVICES"); css::uno::Reference< css::registry::XRegistryKey > key; try { key = static_cast< css::registry::XRegistryKey * >(registryKey)-> diff --git a/stoc/test/testcorefl.cxx b/stoc/test/testcorefl.cxx index 4a40bd2a54a6..e00cc9210bf2 100644 --- a/stoc/test/testcorefl.cxx +++ b/stoc/test/testcorefl.cxx @@ -101,23 +101,23 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl ) Reference< XHierarchicalNameAccess > xHNameAccess( xRefl, UNO_QUERY ); OSL_ENSURE(xHNameAccess.is(), "### cannot get XHierarchicalNameAccess!" ); - OSL_ENSURE(xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructA")))->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructA")), "test_RegCoreReflection(): error 2b"); - OSL_ENSURE(xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.ExceptionB")))->getTypeClass() == TypeClass_EXCEPTION, "test_RegCoreReflection(): error 2c"); - OSL_ENSURE(xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.ModuleB.EnumA"))).is(), "test_RegCoreReflection(): error 2e"); + OSL_ENSURE(xRefl->forName(OUString("ModuleA.StructA"))->getName() == OUString("ModuleA.StructA"), "test_RegCoreReflection(): error 2b"); + OSL_ENSURE(xRefl->forName(OUString("ModuleA.ExceptionB"))->getTypeClass() == TypeClass_EXCEPTION, "test_RegCoreReflection(): error 2c"); + OSL_ENSURE(xRefl->forName(OUString("ModuleA.ModuleB.EnumA")).is(), "test_RegCoreReflection(): error 2e"); // const - OSL_ENSURE(*(const sal_Bool *)xHNameAccess->getByHierarchicalName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.aConstBoolean"))).getValue() == aConstBoolean, "test_RegCoreReflection(): error 4c"); - OSL_ENSURE(*(const sal_Int8 *)xHNameAccess->getByHierarchicalName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.aConstByte"))).getValue() == aConstByte, "test_RegCoreReflection(): error 4e"); - OSL_ENSURE(xHNameAccess->getByHierarchicalName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.aConstShort"))) == aConstShort, "test_RegCoreReflection(): error 4g"); - OSL_ENSURE(xHNameAccess->getByHierarchicalName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.aConstUShort"))) == aConstUShort, "test_RegCoreReflection(): error 4i"); - OSL_ENSURE(xHNameAccess->getByHierarchicalName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.aConstLong"))) == aConstLong, "test_RegCoreReflection(): error 4k"); - OSL_ENSURE(xHNameAccess->getByHierarchicalName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.aConstULong"))) == aConstULong, "test_RegCoreReflection(): error 4m"); -// OSL_ENSURE(xHNameAccess->getByHierarchicalName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.aConstFloat"))) == aConstFloat, "test_RegCoreReflection(): error 4o"); -// OSL_ENSURE(xHNameAccess->getByHierarchicalName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.aConstDouble"))) == aConstDouble, "test_RegCoreReflection(): error 4q"); + OSL_ENSURE(*(const sal_Bool *)xHNameAccess->getByHierarchicalName(OUString("ModuleC.aConstBoolean")).getValue() == aConstBoolean, "test_RegCoreReflection(): error 4c"); + OSL_ENSURE(*(const sal_Int8 *)xHNameAccess->getByHierarchicalName(OUString("ModuleC.aConstByte")).getValue() == aConstByte, "test_RegCoreReflection(): error 4e"); + OSL_ENSURE(xHNameAccess->getByHierarchicalName(OUString("ModuleC.aConstShort")) == aConstShort, "test_RegCoreReflection(): error 4g"); + OSL_ENSURE(xHNameAccess->getByHierarchicalName(OUString("ModuleC.aConstUShort")) == aConstUShort, "test_RegCoreReflection(): error 4i"); + OSL_ENSURE(xHNameAccess->getByHierarchicalName(OUString("ModuleC.aConstLong")) == aConstLong, "test_RegCoreReflection(): error 4k"); + OSL_ENSURE(xHNameAccess->getByHierarchicalName(OUString("ModuleC.aConstULong")) == aConstULong, "test_RegCoreReflection(): error 4m"); +// OSL_ENSURE(xHNameAccess->getByHierarchicalName(OUString("ModuleC.aConstFloat")) == aConstFloat, "test_RegCoreReflection(): error 4o"); +// OSL_ENSURE(xHNameAccess->getByHierarchicalName(OUString("ModuleC.aConstDouble")) == aConstDouble, "test_RegCoreReflection(): error 4q"); // Enums - xClass = xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.ModuleB.EnumA"))); + xClass = xRefl->forName(OUString("ModuleA.ModuleB.EnumA")); OSL_ENSURE(xClass.is(), "test_RegCoreReflection(): error 5"); @@ -125,26 +125,26 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl ) OSL_ENSURE( (fields.getLength() == 3) && - (fields.getArray()[0]->getName() == OUString( RTL_CONSTASCII_USTRINGPARAM("VAL_1") )) && + (fields.getArray()[0]->getName() == OUString( "VAL_1" )) && (*(EnumA*)fields.getArray()[0]->get(Any()).getValue() == EnumA_VAL_1) && - (fields.getArray()[1]->getName() == OUString( RTL_CONSTASCII_USTRINGPARAM("VAL_2") )) && + (fields.getArray()[1]->getName() == OUString( "VAL_2" )) && (*(EnumA*)fields.getArray()[1]->get(Any()).getValue() == EnumA_VAL_2) && - (fields.getArray()[2]->getName() == OUString( RTL_CONSTASCII_USTRINGPARAM("VAL_3") )) && + (fields.getArray()[2]->getName() == OUString( "VAL_3" )) && (*(EnumA*)fields.getArray()[2]->get(Any()).getValue() == EnumA_VAL_3), "test_RegCoreReflection(): error 6"); // Interface - Reference< XIdlClass > xA = xRefl->forName( OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.XInterfaceB")) ); + Reference< XIdlClass > xA = xRefl->forName( OUString("ModuleC.XInterfaceB") ); - xClass = xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.XInterfaceB"))); + xClass = xRefl->forName(OUString("ModuleC.XInterfaceB")); OSL_ENSURE(xClass == xA, "test_RegCoreReflection(): error 7"); OSL_ENSURE(xClass.is(), "test_RegCoreReflection(): error 7a"); typelib_TypeDescription * pTD = 0; - OUString aModuleName( RTL_CONSTASCII_USTRINGPARAM("ModuleC.XInterfaceB") ); + OUString aModuleName( "ModuleC.XInterfaceB" ); typelib_typedescription_getByName( &pTD, aModuleName.pData ); OSL_ENSURE( pTD, "### cannot get typedescription for ModuleC.XInterfaceB!" ); @@ -154,60 +154,60 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl ) typelib_typedescription_release( pTD ); OSL_ENSURE(xClass->getSuperclasses().getLength() == 1, "test_RegCoreReflection(): error 9"); - OSL_ENSURE(xClass->getSuperclasses().getArray()[0]->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.XInterfaceA")), "test_RegCoreReflection(): error 10"); + OSL_ENSURE(xClass->getSuperclasses().getArray()[0]->getName() == OUString("ModuleC.XInterfaceA"), "test_RegCoreReflection(): error 10"); OSL_ENSURE(xClass->getMethods().getLength() == 7, "test_RegCoreReflection(): error 11"); OSL_ENSURE(xA->getMethods().getLength() == 7, "test_RegCoreReflection(): error 11a"); - OSL_ENSURE(xClass->getMethods().getArray()[3]->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("methodA")), "test_RegCoreReflection(): 12"); + OSL_ENSURE(xClass->getMethods().getArray()[3]->getName() == OUString("methodA"), "test_RegCoreReflection(): 12"); OSL_ENSURE(xClass->getMethods().getArray()[3]->getReturnType()->getTypeClass() == TypeClass_VOID, "test_RegCoreReflection(): error 13"); OSL_ENSURE(xClass->getMethods().getArray()[3]->getParameterTypes().getLength() == 0, "test_RegCoreReflection(): error 14"); OSL_ENSURE(xClass->getMethods().getArray()[3]->getExceptionTypes().getLength() == 0, "test_RegCoreReflection(): error 15"); - OSL_ENSURE(xClass->getMethods().getArray()[4]->getName() == OUString( RTL_CONSTASCII_USTRINGPARAM("methodB") ), "test_RegCoreReflection(): error 16"); + OSL_ENSURE(xClass->getMethods().getArray()[4]->getName() == OUString( "methodB" ), "test_RegCoreReflection(): error 16"); OSL_ENSURE(xClass->getMethods().getArray()[4]->getMode() == MethodMode_ONEWAY, "test_RegCoreReflection(): error 16a"); OSL_ENSURE(xClass->getMethods().getArray()[4]->getReturnType()->getTypeClass() == TypeClass_VOID, "test_RegCoreReflection(): error 16"); OSL_ENSURE(xClass->getMethods().getArray()[4]->getParameterTypes().getLength() == 1, "test_RegCoreReflection(): error 17"); OSL_ENSURE(xClass->getMethods().getArray()[4]->getParameterTypes().getArray()[0]->getTypeClass() == TypeClass_SHORT, "test_RegCoreReflection(): error 18"); - OSL_ENSURE(xClass->getMethods().getArray()[4]->getParameterInfos().getArray()[0].aName == OUString( RTL_CONSTASCII_USTRINGPARAM("aShort") ), "test_RegCoreReflection(): error 18a"); - OSL_ENSURE(xClass->getMethods().getArray()[4]->getParameterInfos().getArray()[0].aType == xRefl->forName( OUString( RTL_CONSTASCII_USTRINGPARAM("short") ) ), "test_RegCoreReflection(): error 18b"); + OSL_ENSURE(xClass->getMethods().getArray()[4]->getParameterInfos().getArray()[0].aName == OUString( "aShort" ), "test_RegCoreReflection(): error 18a"); + OSL_ENSURE(xClass->getMethods().getArray()[4]->getParameterInfos().getArray()[0].aType == xRefl->forName( OUString( "short" ) ), "test_RegCoreReflection(): error 18b"); OSL_ENSURE(xClass->getMethods().getArray()[4]->getParameterInfos().getArray()[0].aMode == ParamMode_IN, "test_RegCoreReflection(): error 18c"); OSL_ENSURE(xClass->getMethods().getArray()[4]->getExceptionTypes().getLength() == 0, "test_RegCoreReflection(): error 19"); - OSL_ENSURE(xClass->getMethods().getArray()[5]->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("methodC")), "test_RegCoreReflection(): error 20"); + OSL_ENSURE(xClass->getMethods().getArray()[5]->getName() == OUString("methodC"), "test_RegCoreReflection(): error 20"); OSL_ENSURE(xClass->getMethods().getArray()[5]->getMode() == MethodMode_TWOWAY, "test_RegCoreReflection(): error 20a"); OSL_ENSURE(xClass->getMethods().getArray()[5]->getReturnType()->getTypeClass() == TypeClass_SEQUENCE, "test_RegCoreReflection(): error 21"); OSL_ENSURE(xClass->getMethods().getArray()[5]->getReturnType()->getComponentType()->getTypeClass() == TypeClass_STRUCT, "test_RegCoreReflection(): error 22"); - OSL_ENSURE(xClass->getMethods().getArray()[5]->getReturnType()->getComponentType()->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructB")), "test_RegCoreReflection(): error 23"); + OSL_ENSURE(xClass->getMethods().getArray()[5]->getReturnType()->getComponentType()->getName() == OUString("ModuleA.StructB"), "test_RegCoreReflection(): error 23"); OSL_ENSURE(xClass->getMethods().getArray()[5]->getParameterTypes().getLength() == 2, "test_RegCoreReflection(): error 24"); OSL_ENSURE(xClass->getMethods().getArray()[5]->getParameterTypes().getArray()[0]->getTypeClass() == TypeClass_STRUCT, "test_RegCoreReflection(): error 25"); - OSL_ENSURE(xClass->getMethods().getArray()[5]->getParameterTypes().getArray()[0]->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructC")), "test_RegCoreReflection(): error 26"); + OSL_ENSURE(xClass->getMethods().getArray()[5]->getParameterTypes().getArray()[0]->getName() == OUString("ModuleA.StructC"), "test_RegCoreReflection(): error 26"); OSL_ENSURE(xClass->getMethods().getArray()[5]->getParameterTypes().getArray()[1]->getTypeClass() == TypeClass_STRUCT, "test_RegCoreReflection(): error 27"); - OSL_ENSURE(xClass->getMethods().getArray()[5]->getParameterTypes().getArray()[1]->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructA")), "test_RegCoreReflection(): error 28"); + OSL_ENSURE(xClass->getMethods().getArray()[5]->getParameterTypes().getArray()[1]->getName() == OUString("ModuleA.StructA"), "test_RegCoreReflection(): error 28"); OSL_ENSURE(xClass->getMethods().getArray()[5]->getExceptionTypes().getLength() == 0, "test_RegCoreReflection(): error 29"); - OSL_ENSURE(xClass->getMethods().getArray()[6]->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("methodD")), "test_RegCoreReflection(): error 30"); + OSL_ENSURE(xClass->getMethods().getArray()[6]->getName() == OUString("methodD"), "test_RegCoreReflection(): error 30"); OSL_ENSURE(xClass->getMethods().getArray()[6]->getReturnType()->getTypeClass() == TypeClass_INTERFACE, "test_RegCoreReflection(): error 31"); - OSL_ENSURE(xClass->getMethods().getArray()[6]->getReturnType()->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.XInterfaceA")), "test_RegCoreReflection(): error 32"); + OSL_ENSURE(xClass->getMethods().getArray()[6]->getReturnType()->getName() == OUString("ModuleC.XInterfaceA"), "test_RegCoreReflection(): error 32"); OSL_ENSURE(xClass->getMethods().getArray()[6]->getParameterTypes().getLength() == 1, "test_RegCoreReflection(): error 33"); OSL_ENSURE(xClass->getMethods().getArray()[6]->getParameterTypes().getArray()[0]->getTypeClass() == TypeClass_ENUM, "test_RegCoreReflection(): error 34"); - OSL_ENSURE(xClass->getMethods().getArray()[6]->getParameterTypes().getArray()[0]->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.ModuleB.EnumA")), "test_RegCoreReflection(): error 35"); + OSL_ENSURE(xClass->getMethods().getArray()[6]->getParameterTypes().getArray()[0]->getName() == OUString("ModuleA.ModuleB.EnumA"), "test_RegCoreReflection(): error 35"); OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getLength() == 3, "test_RegCoreReflection(): error 36"); OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[0]->getTypeClass() == TypeClass_EXCEPTION, "test_RegCoreReflection(): error 37"); - OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[0]->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.ExceptionA")), "test_RegCoreReflection(): error 38"); + OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[0]->getName() == OUString("ModuleA.ExceptionA"), "test_RegCoreReflection(): error 38"); OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[1]->getTypeClass() == TypeClass_EXCEPTION, "test_RegCoreReflection(): error 38"); - OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[1]->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.ExceptionB")), "test_RegCoreReflection(): error 39"); + OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[1]->getName() == OUString("ModuleA.ExceptionB"), "test_RegCoreReflection(): error 39"); OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[2]->getTypeClass() == TypeClass_EXCEPTION, "test_RegCoreReflection(): error 40"); - OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[2]->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.ExceptionC")), "test_RegCoreReflection(): error 41"); + OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[2]->getName() == OUString("ModuleA.ExceptionC"), "test_RegCoreReflection(): error 41"); OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[2]->getFields().getLength() == 3, "test_RegCoreReflection(): error 42"); OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[2]->getFields().getArray()[0]->getType()->getTypeClass() == TypeClass_BOOLEAN, "test_RegCoreReflection(): error 43"); - OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[2]->getFields().getArray()[0]->getType()->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("boolean")), "test_RegCoreReflection(): error 43a"); + OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[2]->getFields().getArray()[0]->getType()->getName() == OUString("boolean"), "test_RegCoreReflection(): error 43a"); OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[2]->getFields().getArray()[1]->getType()->getTypeClass() == TypeClass_STRUCT, "test_RegCoreReflection(): error 44"); - OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[2]->getFields().getArray()[1]->getType()->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructC")), "test_RegCoreReflection(): error 45"); + OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[2]->getFields().getArray()[1]->getType()->getName() == OUString("ModuleA.StructC"), "test_RegCoreReflection(): error 45"); OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[2]->getFields().getArray()[2]->getType()->getTypeClass() == TypeClass_INTERFACE, "test_RegCoreReflection(): error 46"); - OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[2]->getFields().getArray()[2]->getType()->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.XInterface1")), "test_RegCoreReflection(): error 47"); + OSL_ENSURE(xClass->getMethods().getArray()[6]->getExceptionTypes().getArray()[2]->getFields().getArray()[2]->getType()->getName() == OUString("ModuleA.XInterface1"), "test_RegCoreReflection(): error 47"); // SequenceReflections - OSL_ENSURE(xRefl->forName( OUString(RTL_CONSTASCII_USTRINGPARAM("[]ModuleA.StructA")) )->getTypeClass() == TypeClass_SEQUENCE, "test_RegCoreReflection(): error 48"); - OSL_ENSURE(xRefl->forName( OUString(RTL_CONSTASCII_USTRINGPARAM("[]ModuleA.StructA")) )->getComponentType().is(), "test_RegCoreReflection(): error 49"); - OSL_ENSURE(xRefl->forName( OUString(RTL_CONSTASCII_USTRINGPARAM("[][]ModuleA.StructA")) )->getComponentType()->getComponentType()->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructA")), "test_RegCoreReflection(): error 50"); - OSL_ENSURE(xRefl->forName( OUString(RTL_CONSTASCII_USTRINGPARAM("[]com.sun.star.uno.XInterface")) ) == xRefl->forName(OUString( RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructC") ))->getField(OUString(RTL_CONSTASCII_USTRINGPARAM("aInterfaceSeq")))->getType(), "test_RegCoreReflection(): error 51"); + OSL_ENSURE(xRefl->forName( OUString("[]ModuleA.StructA") )->getTypeClass() == TypeClass_SEQUENCE, "test_RegCoreReflection(): error 48"); + OSL_ENSURE(xRefl->forName( OUString("[]ModuleA.StructA") )->getComponentType().is(), "test_RegCoreReflection(): error 49"); + OSL_ENSURE(xRefl->forName( OUString("[][]ModuleA.StructA") )->getComponentType()->getComponentType()->getName() == OUString("ModuleA.StructA"), "test_RegCoreReflection(): error 50"); + OSL_ENSURE(xRefl->forName( OUString("[]com.sun.star.uno.XInterface") ) == xRefl->forName(OUString( "ModuleA.StructC" ))->getField(OUString("aInterfaceSeq"))->getType(), "test_RegCoreReflection(): error 51"); StructC aStructC; aStructC.aLong = aConstLong; @@ -218,7 +218,7 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl ) Any aAny; - xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructC")))->getField(OUString(RTL_CONSTASCII_USTRINGPARAM("aInterfaceSeq")))->getType()->createObject(aAny); + xRefl->forName(OUString("ModuleA.StructC"))->getField(OUString("aInterfaceSeq"))->getType()->createObject(aAny); OSL_ENSURE(aAny.getValueType() == ::getCppuType( (const Sequence<Reference< XInterface > > *)0 ), "test_RegCoreReflection(): error 51a"); @@ -227,35 +227,35 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl ) sal_Int32 nLong = aConstLong * 2; aAny.setValue( &nLong, ::getCppuType( (const sal_Int32 *)0 ) ); - OSL_ENSURE(*(sal_Int32*)xRefl->forName(OUString( RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructA") ))->getField(OUString( RTL_CONSTASCII_USTRINGPARAM("aLong") ))->get( + OSL_ENSURE(*(sal_Int32*)xRefl->forName(OUString( "ModuleA.StructA" ))->getField(OUString( "aLong" ))->get( Any(&aStructC, ::getCppuType( (const StructC *)0 ))).getValue() == aConstLong, "test_RegCoreReflection(): error 52"); - OSL_ENSURE(xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructA")))->getField(OUString( RTL_CONSTASCII_USTRINGPARAM("aLong") ))->getAccessMode() == FieldAccessMode_READWRITE, "test_RegCoreReflection(): error 52a"); - Reference< XIdlField2 > rField ( xRefl->forName(OUString( RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructC") ))->getField(OUString( RTL_CONSTASCII_USTRINGPARAM("aLong") )) , UNO_QUERY ); + OSL_ENSURE(xRefl->forName(OUString("ModuleA.StructA"))->getField(OUString( "aLong" ))->getAccessMode() == FieldAccessMode_READWRITE, "test_RegCoreReflection(): error 52a"); + Reference< XIdlField2 > rField ( xRefl->forName(OUString( "ModuleA.StructC" ))->getField(OUString( "aLong" )) , UNO_QUERY ); rField->set(aStructAny, aAny); - OSL_ENSURE(*(sal_Int32*)xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructB")))->getField(OUString( RTL_CONSTASCII_USTRINGPARAM("aLong") ))->get(aStructAny).getValue() == *(sal_Int32*)aAny.getValue(), "test_RegCoreReflection(): error 53"); + OSL_ENSURE(*(sal_Int32*)xRefl->forName(OUString("ModuleA.StructB"))->getField(OUString( "aLong" ))->get(aStructAny).getValue() == *(sal_Int32*)aAny.getValue(), "test_RegCoreReflection(): error 53"); - xRefl->forName( OUString(RTL_CONSTASCII_USTRINGPARAM("[]ModuleA.StructA")) )->createObject(aAny); + xRefl->forName( OUString("[]ModuleA.StructA") )->createObject(aAny); OSL_ENSURE( aAny.getValueTypeName() == "[]ModuleA.StructA", "test_RegCoreReflection(): error 54" ); - xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("[][]ModuleA.StructA")))->createObject(aAny); + xRefl->forName(OUString("[][]ModuleA.StructA"))->createObject(aAny); OSL_ENSURE( aAny.getValueTypeName() == "[][]ModuleA.StructA", "test_RegCoreReflection(): error 56" ); -// xClass = xRefl->forName(OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.beans.XIntroTest") )); +// xClass = xRefl->forName(OUString( "com.sun.star.beans.XIntroTest" )); // OSL_ENSURE(xClass.is(), "test_RegCoreReflection(): error 58"); -// OSL_ENSURE(xClass->getMethod(OUString(RTL_CONSTASCII_USTRINGPARAM("getStrings")))->getReturnType()->getTypeClass() == TypeClass_SEQUENCE, "test_RegCoreReflection(): error 59"); -// OSL_ENSURE(xClass->getMethod(OUString(RTL_CONSTASCII_USTRINGPARAM("getStrings")))->getReturnType()->getComponentType()->getName() == OUString(RTL_CONSTASCII_USTRINGPARAM("string")), "test_RegCoreReflection(): error 60"); +// OSL_ENSURE(xClass->getMethod(OUString("getStrings"))->getReturnType()->getTypeClass() == TypeClass_SEQUENCE, "test_RegCoreReflection(): error 59"); +// OSL_ENSURE(xClass->getMethod(OUString("getStrings"))->getReturnType()->getComponentType()->getName() == OUString("string"), "test_RegCoreReflection(): error 60"); -// xClass->getMethod(OUString(RTL_CONSTASCII_USTRINGPARAM("getStrings")))->getReturnType()->createObject(aAny); +// xClass->getMethod(OUString("getStrings"))->getReturnType()->createObject(aAny); // OSL_ENSURE( aAny.getValueTypeName() == "[]string", "test_RegCoreReflection(): error 61" ); - OSL_ENSURE(xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("[][][]unsigned long")))->getComponentType()->getComponentType()->getComponentType()->getTypeClass() == TypeClass_UNSIGNED_LONG, "test_RegCoreReflection(): error 62"); + OSL_ENSURE(xRefl->forName(OUString("[][][]unsigned long"))->getComponentType()->getComponentType()->getComponentType()->getTypeClass() == TypeClass_UNSIGNED_LONG, "test_RegCoreReflection(): error 62"); try { fprintf( stderr, "%1\n" ); - Any bla = xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructC")))->getField(OUString(RTL_CONSTASCII_USTRINGPARAM("aString")))->get(Any()); + Any bla = xRefl->forName(OUString("ModuleA.StructC"))->getField(OUString("aString"))->get(Any()); OSL_ENSURE(sal_False, "test_RegCoreReflection(): error 63"); return sal_False; } @@ -269,9 +269,9 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl ) Any blup; blup <<= aStructC; Any gulp; - rField = Reference< XIdlField2 > ( xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructC")))->getField(OUString(RTL_CONSTASCII_USTRINGPARAM("aString"))) , UNO_QUERY); + rField = Reference< XIdlField2 > ( xRefl->forName(OUString("ModuleA.StructC"))->getField(OUString("aString")) , UNO_QUERY); rField->set( blup, gulp); -// xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructC")))->getField(OUString(RTL_CONSTASCII_USTRINGPARAM("aString")))->set(blup, gulp); +// xRefl->forName(OUString("ModuleA.StructC"))->getField(OUString("aString"))->set(blup, gulp); OSL_ENSURE(sal_False, "test_RegCoreReflection(): error 64"); return sal_False; } @@ -287,8 +287,8 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl ) Any blup; blup <<= aStructC; rField = Reference< XIdlField2 > ( - xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructC")))->getField(OUString(RTL_CONSTASCII_USTRINGPARAM("aString"))) , UNO_QUERY); - xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructC")))->getField(OUString(RTL_CONSTASCII_USTRINGPARAM("aString")))->set(blup, gulp); + xRefl->forName(OUString("ModuleA.StructC"))->getField(OUString("aString")) , UNO_QUERY); + xRefl->forName(OUString("ModuleA.StructC"))->getField(OUString("aString"))->set(blup, gulp); OSL_ENSURE(sal_False, "test_RegCoreReflection(): error 65"); return sal_False; } @@ -297,10 +297,10 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl ) } Any gulp; - gulp <<= OUString(OUString(RTL_CONSTASCII_USTRINGPARAM("Test"))); + gulp <<= OUString(OUString("Test")); Any blup; blup <<= aStructC; - xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleA.StructC")))->getField(OUString(RTL_CONSTASCII_USTRINGPARAM("aString")))->set(blup, gulp); + xRefl->forName(OUString("ModuleA.StructC"))->getField(OUString("aString"))->set(blup, gulp); Reference< XInterfaceA > xAI = new OInterfaceA(); @@ -311,7 +311,7 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl ) Any a; a <<= xAI; - Any bla = xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.XInterfaceA")))->getMethod(OUString(RTL_CONSTASCII_USTRINGPARAM("methodC")))->invoke(a, params); + Any bla = xRefl->forName(OUString("ModuleC.XInterfaceA"))->getMethod(OUString("methodC"))->invoke(a, params); OSL_ENSURE(sal_False, "test_RegCoreReflection(): error 66"); return sal_False; } @@ -329,7 +329,7 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl ) Any a; a <<= xAI; - Any bla = xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.XInterfaceA")))->getMethod(OUString(RTL_CONSTASCII_USTRINGPARAM("methodC")))->invoke(a, params); + Any bla = xRefl->forName(OUString("ModuleC.XInterfaceA"))->getMethod(OUString("methodC"))->invoke(a, params); } try { @@ -340,7 +340,7 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl ) Any a; a <<= xAI; - Any bla = xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.XInterfaceA")))->getMethod(OUString(RTL_CONSTASCII_USTRINGPARAM("methodC")))->invoke(a, params); + Any bla = xRefl->forName(OUString("ModuleC.XInterfaceA"))->getMethod(OUString("methodC"))->invoke(a, params); OSL_ENSURE(sal_False, "test_RegCoreReflection(): error 67"); return sal_False; } @@ -355,7 +355,7 @@ static sal_Bool test_corefl( const Reference< XIdlReflection > & xRefl ) Any a; a <<= xAI; - bool result = (xRefl->forName(OUString(RTL_CONSTASCII_USTRINGPARAM("ModuleC.XInterfaceA")))->getMethod(OUString(RTL_CONSTASCII_USTRINGPARAM("methodC")))->invoke(a, params).getValueType() + bool result = (xRefl->forName(OUString("ModuleC.XInterfaceA"))->getMethod(OUString("methodC"))->invoke(a, params).getValueType() == ::getCppuType( (const Sequence<StructB> *)0 )); (void)result; OSL_ENSURE(result, "test_RegCoreReflection(): error 68"); @@ -367,25 +367,22 @@ SAL_IMPLEMENT_MAIN() sal_Bool bSucc = sal_False; try { - OUString aLibName( RTL_CONSTASCII_USTRINGPARAM( - "reflection.uno" SAL_DLLEXTENSION) ); + OUString aLibName( "reflection.uno" SAL_DLLEXTENSION ); Reference< XMultiServiceFactory > xMgr( createRegistryServiceFactory( - OUString( RTL_CONSTASCII_USTRINGPARAM("stoctest.rdb") ) ) ); + OUString( "stoctest.rdb" ) ) ); Reference< XComponentContext > xContext; Reference< beans::XPropertySet > xProps( xMgr, UNO_QUERY ); OSL_ASSERT( xProps.is() ); xProps->getPropertyValue( - OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= + OUString( "DefaultContext" ) ) >>= xContext; OSL_ASSERT( xContext.is() ); Reference< XIdlReflection > xRefl; xContext->getValueByName( - OUString( - RTL_CONSTASCII_USTRINGPARAM( - "/singletons/com.sun.star.reflection.theCoreReflection")) ) + OUString( "/singletons/com.sun.star.reflection.theCoreReflection") ) >>= xRefl; OSL_ENSURE( xRefl.is(), "### CoreReflection singleton not accessable!?" ); diff --git a/stoc/test/testsmgr.cxx b/stoc/test/testsmgr.cxx index 424b16d4c3c3..276c2b5bdfd5 100644 --- a/stoc/test/testsmgr.cxx +++ b/stoc/test/testsmgr.cxx @@ -72,7 +72,7 @@ void setStarUserRegistry() RegistryKey rootKey, rKey, rKey2; OUString userReg = getExePath(); - userReg += OUString(RTL_CONSTASCII_USTRINGPARAM("user.rdb")); + userReg += OUString("user.rdb"); if(myRegistry->open(userReg, REG_READWRITE)) { OSL_VERIFY(!myRegistry->create(userReg)); |