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