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