Move OSL_ENSURE(0,...) to OSL_FAIL(...)

This commit is contained in:
Thomas Arnhold 2011-03-12 12:10:42 +01:00
parent 629b05ac30
commit adc6fe00e3
50 changed files with 125 additions and 129 deletions

View File

@ -466,7 +466,7 @@ inline void SAL_CALL cppu_cppenv_computeObjectIdentifier(
}
catch (::com::sun::star::uno::RuntimeException &)
{
OSL_ENSURE( 0, "### RuntimeException occurred udring queryInterface()!" );
OSL_FAIL( "### RuntimeException occurred udring queryInterface()!" );
}
}
}

View File

@ -432,7 +432,7 @@ void cc50_solaris_intel_fillUnoException(
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString(
aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}

View File

@ -426,7 +426,7 @@ void cc50_solaris_sparc_fillUnoException(
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString(
aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}

View File

@ -306,7 +306,7 @@ namespace CPPU_CURRENT_NAMESPACE
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}
@ -327,7 +327,7 @@ namespace CPPU_CURRENT_NAMESPACE
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
}
else

View File

@ -299,7 +299,7 @@ namespace CPPU_CURRENT_NAMESPACE
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}
@ -320,7 +320,7 @@ namespace CPPU_CURRENT_NAMESPACE
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
}
else

View File

@ -303,7 +303,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}
@ -324,7 +324,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
}
else

View File

@ -299,7 +299,7 @@ namespace CPPU_CURRENT_NAMESPACE
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}
@ -320,7 +320,7 @@ namespace CPPU_CURRENT_NAMESPACE
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
}
else

View File

@ -290,7 +290,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if defined _DEBUG
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}
@ -311,7 +311,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if defined _DEBUG
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
}
else

View File

@ -293,7 +293,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if defined _DEBUG
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}
@ -314,7 +314,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if defined _DEBUG
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
}
else

View File

@ -303,7 +303,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}
@ -324,7 +324,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
}
else

View File

@ -294,7 +294,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}
@ -315,7 +315,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
}
else

View File

@ -314,7 +314,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}
@ -335,7 +335,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
}
else

View File

@ -294,7 +294,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}
@ -315,7 +315,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
}
else

View File

@ -292,7 +292,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if defined _DEBUG
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}
@ -313,7 +313,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if defined _DEBUG
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
}
else

View File

@ -279,7 +279,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
return;
}
@ -300,7 +300,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping
uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno );
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
}
else

View File

@ -148,8 +148,8 @@ static void s_stub_computeObjectIdentifier(va_list * pParam)
}
catch (::com::sun::star::uno::RuntimeException &)
{
OSL_ENSURE(
0, "### RuntimeException occurred udring queryInterface()!" );
OSL_FAIL(
"### RuntimeException occurred udring queryInterface()!" );
}
}
}

View File

