diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-02-04 11:25:19 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-02-04 11:25:19 +0000 |
commit | 22a82ee70fd831660ca0196080edce9132de848a (patch) | |
tree | 2082853d312c316cd49b7d96ef00484b7674ee0f /extensions | |
parent | 9cd8adc68ff7766cbbc5830413a3064e9c502bcd (diff) |
INTEGRATION: CWS ooo20031216 (1.2.126); FILE MERGED
2003/12/28 12:02:37 waratah 1.2.126.1: #i23913# remove TRY CATCH macros
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/test/stm/marktest.cxx | 23 | ||||
-rw-r--r-- | extensions/test/stm/pipetest.cxx | 25 |
2 files changed, 21 insertions, 27 deletions
diff --git a/extensions/test/stm/marktest.cxx b/extensions/test/stm/marktest.cxx index cccc9af56029..92042fd59d0e 100644 --- a/extensions/test/stm/marktest.cxx +++ b/extensions/test/stm/marktest.cxx @@ -2,9 +2,9 @@ * * $RCSfile: marktest.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: vg $ $Date: 2003-04-15 16:20:04 $ + * last change: $Author: hr $ $Date: 2004-02-04 12:24:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -180,7 +180,7 @@ INT32 OMarkableOutputStreamTest::test( const UString& TestName, UsrSystemException) ) { if( L"com.sun.star.io.MarkableOutputStream" == TestName ) { - TRY { + try { if( 0 == hTestHandle ) { testInvariant( TestName , TestObject ); } @@ -203,13 +203,12 @@ INT32 OMarkableOutputStreamTest::test( const UString& TestName, } } - CATCH( Exception , e ) { + catch( Exception& e ) { BUILD_ERROR( 0 , UStringToString( e.getName() , CHARSET_SYSTEM ).GetCharStr() ); } - AND_CATCH_ALL() { + catch(...) { BUILD_ERROR( 0 , "unknown exception (Exception is not base class)" ); } - END_CATCH; hTestHandle ++; @@ -304,15 +303,14 @@ void OMarkableOutputStreamTest::testSimple( const XOutputStreamRef &rOutput rInput->skipBytes( nMax*seqWrite.getLen() ); ERROR_ASSERT( 0 == rInput->available(), "skip bytes failure" ); - TRY { + try { rMarkable->jumpToMark( nMark ); ERROR_ASSERT( 0 , "jump to non existing mark possible !" ); } - CATCH ( IllegalArgumentException , e ) + catch ( IllegalArgumentException& e ) { e;// ok, exception was thrown } - END_CATCH; // test putting marks not at the end of the stream! ERROR_ASSERT( 0 == rInput->available(), "stream isn't clean" ); @@ -549,7 +547,7 @@ INT32 OMarkableInputStreamTest::test( const UString& TestName, UsrSystemException) ) { if( L"com.sun.star.io.MarkableInputStream" == TestName ) { - TRY { + try { if( 0 == hTestHandle ) { testInvariant( TestName , TestObject ); } @@ -572,13 +570,12 @@ INT32 OMarkableInputStreamTest::test( const UString& TestName, } } - CATCH( Exception , e ) { + catch( Exception& e ) { BUILD_ERROR( 0 , UStringToString( e.getName() , CHARSET_SYSTEM ).GetCharStr() ); } - AND_CATCH_ALL() { + catch(...) { BUILD_ERROR( 0 , "unknown exception (Exception is not base class)" ); } - END_CATCH; hTestHandle ++; diff --git a/extensions/test/stm/pipetest.cxx b/extensions/test/stm/pipetest.cxx index 76209111c71f..60e7c8f0c896 100644 --- a/extensions/test/stm/pipetest.cxx +++ b/extensions/test/stm/pipetest.cxx @@ -2,9 +2,9 @@ * * $RCSfile: pipetest.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: vg $ $Date: 2003-04-15 16:20:15 $ + * last change: $Author: hr $ $Date: 2004-02-04 12:25:19 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -221,7 +221,7 @@ INT32 OPipeTest::test( const UString& TestName, UsrSystemException) ) { if( L"com.sun.star.io.Pipe" == TestName ) { - TRY { + try { if( 0 == hTestHandle ) { testInvariant( TestName , TestObject ); } @@ -235,13 +235,12 @@ INT32 OPipeTest::test( const UString& TestName, testMultithreading( TestObject ); } } - CATCH( Exception , e ) { + catch( Exception& e ) { BUILD_ERROR( 0 , UStringToString( e.getName() , CHARSET_SYSTEM ).GetCharStr() ); } - AND_CATCH_ALL() { + catch(...) { BUILD_ERROR( 0 , "unknown exception (Exception is not base class)" ); } - END_CATCH; hTestHandle ++; @@ -334,26 +333,24 @@ void OPipeTest::testSimple( const XInterfaceRef &r ) output->closeOutput(); - TRY { + try { output->writeBytes( Sequence<BYTE> (100) ); ERROR_ASSERT( 0 , "writing on a closed stream does not cause an exception" ); } - CATCH (IOException , e ) { + catch (IOException& e ) { e; // just to suppress warning during compile } - END_CATCH; ERROR_ASSERT(! input->readBytes( seqRead , 1 ), "eof not found !" ); input->closeInput(); - TRY { + try { input->readBytes( seqRead , 1 ); ERROR_ASSERT( 0 , "reading from a closed stream does not cause an exception" ); } - CATCH( IOException , e ) { + catch( IOException& e ) { e; // just to suppress warning during compile } - END_CATCH; } @@ -429,7 +426,7 @@ void OPipeTest::testMultithreading( const XInterfaceRef &r ) } /* { - TRY { + try { XInterfaceRef x = xSMgr->createInstance( strService ); XInputStreamRef input( x , USR_QUERY ); @@ -443,7 +440,7 @@ void OPipeTest::testMultithreading( const XInterfaceRef &r ) } } - CATCH( IOException , e ) { + catch( IOException& e ) { printf( "%s %s\n" , UStringToString( e.getName() , CHARSET_SYSTEM ).GetCharStr() , UStringToString( e.Message , CHARSET_SYSTEM ).GetCharStr() ); } |