#i103452#: replace PRODUCT by !DBG_UTIL; replace assert by OSL_ASSERT where possible

This commit is contained in:
Mathias Bauer 2009-07-10 14:03:42 +02:00
parent c0840181bc
commit ffd6952e9a
15 changed files with 51 additions and 125 deletions

View File

@ -30,12 +30,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_bridges.hxx"
#if OSL_DEBUG_LEVEL == 0
# ifndef NDEBUG
# define NDEBUG
# endif
#endif
#include <assert.h>
#include <sal/alloca.h>
#include <bridges/remote/proxy.hxx>
#include <bridges/remote/context.h>
@ -84,7 +78,7 @@ void acquireRemote2UnoProxy( uno_Interface *pThis )
freeRemote2UnoProxy,
p->m_sOid.pData,
p->m_pType );
assert( (uno_Interface *)p == pThis );
OSL_ASSERT( (uno_Interface *)p == pThis );
}
}

View File

@ -30,12 +30,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_bridges.hxx"
#if OSL_DEBUG_LEVEL == 0
# ifndef NDEBUG
# define NDEBUG
# endif
#endif
#include <assert.h>
#include <bridges/remote/remote.hxx>
#include <bridges/remote/counter.hxx>
@ -90,7 +84,7 @@ void acquireRemote2RemoteStub( remote_Interface *pThis )
freeRemote2RemoteStub,
p->m_sOid.pData,
p->m_pType );
assert( (remote_Interface *)p == pThis );
OSL_ASSERT( (remote_Interface *)p == pThis );
}
}

View File

@ -29,7 +29,7 @@
************************************************************************/
namespace bridges_urp
{
#ifndef PRODUCT
#ifdef DBG_UTIL
#define BRIDGES_URP_PROT
#endif

View File

@ -32,11 +32,6 @@
#include "precompiled_bridges.hxx"
#include <string.h>
#if OSL_DEBUG_LEVEL == 0
#undef NDEBUG
#define NDEBUG
#endif
#include <assert.h>
#include <osl/time.h>
#include <osl/mutex.hxx>
@ -193,10 +188,10 @@ int main( int argc, char *argv[] )
{
// test the factory
Reference < XBridge > rBridge2 = rFactory->getBridge( OUString( RTL_CONSTASCII_USTRINGPARAM("bla blub")) );
assert( rBridge2.is() );
assert( rBridge2->getDescription() == rBridge->getDescription( ) );
assert( rBridge2->getName() == rBridge->getName() );
assert( rBridge2 == rBridge );
OSL_ASSERT( rBridge2.is() );
OSL_ASSERT( rBridge2->getDescription() == rBridge->getDescription( ) );
OSL_ASSERT( rBridge2->getName() == rBridge->getName() );
OSL_ASSERT( rBridge2 == rBridge );
}
@ -230,7 +225,7 @@ int main( int argc, char *argv[] )
}
Reference < XBridge > rBridge = rFactory->getBridge( OUString( RTL_CONSTASCII_USTRINGPARAM("bla blub")) );
// assert( ! rBridge.is() );
// OSL_ASSERT( ! rBridge.is() );
}
}

View File

@ -30,11 +30,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_bridges.hxx"
#if OSL_DEBUG_LEVEL == 0
#undef NDEBUG
#define NDEBUG
#endif
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <osl/time.h>
@ -598,7 +593,7 @@ void testException( const Reference < XCallMe > &r )
{
try {
r->call( OUString( RTL_CONSTASCII_USTRINGPARAM("dummy")) , -1 );
assert( ! "no exception flown !" );
OSL_ASSERT( ! "no exception flown !" );
}
catch( TestBridgeException & e )
{
@ -606,11 +601,11 @@ void testException( const Reference < XCallMe > &r )
}
catch( Exception & e )
{
assert( ! "only base class of exception could be catched!" );
OSL_ASSERT( ! "only base class of exception could be catched!" );
}
catch(...)
{
assert(! "wrong unknown exception !" );
OSL_ASSERT(! "wrong unknown exception !" );
}
}

