summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2011-03-12 11:49:53 +0100
committerThomas Arnhold <thomas@arnhold.org>2011-03-12 14:19:48 +0100
commit6488e5f1207eb3f72e00cd1e2ada2e443c891373 (patch)
tree4e4424bf1aa525f86cf48ff5a0c1044cab0efaff
parent7769f9dbd4613a147a60d76e2df9fedd0f11289f (diff)
Move OSL_ENSURE(false,...) to OSL_FAIL(...)
-rw-r--r--bridges/source/remote/urp/urp_reader.cxx3
-rw-r--r--cppu/source/typelib/typelib.cxx8
-rw-r--r--cppuhelper/source/implbase.cxx8
-rw-r--r--cppuhelper/source/propshlp.cxx2
-rw-r--r--cppuhelper/source/weak.cxx4
-rw-r--r--jvmaccess/source/virtualmachine.cxx4
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/util.cxx2
-rw-r--r--remotebridges/source/factory/bridgefactory.cxx2
-rw-r--r--sal/qa/osl/socket/sockethelper.cxx2
-rw-r--r--stoc/source/javavm/javavm.cxx11
10 files changed, 22 insertions, 24 deletions
diff --git a/bridges/source/remote/urp/urp_reader.cxx b/bridges/source/remote/urp/urp_reader.cxx
index 761168d7f516..c4cd06caebc1 100644
--- a/bridges/source/remote/urp/urp_reader.cxx
+++ b/bridges/source/remote/urp/urp_reader.cxx
@@ -565,8 +565,7 @@ void OReaderThread::run()
TYPELIB_DANGER_RELEASE( pType );
if ( !ok )
{
- OSL_ENSURE(
- false,
+ OSL_FAIL(
("urp_bridge: error while unpacking current"
" context") );
disposeEnvironment();
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index f84350f27691..5b8caa298690 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -1309,7 +1309,7 @@ extern "C" void SAL_CALL typelib_typedescription_newInterfaceMethod(
sal_Int32 nOffset = rtl_ustr_lastIndexOfChar_WithLength(
pTypeName->buffer, pTypeName->length, ':');
if (nOffset <= 0 || pTypeName->buffer[nOffset - 1] != ':') {
- OSL_ENSURE(false, "Bad interface method type name");
+ OSL_FAIL("Bad interface method type name");
return;
}
rtl::OUString aInterfaceTypeName(pTypeName->buffer, nOffset - 1);
@@ -1322,7 +1322,7 @@ extern "C" void SAL_CALL typelib_typedescription_newInterfaceMethod(
|| !complete(
reinterpret_cast< typelib_TypeDescription ** >(&pInterface), false))
{
- OSL_ENSURE(false, "No interface corresponding to interface method");
+ OSL_FAIL("No interface corresponding to interface method");
return;
}
@@ -1402,7 +1402,7 @@ extern "C" void SAL_CALL typelib_typedescription_newExtendedInterfaceAttribute(
sal_Int32 nOffset = rtl_ustr_lastIndexOfChar_WithLength(
pTypeName->buffer, pTypeName->length, ':');
if (nOffset <= 0 || pTypeName->buffer[nOffset - 1] != ':') {
- OSL_ENSURE(false, "Bad interface attribute type name");
+ OSL_FAIL("Bad interface attribute type name");
return;
}
rtl::OUString aInterfaceTypeName(pTypeName->buffer, nOffset - 1);
@@ -1415,7 +1415,7 @@ extern "C" void SAL_CALL typelib_typedescription_newExtendedInterfaceAttribute(
|| !complete(
reinterpret_cast< typelib_TypeDescription ** >(&pInterface), false))
{
- OSL_ENSURE(false, "No interface corresponding to interface attribute");
+ OSL_FAIL("No interface corresponding to interface attribute");
return;
}
diff --git a/cppuhelper/source/implbase.cxx b/cppuhelper/source/implbase.cxx
index 60f153194bef..3f0e238762f6 100644
--- a/cppuhelper/source/implbase.cxx
+++ b/cppuhelper/source/implbase.cxx
@@ -254,8 +254,8 @@ void WeakComponentImplHelperBase::release()
dispose();
}
catch (RuntimeException const& exc) { // don't break throw ()
- OSL_ENSURE(
- false, OUStringToOString(
+ OSL_FAIL(
+ OUStringToOString(
exc.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
static_cast<void>(exc);
}
@@ -390,8 +390,8 @@ void WeakAggComponentImplHelperBase::release()
dispose();
}
catch (RuntimeException const& exc) { // don't break throw ()
- OSL_ENSURE(
- false, OUStringToOString(
+ OSL_FAIL(
+ OUStringToOString(
exc.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
static_cast<void>(exc);
}
diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx
index 9abc35dd3632..0cc3e14f2133 100644
--- a/cppuhelper/source/propshlp.cxx
+++ b/cppuhelper/source/propshlp.cxx
@@ -1016,7 +1016,7 @@ void OPropertyArrayHelper::init( sal_Bool bSorted ) SAL_THROW( () )
{
#ifndef OS2 // YD disabled, too many troubles with debug builds!
if (bSorted) {
- OSL_ENSURE( false, "Property array is not sorted" );
+ OSL_FAIL( "Property array is not sorted" );
}
#endif
// not sorted
diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index 1dd76d26758e..11b99fc45076 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -226,8 +226,8 @@ void OWeakObject::disposeWeakConnectionPoint()
p->dispose();
}
catch (RuntimeException const& exc) {
- OSL_ENSURE(
- false, OUStringToOString(
+ OSL_FAIL(
+ OUStringToOString(
exc.Message, RTL_TEXTENCODING_ASCII_US ).getStr() );
static_cast<void>(exc);
}
diff --git a/jvmaccess/source/virtualmachine.cxx b/jvmaccess/source/virtualmachine.cxx
index 9597eed2e8aa..a257f55224cd 100644
--- a/jvmaccess/source/virtualmachine.cxx
+++ b/jvmaccess/source/virtualmachine.cxx
@@ -100,7 +100,7 @@ JNIEnv * VirtualMachine::attachThread(bool * pAttached) const
JNIEnv * pEnv;
jint n = m_pVm->GetEnv(reinterpret_cast< void ** >(&pEnv), m_nVersion);
if (n != JNI_OK && n != JNI_EDETACHED) {
- OSL_ENSURE(false, "JNI: GetEnv failed");
+ OSL_FAIL("JNI: GetEnv failed");
}
if (pEnv == 0)
{
@@ -119,7 +119,7 @@ void VirtualMachine::detachThread() const
{
#ifdef SOLAR_JAVA
if (m_pVm->DetachCurrentThread() != JNI_OK) {
- OSL_ENSURE(false, "JNI: DetachCurrentThread failed");
+ OSL_FAIL("JNI: DetachCurrentThread failed");
}
#endif
}
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index b34d486a4b2e..f3f64a806d5c 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -203,7 +203,7 @@ inline FileHandleGuard::~FileHandleGuard() SAL_THROW(())
{
if (osl_closeFile(m_rHandle) != osl_File_E_None)
{
- OSL_ENSURE(false, "unexpected situation");
+ OSL_FAIL("unexpected situation");
}
}
}
diff --git a/remotebridges/source/factory/bridgefactory.cxx b/remotebridges/source/factory/bridgefactory.cxx
index b6ef55d18a1c..fc5e2246d2ec 100644
--- a/remotebridges/source/factory/bridgefactory.cxx
+++ b/remotebridges/source/factory/bridgefactory.cxx
@@ -230,7 +230,7 @@ namespace remotebridges_factory
}
catch (rtl::MalformedUriException &)
{
- OSL_ENSURE(false, "MalformedUriException");
+ OSL_FAIL("MalformedUriException");
}
ServiceHashMap::iterator ii = m_mapProtocolToService.find( sProtocolName );
if( ii != m_mapProtocolToService.end() )
diff --git a/sal/qa/osl/socket/sockethelper.cxx b/sal/qa/osl/socket/sockethelper.cxx
index c6ee81e2a363..35d650a42830 100644
--- a/sal/qa/osl/socket/sockethelper.cxx
+++ b/sal/qa/osl/socket/sockethelper.cxx
@@ -107,7 +107,7 @@ void printUString( const ::rtl::OUString & str, const char* msg)
#else
char hostname[255];
if (gethostname(hostname, 255) != 0) {
- OSL_ENSURE( false, "#Error: gethostname failed." );
+ OSL_FAIL( "#Error: gethostname failed." );
}
struct hostent *hptr;
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx
index 6b97a619b34a..0b9ad60dd358 100644
--- a/stoc/source/javavm/javavm.cxx
+++ b/stoc/source/javavm/javavm.cxx
@@ -643,7 +643,7 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void * pServiceManager,
}
catch (css::uno::Exception &)
{
- OSL_ENSURE(false, "com.sun.star.uno.Exception caught");
+ OSL_FAIL("com.sun.star.uno.Exception caught");
}
}
return false;
@@ -1421,7 +1421,7 @@ JavaVirtualMachine::~JavaVirtualMachine()
}
catch (css::uno::Exception &)
{
- OSL_ENSURE(false, "com.sun.star.uno.Exception caught");
+ OSL_FAIL("com.sun.star.uno.Exception caught");
}
if (m_xJavaConfiguration.is())
// We should never get here, but just in case...
@@ -1431,7 +1431,7 @@ JavaVirtualMachine::~JavaVirtualMachine()
}
catch (css::uno::Exception &)
{
- OSL_ENSURE(false, "com.sun.star.uno.Exception caught");
+ OSL_FAIL("com.sun.star.uno.Exception caught");
}
}
@@ -1658,12 +1658,11 @@ void JavaVirtualMachine::setINetSettingsInVM(bool set_reset)
}
catch (css::uno::RuntimeException &)
{
- OSL_ENSURE(false, "RuntimeException");
+ OSL_FAIL("RuntimeException");
}
catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &)
{
- OSL_ENSURE(false,
- "jvmaccess::VirtualMachine::AttachGuard::CreationException");
+ OSL_FAIL("jvmaccess::VirtualMachine::AttachGuard::CreationException");
}
}