@ -115,15 +115,14 @@ void SAL_CALL Mapping_map_to_uno(
OUStringToOString(
OUSTR("[jni_uno bridge error] ") + err.m_message,
RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr_msg.getStr() );
OSL_FAIL( cstr_msg.getStr() );
#else
(void) err; // unused
#endif
}
catch (::jvmaccess::VirtualMachine::AttachGuard::CreationException &)
{
OSL_ENSURE(
0,
OSL_FAIL(
"[jni_uno bridge error] attaching current thread "
"to java failed!" );
}
@ -185,15 +184,14 @@ void SAL_CALL Mapping_map_to_java(
OUStringToOString(
OUSTR("[jni_uno bridge error] ") + err.m_message,
RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr_msg.getStr() );
OSL_FAIL( cstr_msg.getStr() );
#else
(void) err; // unused
#endif
}
catch (::jvmaccess::VirtualMachine::AttachGuard::CreationException &)
{
OSL_ENSURE(
0,
OSL_FAIL(
"[jni_uno bridge error] attaching current thread to java failed!" );
}
}
@ -544,15 +542,14 @@ void SAL_CALL uno_ext_getMapping(
OUStringToOString(
OUSTR("[jni_uno bridge error] ") + err.m_message,
RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr_msg.getStr() );
OSL_FAIL( cstr_msg.getStr() );
#else
(void) err; // unused
#endif
}
catch (::jvmaccess::VirtualMachine::AttachGuard::CreationException &)
{
OSL_ENSURE(
0,
OSL_FAIL(
"[jni_uno bridge error] attaching current thread "
"to java failed!" );
}

View File

@ -630,7 +630,7 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call(
OString cstr_msg(
OUStringToOString(
buf.makeStringAndClear(), RTL_TEXTENCODING_JAVA_UTF8 ) );
OSL_ENSURE( 0, cstr_msg.getStr() );
OSL_FAIL( cstr_msg.getStr() );
if (jni->ThrowNew(jni_info->m_class_RuntimeException, cstr_msg.getStr())
!= 0)
{
@ -646,7 +646,7 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call(
"attaching current thread to java failed!") ) +
OUStringToOString(
jni.get_stack_trace(), RTL_TEXTENCODING_JAVA_UTF8 ) );
OSL_ENSURE( 0, cstr_msg.getStr() );
OSL_FAIL( cstr_msg.getStr() );
if (jni->ThrowNew(jni_info->m_class_RuntimeException, cstr_msg.getStr())
!= 0)
{

View File

@ -576,15 +576,14 @@ void SAL_CALL UNO_proxy_free( uno_ExtEnvironment * env, void * proxy )
#if OSL_DEBUG_LEVEL > 0
OString cstr_msg2(
OUStringToOString( err.m_message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr_msg2.getStr() );
OSL_FAIL( cstr_msg2.getStr() );
#else
(void) err; // unused
#endif
}
catch (::jvmaccess::VirtualMachine::AttachGuard::CreationException &)
{
OSL_ENSURE(
0,
OSL_FAIL(
"[jni_uno bridge error] attaching current thread to java failed!" );
}
@ -865,7 +864,7 @@ void SAL_CALL UNO_proxy_dispatch(
#if OSL_DEBUG_LEVEL > 0
OString cstr_msg2(
OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr_msg2.getStr() );
OSL_FAIL( cstr_msg2.getStr() );
#endif
}
}

View File

@ -383,7 +383,7 @@ static void SAL_CALL RemoteEnvironment_thisDisposing(
static void SAL_CALL RemoteEnvironment_thisComputeObjectIdentifier(
uno_ExtEnvironment *, rtl_uString **, void *)
{
OSL_ENSURE( 0, "RemoteEnvironment_thisComputeObjectIdentifier should never be called" );
OSL_FAIL( "RemoteEnvironment_thisComputeObjectIdentifier should never be called" );
}
static void SAL_CALL RemoteEnvironment_thisAcquireInterface(

View File

@ -369,7 +369,7 @@ void SAL_CALL PropertyObject::thisDispatch(
switch( pMethodType->aBase.nPosition )
{
case METHOD_QUERY_INTERFACE:
OSL_ENSURE( 0 , "not implemented yet !" );
OSL_FAIL( "not implemented yet !" );
break;
case METHOD_GET_PROPERTIES:
{
@ -388,7 +388,7 @@ void SAL_CALL PropertyObject::thisDispatch(
break;
}
default:
OSL_ENSURE( 0 , "unkown method !" );
OSL_FAIL( "unkown method !" );
}
}
@ -423,7 +423,7 @@ void SAL_CALL PropertyObject::localGetPropertiesFromRemote( struct Properties *p
if( pException )
{
OSL_ENSURE( 0 , "remote urp-bridge doesn't support property-object" );
OSL_FAIL( "remote urp-bridge doesn't support property-object" );
uno_any_destruct( pException , 0 );
return;
}
@ -433,7 +433,7 @@ void SAL_CALL PropertyObject::localGetPropertiesFromRemote( struct Properties *p
{
if( ! assignFromIdlToStruct( pR , pP[i] ) )
{
OSL_ENSURE( 0 , "unknown property !!!!" );
OSL_FAIL( "unknown property !!!!" );
}
}

View File

@ -115,7 +115,7 @@ inline sal_Bool OReaderThread::getMemberTypeDescription(
sMessage.appendAscii( "interface type is not of typeclass interface (" );
sMessage.append( (sal_Int32) pITypeRef->eTypeClass );
m_pBridgeImpl->addError( sMessage.makeStringAndClear() );
OSL_ENSURE( 0 , "type is not an interface" );
OSL_FAIL( "type is not an interface" );
return sal_False;
}
@ -128,7 +128,7 @@ inline sal_Bool OReaderThread::getMemberTypeDescription(
sMessage.appendAscii( "No typedescription can be retrieved for type " );
sMessage.append( OUString( pITypeRef->pTypeName ) );
m_pBridgeImpl->addError( sMessage.makeStringAndClear() );
OSL_ENSURE( 0 , "urp: unknown type " );
OSL_FAIL( "urp: unknown type " );
return sal_False;
}
@ -147,7 +147,7 @@ inline sal_Bool OReaderThread::getMemberTypeDescription(
sMessage.appendAscii( " )" );
m_pBridgeImpl->addError( sMessage.makeStringAndClear() );
OSL_ENSURE( 0 , "vtable index out of range" );
OSL_FAIL( "vtable index out of range" );
return sal_False;
}
@ -163,7 +163,7 @@ inline sal_Bool OReaderThread::getMemberTypeDescription(
sMessage.appendAscii( " )" );
m_pBridgeImpl->addError( sMessage.makeStringAndClear() );
OSL_ENSURE( 0 , "vtable index out of range" );
OSL_FAIL( "vtable index out of range" );
return sal_False;
}
@ -181,7 +181,7 @@ inline sal_Bool OReaderThread::getMemberTypeDescription(
sMessage.appendAscii( " )" );
m_pBridgeImpl->addError( sMessage.makeStringAndClear() );
OSL_ENSURE( 0 , "unknown method type description" );
OSL_FAIL( "unknown method type description" );
return sal_False;
}
@ -295,7 +295,7 @@ inline sal_Bool OReaderThread::readBlock( sal_Int32 *pnMessageCount )
s.append( (sal_Int64) (sal_uInt32 ) nSize );
s.append( sal_Unicode( ')' ) );
m_pBridgeImpl->addError( s.makeStringAndClear() );
OSL_ENSURE( 0 , "urp bridge: Packet-size too big" );
OSL_FAIL( "urp bridge: Packet-size too big" );
return sal_False;
}
@ -313,7 +313,7 @@ inline sal_Bool OReaderThread::readBlock( sal_Int32 *pnMessageCount )
s.append( (sal_Int64) (sal_uInt32 ) nSize );
s.append( sal_Unicode( ')' ) );
m_pBridgeImpl->addError( s.makeStringAndClear() );
OSL_ENSURE( 0 , "urp bridge: messages size too large, terminating connection" );
OSL_FAIL( "urp bridge: messages size too large, terminating connection" );
return sal_False;
}
@ -461,7 +461,7 @@ void OReaderThread::run()
if( ! readFlags( &flags ) )
{
m_pBridgeImpl->addError( "incomplete message, skipping block" );
OSL_ENSURE ( 0 , "urp-bridge : incomplete message, skipping block" );
OSL_FAIL( "urp-bridge : incomplete message, skipping block" );
break;
}
@ -494,7 +494,7 @@ void OReaderThread::run()
{
typelib_typedescriptionreference_release( pTypeRef );
m_pBridgeImpl->addError( "error during unpacking (maybe cached) interface type" );
OSL_ENSURE( 0 , "urp-bridge : error during unpacking interface type, terminating connection" );
OSL_FAIL( "urp-bridge : error during unpacking interface type, terminating connection" );
disposeEnvironment();
break;
}
@ -504,7 +504,7 @@ void OReaderThread::run()
sMessage.appendAscii( "interface type is not of typeclass interface (" );
sMessage.append( (sal_Int32) m_pBridgeImpl->m_lastInType.getTypeClass() );
m_pBridgeImpl->addError( sMessage.makeStringAndClear() );
OSL_ENSURE( 0 , "urp-bridge : not an interface type" );
OSL_FAIL( "urp-bridge : not an interface type" );
disposeEnvironment();
break;
}
@ -521,7 +521,7 @@ void OReaderThread::run()
{
rtl_uString_release( pOid );
m_pBridgeImpl->addError( "error during unpacking (maybe cached) oid" );
OSL_ENSURE( 0 , "urp-bridge : error during unpacking cached data, terminating connection" );
OSL_FAIL( "urp-bridge : error during unpacking cached data, terminating connection" );
disposeEnvironment();
break;
}
@ -540,7 +540,7 @@ void OReaderThread::run()
rtl_byte_sequence_release( pSeq );
m_pBridgeImpl->addError( "error during unpacking (maybe cached) tid" );
OSL_ENSURE( 0 , "urp-bridge : error during unpacking cached data, terminating connection" );
OSL_FAIL( "urp-bridge : error during unpacking cached data, terminating connection" );
disposeEnvironment();
break;
}

View File

@ -150,8 +150,8 @@ static OptionInfo const * get_option_info(
}
}
}
OSL_ENSURE(
0, OUStringToOString( opt, osl_getThreadTextEncoding() ).getStr() );
OSL_FAIL(
OUStringToOString( opt, osl_getThreadTextEncoding() ).getStr() );
return 0;
}
@ -449,7 +449,7 @@ SAL_IMPLEMENT_MAIN()
}
else
{
OSL_ENSURE( 0, "unhandled valid option?!" );
OSL_FAIL( "unhandled valid option?!" );
if (option_info->m_has_argument)
++nPos;
}