View File

@ -30,10 +30,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_bridges.hxx"
#if OSL_DEBUG_LEVEL == 0
#define NDEBUG
#endif
#include <assert.h>
#include <osl/time.h>
#include <osl/mutex.hxx>
@ -96,7 +92,7 @@ void testPipe( const Reference < XMultiServiceFactory > & rSmgr )
rSmgr->createInstance( OUString::createFromAscii( "com.sun.star.io.Pipe" ) ),
UNO_QUERY );
assert( rOut.is() );
OSL_ASSERT( rOut.is() );
{
Sequence < sal_Int8 > seq( 10 );
@ -115,7 +111,7 @@ void testPipe( const Reference < XMultiServiceFactory > & rSmgr )
if( ! ( 42 == seq.getArray()[0] ) )
printf( "wrong element in sequence\n" );
// assert( 0 );
// OSL_ASSERT( 0 );
}
}
#include<stdio.h>
@ -155,7 +151,7 @@ void testDocument( const Reference < XMultiServiceFactory > & rSmgr )
rSmgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Desktop" ))),
UNO_QUERY );
assert( rLoader.is() );
OSL_ASSERT( rLoader.is() );
sal_Char *urls[] = {
"private:factory/swriter",

View File

@ -30,11 +30,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_bridges.hxx"
#if OSL_DEBUG_LEVEL == 0
#undef NDEBUG
#define NDEBUG
#endif
#include <assert.h>
#include <osl/time.h>
#include <osl/mutex.hxx>
@ -201,7 +196,7 @@ int main( int argc, char *argv[] )
Reference < XBridge > rBridge = rFactory->getBridge(
OUString( RTL_CONSTASCII_USTRINGPARAM("bla blub")) );
assert( ! rBridge.is() );
OSL_ASSERT( ! rBridge.is() );
}
catch( Exception & )

View File

@ -40,13 +40,6 @@
#include <hash_map>
#if OSL_DEBUG_LEVEL == 0
# ifndef NDEBUG
# define NDEBUG
# endif
#endif
#include <assert.h>
#include <com/sun/star/lang/XEventListener.hpp>

View File

@ -30,11 +30,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_cppuhelper.hxx"
#if OSL_DEBUG_LEVEL == 0
#undef NDEBUG
#define NDEBUG
#endif
#include <assert.h>
#include <cppuhelper/stdidlclass.hxx>
@ -65,18 +60,18 @@ void testidlclass( const Reference < XMultiServiceFactory > &rSMgr)
(XServiceInfo * ) 0
);
assert( r.is() );
OSL_ASSERT( r.is() );
{ // test the xidlclassprovider interface !
Reference< XIdlClassProvider > rProv( r , UNO_QUERY );
assert( rProv.is() );
OSL_ASSERT( rProv.is() );
{
Sequence < Reference < XIdlClass > > seq = rProv->getIdlClasses();
// is always one
assert( seq.getLength() == 1 );
OSL_ASSERT( seq.getLength() == 1 );
// test the weak reference
rProv->getIdlClasses();
@ -89,7 +84,7 @@ void testidlclass( const Reference < XMultiServiceFactory > &rSMgr)
}
assert( r->getName() == sImplName );
OSL_ASSERT( r->getName() == sImplName );
// test equals
Reference < XIdlClass > r2 =
@ -101,18 +96,18 @@ void testidlclass( const Reference < XMultiServiceFactory > &rSMgr)
(XServiceInfo * ) 0
);
// test for implementation name
assert( r2->equals( r ) );
OSL_ASSERT( r2->equals( r ) );
Sequence < Reference < XIdlClass > > seqIdlClass = r->getInterfaces();
//TODO !
// one idl class for one interface
// this test fails, if core reflection fails !
// assert( 1 == seqIdlClass.getLength() );
// OSL_ASSERT( 1 == seqIdlClass.getLength() );
// Reference < XIdlClass > rIdlInterface = seqIdlClass.getArray()[0];
// check for IdlClass interface returned by Core Reflection
// assert( rIdlInterface.is() );
// OSL_ASSERT( rIdlInterface.is() );

