summaryrefslogtreecommitdiff
path: root/cppuhelper/test/testhelper.cxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-03-20 11:27:09 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-03-20 11:27:09 +0000
commit7ff06e3c0b9c474064ba5448d2104a2059466269 (patch)
tree2367af16de6371a9390ad23678ef9df79e8fe73b /cppuhelper/test/testhelper.cxx
parentdecc327e40e087680befba9dfed0eb1c30292f31 (diff)
INTEGRATION: CWS uno1 (1.9.6.1.6); FILE MERGED
2003/03/11 16:03:58 dbo 1.9.6.1.6.1: #107762# loading core uno component with full path; code cleanup
Diffstat (limited to 'cppuhelper/test/testhelper.cxx')
-rw-r--r--cppuhelper/test/testhelper.cxx66
1 files changed, 31 insertions, 35 deletions
diff --git a/cppuhelper/test/testhelper.cxx b/cppuhelper/test/testhelper.cxx
index 68e223a64086..2ce322d1ca4d 100644
--- a/cppuhelper/test/testhelper.cxx
+++ b/cppuhelper/test/testhelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: testhelper.cxx,v $
*
- * $Revision: 1.10 $
+ * $Revision: 1.11 $
*
- * last change: $Author: hr $ $Date: 2003-03-19 17:23:42 $
+ * last change: $Author: vg $ $Date: 2003-03-20 12:27:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -86,51 +86,47 @@ int main( int argc, char * argv[] )
int __cdecl main( int argc, char * argv[] )
#endif
{
- Reference< XMultiComponentFactory > xMgr( createRegistryServiceFactory(
- OUString( RTL_CONSTASCII_USTRINGPARAM("cpputest.rdb") ) ), UNO_QUERY );
- Reference< XComponentContext > xInitialContext;
- OSL_VERIFY( Reference< beans::XPropertySet >( xMgr, UNO_QUERY )->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xInitialContext );
-
- ContextEntry_Init aEntry;
- aEntry.bLateInitService = false;
- aEntry.name = OUString( RTL_CONSTASCII_USTRINGPARAM("bla, bla") );
- aEntry.value = makeAny( (sal_Int32)5 );
- Reference< XComponentContext > xContext( createComponentContext( &aEntry, 1, xInitialContext ) );
- OSL_ASSERT( xContext->getServiceManager() != xMgr ); // must be wrapped one
- OSL_ASSERT(
- Reference< beans::XPropertySet >(
- xContext->getServiceManager(), UNO_QUERY )->getPropertyValue(
- OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) != xInitialContext );
-
- sal_Bool bSucc = sal_False;
try
{
+ Reference< XMultiComponentFactory > xMgr( createRegistryServiceFactory(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("cpputest.rdb") ) ), UNO_QUERY );
+ Reference< XComponentContext > xInitialContext;
+ OSL_VERIFY( Reference< beans::XPropertySet >( xMgr, UNO_QUERY )->getPropertyValue(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) >>= xInitialContext );
+
+ ContextEntry_Init aEntry;
+ aEntry.bLateInitService = false;
+ aEntry.name = OUString( RTL_CONSTASCII_USTRINGPARAM("bla, bla") );
+ aEntry.value = makeAny( (sal_Int32)5 );
+ Reference< XComponentContext > xContext( createComponentContext( &aEntry, 1, xInitialContext ) );
+ OSL_ASSERT( xContext->getServiceManager() != xMgr ); // must be wrapped one
+ OSL_ASSERT(
+ Reference< beans::XPropertySet >(
+ xContext->getServiceManager(), UNO_QUERY )->getPropertyValue(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ) != xInitialContext );
+
Reference< XMultiServiceFactory > x( xMgr, UNO_QUERY );
test_ImplHelper( x );
testPropertyTypeHelper();
testidlclass( x );
test_PropertySetHelper();
test_interfacecontainer();
+
+ OSL_VERIFY( xContext->getValueByName(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("bla, bla") ) ) == (sal_Int32)5 );
+ OSL_VERIFY( ! xInitialContext->getValueByName(
+ OUString( RTL_CONSTASCII_USTRINGPARAM("bla, bla") ) ).hasValue() );
+ Reference< XComponent >( xInitialContext, UNO_QUERY )->dispose();
+ xMgr.clear();
+ xContext.clear();
+ xInitialContext.clear();
}
- catch (Exception & rExc)
+ catch (Exception & exc)
{
- OSL_ENSURE( sal_False, "### exception occured!" );
- OString aMsg( OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) );
- OSL_TRACE( "### exception occured: " );
- OSL_TRACE( aMsg.getStr() );
- OSL_TRACE( "\n" );
+ OString cstr_msg( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) );
+ OSL_ENSURE( ! "exception occured: ", cstr_msg.getStr() );
}
- OSL_VERIFY( xContext->getValueByName(
- OUString( RTL_CONSTASCII_USTRINGPARAM("bla, bla") ) ) == (sal_Int32)5 );
- OSL_VERIFY( ! xInitialContext->getValueByName(
- OUString( RTL_CONSTASCII_USTRINGPARAM("bla, bla") ) ).hasValue() );
- Reference< XComponent >( xInitialContext, UNO_QUERY )->dispose();
- xMgr.clear();
- xContext.clear();
- xInitialContext.clear();
-
printf( "Test finished\n" );
return 0;
}