xref: /aoo41x/main/io/test/stm/testfactreg.hxx (revision 36cac86c)
1*36cac86cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*36cac86cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*36cac86cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*36cac86cSAndrew Rist  * distributed with this work for additional information
6*36cac86cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*36cac86cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*36cac86cSAndrew Rist  * "License"); you may not use this file except in compliance
9*36cac86cSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*36cac86cSAndrew Rist  *
11*36cac86cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*36cac86cSAndrew Rist  *
13*36cac86cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*36cac86cSAndrew Rist  * software distributed under the License is distributed on an
15*36cac86cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*36cac86cSAndrew Rist  * KIND, either express or implied.  See the License for the
17*36cac86cSAndrew Rist  * specific language governing permissions and limitations
18*36cac86cSAndrew Rist  * under the License.
19*36cac86cSAndrew Rist  *
20*36cac86cSAndrew Rist  *************************************************************/
21*36cac86cSAndrew Rist 
22*36cac86cSAndrew Rist 
23cdf0e10cSrcweir #include <rtl/strbuf.hxx>
24cdf0e10cSrcweir 
25cdf0e10cSrcweir Reference< XInterface > SAL_CALL OPipeTest_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw( Exception );
26cdf0e10cSrcweir Sequence<OUString> OPipeTest_getSupportedServiceNames(void) throw();
27cdf0e10cSrcweir OUString     OPipeTest_getServiceName() throw();
28cdf0e10cSrcweir OUString 	OPipeTest_getImplementationName() throw();
29cdf0e10cSrcweir 
30cdf0e10cSrcweir Reference< XInterface > SAL_CALL OPumpTest_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw( Exception );
31cdf0e10cSrcweir Sequence<OUString> OPumpTest_getSupportedServiceNames(void) throw();
32cdf0e10cSrcweir OUString     OPumpTest_getServiceName() throw();
33cdf0e10cSrcweir OUString 	OPumpTest_getImplementationName() throw();
34cdf0e10cSrcweir 
35cdf0e10cSrcweir Reference< XInterface > SAL_CALL ODataStreamTest_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception);
36cdf0e10cSrcweir Sequence<OUString> ODataStreamTest_getSupportedServiceNames( int i) throw();
37cdf0e10cSrcweir OUString     ODataStreamTest_getServiceName( int i) throw();
38cdf0e10cSrcweir OUString 	ODataStreamTest_getImplementationName( int i) throw();
39cdf0e10cSrcweir 
40cdf0e10cSrcweir Reference< XInterface > SAL_CALL OMarkableOutputStreamTest_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception);
41cdf0e10cSrcweir Sequence<OUString> OMarkableOutputStreamTest_getSupportedServiceNames(void) throw();
42cdf0e10cSrcweir OUString     OMarkableOutputStreamTest_getServiceName() throw();
43cdf0e10cSrcweir OUString 	OMarkableOutputStreamTest_getImplementationName() throw();
44cdf0e10cSrcweir 
45cdf0e10cSrcweir Reference< XInterface > SAL_CALL OMarkableInputStreamTest_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception);
46cdf0e10cSrcweir Sequence<OUString> OMarkableInputStreamTest_getSupportedServiceNames(void) throw();
47cdf0e10cSrcweir OUString     OMarkableInputStreamTest_getServiceName() throw();
48cdf0e10cSrcweir OUString 	OMarkableInputStreamTest_getImplementationName() throw();
49cdf0e10cSrcweir 
50cdf0e10cSrcweir Reference< XInterface > SAL_CALL OObjectStreamTest_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception);
51cdf0e10cSrcweir Sequence<OUString> OObjectStreamTest_getSupportedServiceNames( int i) throw();
52cdf0e10cSrcweir OUString     OObjectStreamTest_getServiceName( int i) throw();
53cdf0e10cSrcweir OUString 	OObjectStreamTest_getImplementationName( int i) throw();
54cdf0e10cSrcweir 
55cdf0e10cSrcweir Reference< XInterface > SAL_CALL OMyPersistObject_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception);
56cdf0e10cSrcweir Sequence<OUString> 	OMyPersistObject_getSupportedServiceNames( ) throw();
57cdf0e10cSrcweir OUString     		OMyPersistObject_getServiceName( ) throw();
58cdf0e10cSrcweir OUString 			OMyPersistObject_getImplementationName( ) throw();
59cdf0e10cSrcweir 
60cdf0e10cSrcweir Sequence<sal_Int8> createSeq( char * p );
61cdf0e10cSrcweir Sequence<sal_Int8> createIntSeq( sal_Int32 i );
62cdf0e10cSrcweir 
63cdf0e10cSrcweir #define BUILD_ERROR(expr, Message)\
64cdf0e10cSrcweir 		{\
65cdf0e10cSrcweir 			m_seqErrors.realloc( m_seqErrors.getLength() + 1 ); \
66cdf0e10cSrcweir 		m_seqExceptions.realloc(  m_seqExceptions.getLength() + 1 ); \
67cdf0e10cSrcweir 		OStringBuffer str(128); \
68cdf0e10cSrcweir 		str.append( __FILE__ );\
69cdf0e10cSrcweir 		str.append( " " ); \
70cdf0e10cSrcweir 		str.append( "(" ); \
71cdf0e10cSrcweir 		str.append( OString::valueOf( (sal_Int32)__LINE__) );\
72cdf0e10cSrcweir 		str.append(")\n" );\
73cdf0e10cSrcweir 		str.append( "[ " ); \
74cdf0e10cSrcweir 		str.append( #expr ); \
75cdf0e10cSrcweir 		str.append( " ] : " ); \
76cdf0e10cSrcweir 		str.append( Message ); \
77cdf0e10cSrcweir 		m_seqErrors.getArray()[ m_seqErrors.getLength()-1] =\
78cdf0e10cSrcweir                        OStringToOUString( str.makeStringAndClear() , RTL_TEXTENCODING_ASCII_US ); \
79cdf0e10cSrcweir 		}\
80cdf0e10cSrcweir 		((void)0)
81cdf0e10cSrcweir 
82cdf0e10cSrcweir 
83cdf0e10cSrcweir #define WARNING_ASSERT(expr, Message) \
84cdf0e10cSrcweir 		if( ! (expr) ) { \
85cdf0e10cSrcweir 			m_seqWarnings.realloc( m_seqErrors.getLength() +1 ); \
86cdf0e10cSrcweir 			OStringBuffer str(128);\
87cdf0e10cSrcweir 			str.append( __FILE__);\
88cdf0e10cSrcweir 			str.append( " "); \
89cdf0e10cSrcweir 			str.append( "(" ); \
90cdf0e10cSrcweir 			str.append(OString::valueOf( (sal_Int32)__LINE__)) ;\
91cdf0e10cSrcweir 			str.append( ")\n");\
92cdf0e10cSrcweir 			str.append( "[ " ); \
93cdf0e10cSrcweir 			str.append( #expr ); \
94cdf0e10cSrcweir 			str.append( " ] : ") ; \
95cdf0e10cSrcweir 			str.append( Message); \
96cdf0e10cSrcweir 			m_seqWarnings.getArray()[ m_seqWarnings.getLength()-1] =\
97cdf0e10cSrcweir                           OStringToOUString( str.makeStringAndClear() , RTL_TEXTENCODING_ASCII_US ); \
98cdf0e10cSrcweir 			return; \
99cdf0e10cSrcweir 		}\
100cdf0e10cSrcweir 		((void)0)
101cdf0e10cSrcweir 
102cdf0e10cSrcweir #define ERROR_ASSERT(expr, Message) \
103cdf0e10cSrcweir 		if( ! (expr) ) { \
104cdf0e10cSrcweir 			BUILD_ERROR(expr, Message );\
105cdf0e10cSrcweir 			return; \
106cdf0e10cSrcweir 		}\
107cdf0e10cSrcweir 		((void)0)
108cdf0e10cSrcweir 
109cdf0e10cSrcweir #define ERROR_EXCEPTION_ASSERT(expr, Message, Exception) \
110cdf0e10cSrcweir 	if( !(expr)) { \
111cdf0e10cSrcweir 		BUILD_ERROR(expr,Message);\
112cdf0e10cSrcweir 		m_seqExceptions.getArray()[ m_seqExceptions.getLength()-1] = Any( Exception );\
113cdf0e10cSrcweir 		return; \
114cdf0e10cSrcweir 	} \
115cdf0e10cSrcweir 	((void)0)
116