View File

@ -34,12 +34,6 @@
#include <com/sun/star/beans/Property.hpp>
#if OSL_DEBUG_LEVEL == 0
#undef NDEBUG
#define NDEBUG
#endif
#include <assert.h>
using namespace ::com::sun::star::uno;
using namespace ::cppu;
@ -51,27 +45,27 @@ void testPropertyTypeHelper()
sal_Int32 i;
convertPropertyValue( i , a );
assert( 25 == i );
OSL_ASSERT( 25 == i );
sal_Int16 i16;
convertPropertyValue( i16 , a );
assert( 25 == i16 );
OSL_ASSERT( 25 == i16 );
sal_Int8 i8;
convertPropertyValue( i8 , a );
assert( 25 == i8 );
OSL_ASSERT( 25 == i8 );
sal_uInt32 i32;
convertPropertyValue( i32 , a );
assert( 25 == i32 );
OSL_ASSERT( 25 == i32 );
double d;
convertPropertyValue( d , a );
assert( 25. == d );
OSL_ASSERT( 25. == d );
float f;
convertPropertyValue( f , a );
assert( 25. == f );
OSL_ASSERT( 25. == f );
::com::sun::star::beans::Property prop;
@ -83,11 +77,11 @@ void testPropertyTypeHelper()
::com::sun::star::beans::Property prop2;
convertPropertyValue( prop2 , a );
assert( prop.Handle == prop2.Handle && prop.Name == prop2.Name && prop.Attributes == prop2.Attributes );
OSL_ASSERT( prop.Handle == prop2.Handle && prop.Name == prop2.Name && prop.Attributes == prop2.Attributes );
::rtl::OUString ow;
a <<= prop.Name;
convertPropertyValue( ow , a );
assert( ow == prop.Name );
OSL_ASSERT( ow == prop.Name );
}

View File

