xref: /aoo41x/main/io/test/stm/testfactreg.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #include <rtl/strbuf.hxx>
28 
29 Reference< XInterface > SAL_CALL OPipeTest_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw( Exception );
30 Sequence<OUString> OPipeTest_getSupportedServiceNames(void) throw();
31 OUString     OPipeTest_getServiceName() throw();
32 OUString 	OPipeTest_getImplementationName() throw();
33 
34 Reference< XInterface > SAL_CALL OPumpTest_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw( Exception );
35 Sequence<OUString> OPumpTest_getSupportedServiceNames(void) throw();
36 OUString     OPumpTest_getServiceName() throw();
37 OUString 	OPumpTest_getImplementationName() throw();
38 
39 Reference< XInterface > SAL_CALL ODataStreamTest_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception);
40 Sequence<OUString> ODataStreamTest_getSupportedServiceNames( int i) throw();
41 OUString     ODataStreamTest_getServiceName( int i) throw();
42 OUString 	ODataStreamTest_getImplementationName( int i) throw();
43 
44 Reference< XInterface > SAL_CALL OMarkableOutputStreamTest_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception);
45 Sequence<OUString> OMarkableOutputStreamTest_getSupportedServiceNames(void) throw();
46 OUString     OMarkableOutputStreamTest_getServiceName() throw();
47 OUString 	OMarkableOutputStreamTest_getImplementationName() throw();
48 
49 Reference< XInterface > SAL_CALL OMarkableInputStreamTest_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception);
50 Sequence<OUString> OMarkableInputStreamTest_getSupportedServiceNames(void) throw();
51 OUString     OMarkableInputStreamTest_getServiceName() throw();
52 OUString 	OMarkableInputStreamTest_getImplementationName() throw();
53 
54 Reference< XInterface > SAL_CALL OObjectStreamTest_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception);
55 Sequence<OUString> OObjectStreamTest_getSupportedServiceNames( int i) throw();
56 OUString     OObjectStreamTest_getServiceName( int i) throw();
57 OUString 	OObjectStreamTest_getImplementationName( int i) throw();
58 
59 Reference< XInterface > SAL_CALL OMyPersistObject_CreateInstance( const Reference< XMultiServiceFactory > & rSMgr ) throw(Exception);
60 Sequence<OUString> 	OMyPersistObject_getSupportedServiceNames( ) throw();
61 OUString     		OMyPersistObject_getServiceName( ) throw();
62 OUString 			OMyPersistObject_getImplementationName( ) throw();
63 
64 Sequence<sal_Int8> createSeq( char * p );
65 Sequence<sal_Int8> createIntSeq( sal_Int32 i );
66 
67 #define BUILD_ERROR(expr, Message)\
68 		{\
69 			m_seqErrors.realloc( m_seqErrors.getLength() + 1 ); \
70 		m_seqExceptions.realloc(  m_seqExceptions.getLength() + 1 ); \
71 		OStringBuffer str(128); \
72 		str.append( __FILE__ );\
73 		str.append( " " ); \
74 		str.append( "(" ); \
75 		str.append( OString::valueOf( (sal_Int32)__LINE__) );\
76 		str.append(")\n" );\
77 		str.append( "[ " ); \
78 		str.append( #expr ); \
79 		str.append( " ] : " ); \
80 		str.append( Message ); \
81 		m_seqErrors.getArray()[ m_seqErrors.getLength()-1] =\
82                        OStringToOUString( str.makeStringAndClear() , RTL_TEXTENCODING_ASCII_US ); \
83 		}\
84 		((void)0)
85 
86 
87 #define WARNING_ASSERT(expr, Message) \
88 		if( ! (expr) ) { \
89 			m_seqWarnings.realloc( m_seqErrors.getLength() +1 ); \
90 			OStringBuffer str(128);\
91 			str.append( __FILE__);\
92 			str.append( " "); \
93 			str.append( "(" ); \
94 			str.append(OString::valueOf( (sal_Int32)__LINE__)) ;\
95 			str.append( ")\n");\
96 			str.append( "[ " ); \
97 			str.append( #expr ); \
98 			str.append( " ] : ") ; \
99 			str.append( Message); \
100 			m_seqWarnings.getArray()[ m_seqWarnings.getLength()-1] =\
101                           OStringToOUString( str.makeStringAndClear() , RTL_TEXTENCODING_ASCII_US ); \
102 			return; \
103 		}\
104 		((void)0)
105 
106 #define ERROR_ASSERT(expr, Message) \
107 		if( ! (expr) ) { \
108 			BUILD_ERROR(expr, Message );\
109 			return; \
110 		}\
111 		((void)0)
112 
113 #define ERROR_EXCEPTION_ASSERT(expr, Message, Exception) \
114 	if( !(expr)) { \
115 		BUILD_ERROR(expr,Message);\
116 		m_seqExceptions.getArray()[ m_seqExceptions.getLength()-1] = Any( Exception );\
117 		return; \
118 	} \
119 	((void)0)
120