xref: /trunk/main/sax/test/sax/factory.hxx (revision 8d192041)
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 namespace sax_test {
26 Reference< XInterface > SAL_CALL OSaxWriterTest_CreateInstance(
27 	const Reference< XMultiServiceFactory > & rSMgr ) throw ( Exception );
28 OUString    OSaxWriterTest_getServiceName( ) throw();
29 OUString 	OSaxWriterTest_getImplementationName( ) throw();
30 Sequence<OUString> OSaxWriterTest_getSupportedServiceNames( ) throw();
31 }
32 #define BUILD_ERROR(expr, Message)\
33 		{\
34 			m_seqErrors.realloc( m_seqErrors.getLength() + 1 ); \
35 		m_seqExceptions.realloc(  m_seqExceptions.getLength() + 1 ); \
36 		OStringBuffer str(128); \
37 		str.append( __FILE__ );\
38 		str.append( " " ); \
39 		str.append( "(" ); \
40 		str.append( OString::valueOf( (sal_Int32)__LINE__) );\
41 		str.append(")\n" );\
42 		str.append( "[ " ); \
43 		str.append( #expr ); \
44 		str.append( " ] : " ); \
45 		str.append( Message ); \
46 		m_seqErrors.getArray()[ m_seqErrors.getLength()-1] =\
47                        OStringToOUString( str.makeStringAndClear() , RTL_TEXTENCODING_ASCII_US ); \
48 		}\
49 		((void)0)
50 
51 
52 #define WARNING_ASSERT(expr, Message) \
53 		if( ! (expr) ) { \
54 			m_seqWarnings.realloc( m_seqErrors.getLength() +1 ); \
55 			OStringBuffer str(128);\
56 			str.append( __FILE__);\
57 			str.append( " "); \
58 			str.append( "(" ); \
59 			str.append(OString::valueOf( (sal_Int32)__LINE__)) ;\
60 			str.append( ")\n");\
61 			str.append( "[ " ); \
62 			str.append( #expr ); \
63 			str.append( " ] : ") ; \
64 			str.append( Message); \
65 			m_seqWarnings.getArray()[ m_seqWarnings.getLength()-1] =\
66                           OStringToOUString( str.makeStringAndClear() , RTL_TEXTENCODING_ASCII_US ); \
67 			return; \
68 		}\
69 		((void)0)
70 
71 #define ERROR_ASSERT(expr, Message) \
72 		if( ! (expr) ) { \
73 			BUILD_ERROR(expr, Message );\
74 			return; \
75 		}\
76 		((void)0)
77 
78 #define ERROR_EXCEPTION_ASSERT(expr, Message, Exception) \
79 	if( !(expr)) { \
80 		BUILD_ERROR(expr,Message);\
81 		m_seqExceptions.getArray()[ m_seqExceptions.getLength()-1] = Any( Exception );\
82 		return; \
83 	} \
84 	((void)0)
85 
86