@ -49,12 +49,6 @@
#include <osl/mutex.hxx>
#include <rtl/ustrbuf.hxx>
#if OSL_DEBUG_LEVEL == 0
# ifndef NDEBUG
# define NDEBUG
# endif
#endif
#include <assert.h>
#include <string.h>
@ -632,7 +626,7 @@ sal_Int32 OMarkableInputStream::readBytes(Sequence< sal_Int8 >& aData, sal_Int32
sal_Int32 nToRead = nBytesToRead - ( m_pBuffer->getSize() - m_nCurrentPos );
nRead = m_input->readBytes( aData , nToRead );
assert( aData.getLength() == nRead );
OSL_ASSERT( aData.getLength() == nRead );
try
{
@ -650,7 +644,7 @@ sal_Int32 OMarkableInputStream::readBytes(Sequence< sal_Int8 >& aData, sal_Int32
}
}
assert( m_pBuffer->getSize() - m_nCurrentPos >= nBytesToRead );
OSL_ASSERT( m_pBuffer->getSize() - m_nCurrentPos >= nBytesToRead );
m_pBuffer->readAt( m_nCurrentPos , aData , nBytesToRead );

View File

@ -55,10 +55,6 @@
#include <osl/conditn.hxx>
#include <osl/mutex.hxx>
#if OSL_DEBUG_LEVEL == 0
#define NDEBUG
#endif
#include <assert.h>
#include <string.h>
using namespace ::rtl;
@ -209,13 +205,13 @@ sal_Int32 ODataStreamTest::test(
rSource = Reference< XActiveDataSource > ( x, UNO_QUERY );
}
assert( rPipeInput.is() );
assert( rPipeOutput.is() );
OSL_ASSERT( rPipeInput.is() );
OSL_ASSERT( rPipeOutput.is() );
rSink->setInputStream( rPipeInput );
rSource->setOutputStream( rPipeOutput );
assert( rSink->getInputStream().is() );
assert( rSource->getOutputStream().is() );
OSL_ASSERT( rSink->getInputStream().is() );
OSL_ASSERT( rSource->getOutputStream().is() );
if( 1 == hTestHandle ) {
testSimple( rInput , rOutput );
@ -778,10 +774,10 @@ sal_Int32 OObjectStreamTest::test( const OUString& TestName,
Reference <XOutputStream > markableOutput( x , UNO_QUERY );
Reference <XActiveDataSource > markableSource( x , UNO_QUERY );
assert( markableInput.is() );
assert( markableOutput.is() );
assert( markableSink.is() );
assert( markableSource.is() );
OSL_ASSERT( markableInput.is() );
OSL_ASSERT( markableOutput.is() );
OSL_ASSERT( markableSink.is() );
OSL_ASSERT( markableSource.is() );
markableSink->setInputStream( rPipeInput );
markableSource->setOutputStream( rPipeOutput );
@ -799,14 +795,14 @@ sal_Int32 OObjectStreamTest::test( const OUString& TestName,
rSource = Reference <XActiveDataSource>( x, UNO_QUERY );
}
assert( rPipeInput.is() );
assert( rPipeOutput.is() );
OSL_ASSERT( rPipeInput.is() );
OSL_ASSERT( rPipeOutput.is() );
rSink->setInputStream( markableInput );
rSource->setOutputStream( markableOutput );
assert( rSink->getInputStream().is() );
assert( rSource->getOutputStream().is() );
OSL_ASSERT( rSink->getInputStream().is() );
OSL_ASSERT( rSource->getOutputStream().is() );
if( 1 + DATASTREAM_TEST_MAX_HANDLE == hTestHandle ) {
testObject( rOutput , rInput);

View File

@ -46,12 +46,6 @@
#include <osl/conditn.hxx>
#include <osl/mutex.hxx>
#if OSL_DEBUG_LEVEL == 0
#define NDEBUG
#endif
#include <assert.h>
#include <string.h>
using namespace ::rtl;
using namespace ::osl;
using namespace ::cppu;
@ -159,8 +153,8 @@ sal_Int32 OMarkableOutputStreamTest::test(
Reference< XOutputStream > rOutput( TestObject , UNO_QUERY );
assert( rPipeInput.is() );
assert( rOutput.is() );
OSL_ASSERT( rPipeInput.is() );
OSL_ASSERT( rOutput.is() );
if( 1 == hTestHandle ) {
// checks usual streaming
testSimple( rOutput , rPipeInput );
@ -526,8 +520,8 @@ sal_Int32 OMarkableInputStreamTest::test(
Reference < XInputStream > rInput( TestObject , UNO_QUERY );
assert( rPipeOutput.is() );
assert( rInput.is() );
OSL_ASSERT( rPipeOutput.is() );
OSL_ASSERT( rInput.is() );
if( 1 == hTestHandle ) {
// checks usual streaming
testSimple( rPipeOutput , rInput );

View File

@ -255,7 +255,7 @@ void do_cleanup( void )
*/
#ifdef PRODUCT
#ifndef DBG_UTIL
__try
#endif
{
@ -267,7 +267,7 @@ void do_cleanup( void )
rtl_cache_fini();
rtl_arena_fini();
}
#ifdef PRODUCT
#ifndef DBG_UTIL
__except( EXCEPTION_EXECUTE_HANDLER )
{
}

View File

@ -36,15 +36,6 @@
#include <parse.hxx>
#include <cr_html.hxx>
#if OSL_DEBUG_LEVEL == 0
# ifndef NDEBUG
# define NDEBUG
# endif
#endif
#include <assert.h>
XmlElement::XmlElement( const char * i_sName )
: sName(i_sName)
{
@ -160,7 +151,7 @@ ListElement::Write2Html( HtmlCreator & io_rHC ) const
XmlElement *
ListElement::Create_and_Add_NewElement()
{
assert(fCreateNewElement != 0);
OSL_ASSERT(fCreateNewElement != 0);
XmlElement * pNew = (*fCreateNewElement)(Name());
Children().push_back( pNew );
return pNew;