View File

@ -112,7 +112,7 @@ void SAL_CALL Mapping_cli2uno(
OString cstr_msg(
OUStringToOString(
OUSTR("[cli_uno bridge error] ") + err.m_message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr_msg.getStr() );
OSL_FAIL( cstr_msg.getStr() );
#else
(void) err; // unused
#endif
@ -171,7 +171,7 @@ void SAL_CALL Mapping_uno2cli(
rtl::OString cstr_msg(
rtl::OUStringToOString(
OUSTR("[cli_uno bridge error] ") + err.m_message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr_msg.getStr() );
OSL_FAIL( cstr_msg.getStr() );
#else
(void) err; // unused
#endif
@ -352,7 +352,7 @@ void SAL_CALL uno_ext_getMapping(
OString cstr_msg(
OUStringToOString(
OUSTR("[cli_uno bridge error] ") + err.m_message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr_msg.getStr() );
OSL_FAIL( cstr_msg.getStr() );
#else
(void) err; // unused
#endif

View File

@ -310,8 +310,8 @@ bool UnoInterfaceProxy::CanCastTo(System::Type* fromType,
catch (BridgeRuntimeError& e)
{
(void) e; // avoid warning
OSL_ENSURE(
0, OUStringToOString(
OSL_FAIL(
OUStringToOString(
e.m_message, RTL_TEXTENCODING_UTF8 ).getStr() );
}
catch (System::Exception* e)
@ -321,14 +321,14 @@ bool UnoInterfaceProxy::CanCastTo(System::Type* fromType,
S"UnoInterfaceProxy::CanCastTo(). Original"
S"message: \n");
msg= System::String::Concat(msg, e->get_Message());
OSL_ENSURE(
0, OUStringToOString(
OSL_FAIL(
OUStringToOString(
mapCliString(msg), RTL_TEXTENCODING_UTF8 ).getStr() );
}
catch (...)
{
OSL_ENSURE(
0, "An unexpected native C++ exception occurred in "
OSL_FAIL(
"An unexpected native C++ exception occurred in "
"UnoInterfaceProxy::CanCastTo()" );
}
__finally
@ -1172,7 +1172,7 @@ void SAL_CALL cli_proxy_dispatch(
#if OSL_DEBUG_LEVEL >= 1
OString cstr_msg(OUStringToOString(exc.Message,
RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE(0, cstr_msg.getStr());
OSL_FAIL(cstr_msg.getStr());
#endif
}
}

View File

@ -252,7 +252,7 @@ inline void _copyConstructAnyFromData(
*(typelib_TypeDescriptionReference **)&pDestAny->pReserved = *(typelib_TypeDescriptionReference **)pSource;
break;
case typelib_TypeClass_ANY:
OSL_ENSURE( 0, "### unexpected nested any!" );
OSL_FAIL( "### unexpected nested any!" );
break;
case typelib_TypeClass_ENUM:
pDestAny->pData = &pDestAny->pReserved;
@ -729,7 +729,7 @@ inline uno_Sequence * icopyConstructSequence(
break;
}
default:
OSL_ENSURE( 0, "### unexepcted sequence element type!" );
OSL_FAIL( "### unexepcted sequence element type!" );
pDest = 0;
break;
}

View File

@ -115,7 +115,7 @@ void * binuno_queryInterface( void * pUnoI, typelib_TypeDescriptionReference * p
buf.append( * reinterpret_cast< OUString const * >( pExc->pData ) );
OString cstr(
OUStringToOString( buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#endif
uno_any_destruct( pExc, 0 );
}

View File

@ -152,7 +152,7 @@ inline void _destructAny(
::rtl_freeMemory( pAny->pData );
break;
case typelib_TypeClass_TYPEDEF:
OSL_ENSURE( 0, "### unexpected typedef!" );
OSL_FAIL( "### unexpected typedef!" );
break;
case typelib_TypeClass_STRUCT:
case typelib_TypeClass_EXCEPTION:
@ -381,7 +381,7 @@ inline void _destructData(
_destructAny( (uno_Any *)pValue, release );
break;
case typelib_TypeClass_TYPEDEF:
OSL_ENSURE( 0, "### unexpected typedef!" );
OSL_FAIL( "### unexpected typedef!" );
break;
case typelib_TypeClass_STRUCT:
case typelib_TypeClass_EXCEPTION:

View File

@ -351,7 +351,7 @@ static inline bool idefaultConstructElements(
}
break;
default:
OSL_ENSURE( 0, "### unexpected element type!" );
OSL_FAIL( "### unexpected element type!" );
pSeq = 0;
break;
}
@ -665,7 +665,7 @@ static inline bool icopyConstructFromElements(
break;
}
default:
OSL_ENSURE( 0, "### unexpected element type!" );
OSL_FAIL( "### unexpected element type!" );
pSeq = 0;
break;
}

View File

@ -173,7 +173,7 @@ void addFactories(
buf.append( ppNames[ -2 ] );
buf.append( "\"!!!" );
OString str( buf.makeStringAndClear() );
OSL_ENSURE( 0, str.getStr() );
OSL_FAIL( str.getStr() );
}
#endif
}

View File

@ -106,7 +106,7 @@ void OComponentHelper::release() throw()
// release should not throw exceptions
#if OSL_DEBUG_LEVEL > 0
OString msg( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, msg.getStr() );
OSL_FAIL( msg.getStr() );
#else
(void) exc; // avoid warning about unused variable
#endif

View File

@ -851,7 +851,7 @@ extern "C" { static void s_createComponentContext_v(va_list * pParam)
catch (Exception & exc)
{
(void) exc; // avoid warning about unused variable
OSL_ENSURE( 0, OUStringToOString(
OSL_FAIL( OUStringToOString(
exc.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
xContext.clear();
}

View File

@ -170,7 +170,7 @@ void ExceptionThrower::release() throw ()
//______________________________________________________________________________
void ExceptionThrower::throwException( Any const & exc ) throw (Exception)
{
OSL_ENSURE( 0, "unexpected!" );
OSL_FAIL( "unexpected!" );
throwException( exc );
}

View File

@ -691,7 +691,7 @@ sal_Bool ORegistryFactoryHelper::convertFastPropertyValue(
Any &, Any &, sal_Int32, Any const & )
throw (lang::IllegalArgumentException)
{
OSL_ENSURE( 0, "unexpected!" );
OSL_FAIL( "unexpected!" );
return false;
}

View File

@ -66,7 +66,7 @@ static inline void checkInterface( Type const & rType )
OUString msg( buf.makeStringAndClear() );
#if OSL_DEBUG_LEVEL > 0
OString str( OUStringToOString( msg, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, str.getStr() );
OSL_FAIL( str.getStr() );
#endif
throw RuntimeException( msg, Reference< XInterface >() );
}
@ -116,7 +116,7 @@ static inline type_entry * __getTypeEntries( class_data * cd )
OUString msg( buf.makeStringAndClear() );
#if OSL_DEBUG_LEVEL > 0
OString str( OUStringToOString( msg, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, str.getStr() );
OSL_FAIL( str.getStr() );
#endif
throw RuntimeException( msg, Reference< XInterface >() );
}
@ -229,7 +229,7 @@ static inline void * __queryDeepNoXInterface(
OUString msg( buf.makeStringAndClear() );
#if OSL_DEBUG_LEVEL > 0
OString str( OUStringToOString( msg, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, str.getStr() );
OSL_FAIL( str.getStr() );
#endif
throw RuntimeException( msg, Reference< XInterface >() );
}

View File

@ -163,7 +163,7 @@ void testConnection( const OUString &sConnectionDescription ,
{
Sequence < sal_Int8 > seq(10);
r->write( seq );
OSL_ENSURE( 0 , "expected exception not thrown" );
OSL_FAIL( "expected exception not thrown" );
}
catch ( IOException & )
{
@ -171,7 +171,7 @@ void testConnection( const OUString &sConnectionDescription ,
}
catch ( ... )
{
OSL_ENSURE( 0 , "wrong exception was thrown" );
OSL_FAIL( "wrong exception was thrown" );
}
thread.join();
@ -231,7 +231,7 @@ int __cdecl main( int argc, char * argv[] )
try
{
rAcceptor->accept( OUString() );
OSL_ENSURE( 0 , "empty connection string" );
OSL_FAIL( "empty connection string" );
}
catch( IllegalArgumentException & )
{
@ -239,13 +239,13 @@ int __cdecl main( int argc, char * argv[] )
}
catch( ... )
{
OSL_ENSURE( 0, "unexpected akexception with empty connection string" );
OSL_FAIL( "unexpected akexception with empty connection string" );
}
try
{
rConnector->connect( OUString() );
OSL_ENSURE( 0 , "empty connection string" );
OSL_FAIL( "empty connection string" );
}
catch( ConnectionSetupException & )
{
@ -253,7 +253,7 @@ int __cdecl main( int argc, char * argv[] )
}
catch( ... )
{
OSL_ENSURE( 0, "unexpected exception with empty connection string" );
OSL_FAIL( "unexpected exception with empty connection string" );
}
@ -265,7 +265,7 @@ int __cdecl main( int argc, char * argv[] )
try
{
rAcceptor->accept( OUString(RTL_CONSTASCII_USTRINGPARAM("socket,host=localhost,port=2001")) );
OSL_ENSURE( 0 , "already existing exception expected" );
OSL_FAIL( "already existing exception expected" );
}
catch( AlreadyAcceptingException & e)
{
@ -273,7 +273,7 @@ int __cdecl main( int argc, char * argv[] )
}
catch( ... )
{
OSL_ENSURE( 0, "unknown exception, already existing existing expected" );
OSL_FAIL( "unknown exception, already existing existing expected" );
}
rAcceptor->stopAccepting();

View File

@ -267,7 +267,7 @@ bool VendorBase::needsRestart() const
int VendorBase::compareVersions(const rtl::OUString& /*sSecond*/) const
{
OSL_ENSURE(0, "[Java framework] VendorBase::compareVersions must be "
OSL_FAIL("[Java framework] VendorBase::compareVersions must be "
"overridden in derived class.");
return 0;
}

View File

@ -240,7 +240,7 @@ javaFrameworkError SAL_CALL jfw_findAllJREs(JavaInfo ***pparInfo, sal_Int32 *pSi
{
retVal = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return retVal;
}
@ -418,7 +418,7 @@ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 cOpti
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;
@ -627,7 +627,7 @@ javaFrameworkError SAL_CALL jfw_findAndSelectJRE(JavaInfo **pInfo)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;
@ -716,7 +716,7 @@ javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInfo)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;
}
@ -844,7 +844,7 @@ javaFrameworkError SAL_CALL jfw_getJavaInfoByPath(
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;
@ -878,7 +878,7 @@ javaFrameworkError SAL_CALL jfw_setSelectedJRE(JavaInfo const *pInfo)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;
}
@ -911,7 +911,7 @@ javaFrameworkError SAL_CALL jfw_setEnabled(sal_Bool bEnabled)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;
}
@ -933,7 +933,7 @@ javaFrameworkError SAL_CALL jfw_getEnabled(sal_Bool *pbEnabled)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;
}
@ -958,7 +958,7 @@ javaFrameworkError SAL_CALL jfw_setVMParameters(
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;
@ -983,7 +983,7 @@ javaFrameworkError SAL_CALL jfw_getVMParameters(
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;
}
@ -1006,7 +1006,7 @@ javaFrameworkError SAL_CALL jfw_setUserClassPath(rtl_uString * pCp)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;
}
@ -1029,7 +1029,7 @@ javaFrameworkError SAL_CALL jfw_getUserClassPath(rtl_uString ** ppCP)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;
}
@ -1053,7 +1053,7 @@ javaFrameworkError SAL_CALL jfw_addJRELocation(rtl_uString * sLocation)
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;
@ -1079,7 +1079,7 @@ javaFrameworkError SAL_CALL jfw_setJRELocations(
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;
@ -1104,7 +1104,7 @@ javaFrameworkError SAL_CALL jfw_getJRELocations(
{
errcode = e.errorCode;
fprintf(stderr, "%s\n", e.message.getStr());
OSL_ENSURE(0, e.message.getStr());
OSL_FAIL(e.message.getStr());
}
return errcode;

View File

@ -125,7 +125,7 @@ VendorSettings::VendorSettings():
{
OString sMsg("[Java framework] A vendor settings file was not specified."
"Check the bootstrap parameter " UNO_JAVA_JFW_VENDOR_SETTINGS ".");
OSL_ENSURE(0, sMsg.getStr());
OSL_FAIL(sMsg.getStr());
throw FrameworkException(JFW_E_CONFIGURATION, sMsg);
}
if (sSettingsPath.getLength() > 0)

View File

@ -93,7 +93,7 @@ struct AllocatorTraits
p = static_cast<char*>(p) - sizeof(signature_type);
if (memcmp (p, m_signature, sizeof(signature_type)) != 0)
{
OSL_ENSURE(0, "operator delete mismatch");
OSL_FAIL("operator delete mismatch");
}
#endif /* OSL_DEBUG_LEVEL */
return p;

View File

@ -481,7 +481,7 @@ oslFileError SAL_CALL osl_closeDirectory( oslDirectory Directory )
err = osl_File_E_None;
break;
default:
OSL_ENSURE( 0, "Invalid directory type" );
OSL_FAIL( "Invalid directory type" );
break;
}

View File

@ -783,7 +783,7 @@ oslFileError osl_getSystemPathFromFileURL_Ex(
message = szBuffer;
}
OSL_ENSURE( 0, message );
OSL_FAIL( message );
}
#endif // OSL_DEBUG_LEVEL > 0

View File

@ -138,7 +138,7 @@ static sal_Bool findWrongUsage( const sal_Unicode *path, sal_Int32 len )
oslFileError SAL_CALL osl_getCanonicalName( rtl_uString* ustrFileURL, rtl_uString** pustrValidURL )
{
OSL_ENSURE(0, "osl_getCanonicalName not implemented");
OSL_FAIL("osl_getCanonicalName not implemented");
rtl_uString_newFromString(pustrValidURL, ustrFileURL);
return osl_File_E_None;
@ -160,7 +160,7 @@ oslFileError SAL_CALL osl_getSystemPathFromFileURL( rtl_uString *ustrFileURL, rt
/*
if( (sal_Unicode) '/' == ustrFileURL->buffer[0] )
{
OSL_ENSURE( 0, "osl_getSystemPathFromFileURL: input is already system path" );
OSL_FAIL( "osl_getSystemPathFromFileURL: input is already system path" );
rtl_uString_assign( pustrSystemPath, ustrFileURL );
return osl_File_E_None;
}
@ -317,14 +317,14 @@ oslFileError SAL_CALL osl_getFileURLFromSystemPath( rtl_uString *ustrSystemPath,
/*
if( 0 == rtl_ustr_ascii_shortenedCompare_WithLength( ustrSystemPath->buffer, ustrSystemPath->length,"file://", 7 ) )
{
OSL_ENSURE( 0, "osl_getFileURLFromSystemPath: input is already file URL" );
OSL_FAIL( "osl_getFileURLFromSystemPath: input is already file URL" );
rtl_uString_assign( pustrFileURL, ustrSystemPath );
}
else
{
rtl_uString *pTmp2 = NULL;
OSL_ENSURE( 0, "osl_getFileURLFromSystemPath: input is wrong file URL" );
OSL_FAIL( "osl_getFileURLFromSystemPath: input is wrong file URL" );
rtl_uString_newFromStr_WithLength( pustrFileURL, ustrSystemPath->buffer + 5, ustrSystemPath->length - 5 );
rtl_uString_newFromAscii( &pTmp2, "file://" );
rtl_uString_newConcat( pustrFileURL, *pustrFileURL, pTmp2 );

View File

@ -1030,7 +1030,7 @@ oslFileError SAL_CALL osl_closeDirectory(oslDirectory Directory)
}
break;
default:
OSL_ENSURE( 0, "Invalid directory type" );
OSL_FAIL( "Invalid directory type" );
break;
}

View File

@ -531,7 +531,7 @@ sal_Bool SAL_CALL component_writeInfo(
{
#if OSL_DEBUG_LEVEL > 0
OString cstr( OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ) );
OSL_ENSURE( 0, cstr.getStr() );
OSL_FAIL( cstr.getStr() );
#else
(void) exc; // unused
#endif

View File

@ -1667,7 +1667,7 @@ sal_Bool ImplementationRegistration::revokeImplementation(const OUString& locati
{
// no way to transport the error, as no exception is specified and a runtime
// exception is not appropriate.
OSL_ENSURE( 0 , "InvalidRegistryException during revokeImplementation" );
OSL_FAIL( "InvalidRegistryException during revokeImplementation" );
}
}

View File

@ -179,7 +179,7 @@ Sequence<OUString> SAL_CALL DllComponentLoader::getSupportedServiceNames( )
void DllComponentLoader::initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& )
throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException)
{
OSL_ENSURE( 0, "dllcomponentloader::initialize should not be called !" );
OSL_FAIL( "dllcomponentloader::initialize should not be called !" );
// if( aArgs.getLength() != 1 )
// {
// throw IllegalArgumentException();

View File

@ -689,7 +689,7 @@ void AccessController::checkAndClearPostPoned() SAL_THROW( (RuntimeException) )
break;
}
default:
OSL_ENSURE( 0, "### this should never be called in this ac mode!" );
OSL_FAIL( "### this should never be called in this ac mode!" );
break;
}
}
@ -743,7 +743,7 @@ PermissionCollection AccessController::getEffectivePermissions(
break;
}
default:
OSL_ENSURE( 0, "### this should never be called in this ac mode!" );
OSL_FAIL( "### this should never be called in this ac mode!" );
return PermissionCollection();
}

View File

@ -1376,7 +1376,7 @@ void OServiceManager::initialize( Sequence< Any > const & )
throw (Exception)
{
check_undisposed();
OSL_ENSURE( 0, "not impl!" );
OSL_FAIL( "not impl!" );
}
// XServiceInfo

View File

@ -79,7 +79,7 @@ sal_Bool testJavaVM(const Reference< XMultiServiceFactory > & xMgr )
Any anyVM = xVM->getJavaVM( Sequence<sal_Int8>(arId, 16));
if ( ! anyVM.hasValue())
{
OSL_ENSURE(0,"could not get Java VM");
OSL_FAIL("could not get Java VM");
return sal_False;
}