summaryrefslogtreecommitdiff
path: root/extensions/test/stm/datatest.cxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2003-04-15 15:20:04 +0000
committerVladimir Glazounov <vg@openoffice.org>2003-04-15 15:20:04 +0000
commit8b489f50a8d0064241c577fce6e00a574354204b (patch)
treee8b7f86178f9f7df90d0ff5e196c9dc254fccbb2 /extensions/test/stm/datatest.cxx
parent3060887080c0de0c91de1124af96817643bf8a4f (diff)
INTEGRATION: CWS dbgmacros1 (1.1.1.1.108); FILE MERGED
2003/04/09 10:54:56 kso 1.1.1.1.108.1: #108413# - debug macro unification.
Diffstat (limited to 'extensions/test/stm/datatest.cxx')
-rw-r--r--extensions/test/stm/datatest.cxx59
1 files changed, 31 insertions, 28 deletions
diff --git a/extensions/test/stm/datatest.cxx b/extensions/test/stm/datatest.cxx
index 9cf43c7f7..aadbf5281 100644
--- a/extensions/test/stm/datatest.cxx
+++ b/extensions/test/stm/datatest.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: datatest.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:16:56 $
+ * last change: $Author: vg $ $Date: 2003-04-15 16:19:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -80,8 +80,11 @@
#include <vos/mutex.hxx>
#include <vos/thread.hxx>
+#if OSL_DEBUG_LEVEL == 0
+#define NDEBUG
+#endif
#include <assert.h>
-#include <string.h>
+#include <string.h>
#include "testfactreg.hxx"
@@ -95,7 +98,7 @@ using namespace usr;
/****
* The following test class tests XDataInputStream and XDataOutputStream at equal terms,
* so when errors occur, it may be in either one implementation.
-* The class also uses stardiv.uno.io.pipe. If problems occur, make sure to run also the
+* The class also uses stardiv.uno.io.pipe. If problems occur, make sure to run also the
* pipe test routines ( test.com.sun.star.io.pipe ).
*
*
@@ -107,28 +110,28 @@ class ODataStreamTest :
{
public:
ODataStreamTest( const XMultiServiceFactoryRef & rFactory ) : m_rFactory( rFactory ){}
-
-public: // refcounting
+
+public: // refcounting
BOOL queryInterface( Uik aUik, XInterfaceRef & rOut );
void acquire() { OWeakObject::acquire(); }
void release() { OWeakObject::release(); }
void* getImplementation(Reflection *p) { return OWeakObject::getImplementation(p); }
-public:
- virtual void testInvariant(const UString& TestName, const XInterfaceRef& TestObject)
- THROWS( ( IllegalArgumentException,
+public:
+ virtual void testInvariant(const UString& TestName, const XInterfaceRef& TestObject)
+ THROWS( ( IllegalArgumentException,
UsrSystemException) );
- virtual INT32 test( const UString& TestName,
- const XInterfaceRef& TestObject,
- INT32 hTestHandle) THROWS( ( IllegalArgumentException,
+ virtual INT32 test( const UString& TestName,
+ const XInterfaceRef& TestObject,
+ INT32 hTestHandle) THROWS( ( IllegalArgumentException,
UsrSystemException) );
virtual BOOL testPassed(void) THROWS( ( UsrSystemException) );
virtual Sequence< UString > getErrors(void) THROWS( (UsrSystemException) );
virtual Sequence< UsrAny > getErrorExceptions(void) THROWS( (UsrSystemException) );
- virtual Sequence< UString > getWarnings(void) THROWS( (UsrSystemException) );
-
+ virtual Sequence< UString > getWarnings(void) THROWS( (UsrSystemException) );
+
private:
void testSimple( const XDataInputStreamRef & , const XDataOutputStreamRef &);
@@ -136,7 +139,7 @@ protected:
Sequence<UsrAny> m_seqExceptions;
Sequence<UString> m_seqErrors;
Sequence<UString> m_seqWarnings;
-
+
XMultiServiceFactoryRef m_rFactory;
};
@@ -145,16 +148,16 @@ BOOL ODataStreamTest::queryInterface( Uik uik , XInterfaceRef &rOut )
{
if( XSimpleTest::getSmartUik() == uik ) {
rOut = (XSimpleTest *) this;
- }
+ }
else {
return OWeakObject::queryInterface( uik , rOut );
- }
+ }
return TRUE;
}
-void ODataStreamTest::testInvariant( const UString& TestName, const XInterfaceRef& TestObject )
- THROWS( ( IllegalArgumentException,
+void ODataStreamTest::testInvariant( const UString& TestName, const XInterfaceRef& TestObject )
+ THROWS( ( IllegalArgumentException,
UsrSystemException) )
{
if( L"com.sun.star.io.DataInputStream" == TestName ) {
@@ -162,25 +165,25 @@ void ODataStreamTest::testInvariant( const UString& TestName, const XInterfaceRe
XActiveDataSinkRef active( TestObject , USR_QUERY );
XInputStreamRef input( TestObject , USR_QUERY );
XDataInputStreamRef dataInput( TestObject , USR_QUERY );
-
+
WARNING_ASSERT( connect.is(), "XConnectable cannot be queried" );
WARNING_ASSERT( active.is() , "XActiveDataSink cannot be queried" );
ERROR_ASSERT( input.is() , "XInputStream cannot be queried" );
ERROR_ASSERT( dataInput.is() , "XDataInputStream cannot be queried" );
-
+
}
else if( L"com.sun.star.io.DataInputStream" == TestName ) {
XConnectableRef connect( TestObject , USR_QUERY );
XActiveDataSourceRef active( TestObject , USR_QUERY );
XOutputStreamRef output( TestObject , USR_QUERY );
XDataOutputStreamRef dataOutput( TestObject , USR_QUERY );
-
+
WARNING_ASSERT( connect.is(), "XConnectable cannot be queried" );
WARNING_ASSERT( active.is() , "XActiveDataSink cannot be queried" );
ERROR_ASSERT( output.is() , "XInputStream cannot be queried" );
ERROR_ASSERT( dataOutput.is(), "XDataInputStream cannot be queried" );
-
+
}
XServiceInfoRef info( TestObject, USR_QUERY );
@@ -190,13 +193,13 @@ void ODataStreamTest::testInvariant( const UString& TestName, const XInterfaceRe
ERROR_ASSERT( info->supportsService( TestName ), "XServiceInfo test failed" );
ERROR_ASSERT( ! info->supportsService( L"bla bluzb" ) , "XServiceInfo test failed" );
}
-
-}
+}
-INT32 ODataStreamTest::test( const UString& TestName,
- const XInterfaceRef& TestObject,
- INT32 hTestHandle) THROWS( ( IllegalArgumentException,
+
+INT32 ODataStreamTest::test( const UString& TestName,
+ const XInterfaceRef& TestObject,
+ INT32 hTestHandle) THROWS( ( IllegalArgumentException,
UsrSystemException) )
{
if( L"com.sun.star.io.DataInputStream" == TestName ||