Branch libreoffice-5-0-4
[LibreOffice.git] / testtools / source / bridgetest / cppobj.cxx
blob30f85f032d2ff9746f87007e60e9f3d2f42875d1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <stdio.h>
22 #include "cppu/unotype.hxx"
23 #include <osl/diagnose.h>
24 #include "osl/diagnose.hxx"
25 #include <osl/thread.h>
26 #include <osl/mutex.hxx>
27 #include <osl/time.h>
29 #include <cppuhelper/implbase3.hxx>
30 #include <cppuhelper/factory.hxx>
31 #include "cppuhelper/exc_hlp.hxx"
32 #include "cppuhelper/compbase_ex.hxx"
33 #include <cppuhelper/supportsservice.hxx>
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <com/sun/star/lang/XComponent.hpp>
36 #include "com/sun/star/uno/Any.hxx"
37 #include "com/sun/star/uno/RuntimeException.hpp"
38 #include "com/sun/star/uno/Sequence.hxx"
40 #include "test/testtools/bridgetest/Constructors.hpp"
41 #include "test/testtools/bridgetest/Constructors2.hpp"
42 #include "test/testtools/bridgetest/TestPolyStruct.hpp"
43 #include "test/testtools/bridgetest/TestPolyStruct2.hpp"
44 #include "test/testtools/bridgetest/XBridgeTest2.hpp"
45 #include "test/testtools/bridgetest/XMulti.hpp"
47 #include "currentcontextchecker.hxx"
48 #include "multi.hxx"
50 using namespace osl;
51 using namespace cppu;
52 using namespace com::sun::star::uno;
53 using namespace com::sun::star::lang;
54 using namespace com::sun::star::registry;
55 using namespace test::testtools::bridgetest;
58 #define SERVICENAME "com.sun.star.test.bridge.CppTestObject"
59 #define IMPLNAME "com.sun.star.comp.bridge.CppTestObject"
61 namespace bridge_object
65 inline static Sequence< OUString > getSupportedServiceNames()
67 OUString aName( SERVICENAME );
68 return Sequence< OUString >( &aName, 1 );
72 static void assign( TestElement & rData,
73 bool bBool, sal_Unicode cChar, sal_Int8 nByte,
74 sal_Int16 nShort, sal_uInt16 nUShort,
75 sal_Int32 nLong, sal_uInt32 nULong,
76 sal_Int64 nHyper, sal_uInt64 nUHyper,
77 float fFloat, double fDouble,
78 TestEnum eEnum, const OUString& rStr,
79 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
80 const ::com::sun::star::uno::Any& rAny )
82 rData.Bool = bBool;
83 rData.Char = cChar;
84 rData.Byte = nByte;
85 rData.Short = nShort;
86 rData.UShort = nUShort;
87 rData.Long = nLong;
88 rData.ULong = nULong;
89 rData.Hyper = nHyper;
90 rData.UHyper = nUHyper;
91 rData.Float = fFloat;
92 rData.Double = fDouble;
93 rData.Enum = eEnum;
94 rData.String = rStr;
95 rData.Interface = xTest;
96 rData.Any = rAny;
99 static void assign( TestData & rData,
100 bool bBool, sal_Unicode cChar, sal_Int8 nByte,
101 sal_Int16 nShort, sal_uInt16 nUShort,
102 sal_Int32 nLong, sal_uInt32 nULong,
103 sal_Int64 nHyper, sal_uInt64 nUHyper,
104 float fFloat, double fDouble,
105 TestEnum eEnum, const OUString& rStr,
106 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
107 const ::com::sun::star::uno::Any& rAny,
108 const com::sun::star::uno::Sequence< TestElement >& rSequence )
110 assign( (TestElement &)rData,
111 bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble,
112 eEnum, rStr, xTest, rAny );
113 rData.Sequence = rSequence;
117 class Test_Impl :
118 public osl::DebugBase<Test_Impl>,
119 public WeakImplHelper3< XBridgeTest2, XServiceInfo , XRecursiveCall >
121 TestData _aData, _aStructData;
122 sal_Int32 m_nLastCallId;
123 bool m_bFirstCall;
124 bool m_bSequenceOfCallTestPassed;
125 Mutex m_mutex;
127 Sequence<sal_Bool> _arBool;
128 Sequence<sal_Unicode> _arChar;
129 Sequence<sal_Int8> _arByte;
130 Sequence<sal_Int16> _arShort;
131 Sequence<sal_uInt16> _arUShort;
132 Sequence<sal_Int32> _arLong;
133 Sequence<sal_uInt32> _arULong;
134 Sequence<sal_Int64> _arHyper;
135 Sequence<sal_uInt64> _arUHyper;
136 Sequence<OUString> _arString;
137 Sequence<float> _arFloat;
138 Sequence<double> _arDouble;
139 Sequence<TestEnum> _arEnum;
140 Sequence<Reference<XInterface> > _arObject;
141 Sequence<Sequence<sal_Int32> > _arLong2;
142 Sequence<Sequence<Sequence<sal_Int32> > > _arLong3;
143 Sequence<Any> _arAny;
144 Sequence<TestElement> _arStruct;
146 public:
147 Test_Impl() : m_nLastCallId( 0 ),
148 m_bFirstCall( true ),
149 m_bSequenceOfCallTestPassed( true )
151 virtual ~Test_Impl()
153 OSL_TRACE( "> scalar Test_Impl dtor <" );
156 void SAL_CALL acquire() throw () SAL_OVERRIDE
158 OWeakObject::acquire();
160 void SAL_CALL release() throw () SAL_OVERRIDE
162 OWeakObject::release();
165 // XServiceInfo
166 virtual OUString SAL_CALL getImplementationName() throw (RuntimeException, std::exception) SAL_OVERRIDE;
167 virtual sal_Bool SAL_CALL supportsService( const OUString & rServiceName ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
168 virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (RuntimeException, std::exception) SAL_OVERRIDE;
170 // XLBTestBase
171 virtual void SAL_CALL setValues( sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte,
172 sal_Int16 nShort, sal_uInt16 nUShort,
173 sal_Int32 nLong, sal_uInt32 nULong,
174 sal_Int64 nHyper, sal_uInt64 nUHyper,
175 float fFloat, double fDouble,
176 TestEnum eEnum, const OUString& rStr,
177 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
178 const ::com::sun::star::uno::Any& rAny,
179 const ::com::sun::star::uno::Sequence<TestElement >& rSequence,
180 const TestData& rStruct )
181 throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
183 virtual TestData SAL_CALL setValues2( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte,
184 sal_Int16& nShort, sal_uInt16& nUShort,
185 sal_Int32& nLong, sal_uInt32& nULong,
186 sal_Int64& nHyper, sal_uInt64& nUHyper,
187 float& fFloat, double& fDouble,
188 TestEnum& eEnum, OUString& rStr,
189 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
190 ::com::sun::star::uno::Any& rAny,
191 ::com::sun::star::uno::Sequence<TestElement >& rSequence,
192 TestData& rStruct )
193 throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
195 virtual TestData SAL_CALL getValues( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte,
196 sal_Int16& nShort, sal_uInt16& nUShort,
197 sal_Int32& nLong, sal_uInt32& nULong,
198 sal_Int64& nHyper, sal_uInt64& nUHyper,
199 float& fFloat, double& fDouble,
200 TestEnum& eEnum, OUString& rStr,
201 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
202 ::com::sun::star::uno::Any& rAny,
203 ::com::sun::star::uno::Sequence< TestElement >& rSequence,
204 TestData& rStruct )
205 throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
207 virtual SmallStruct SAL_CALL echoSmallStruct(const SmallStruct& rStruct) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
208 { return rStruct; }
209 virtual MediumStruct SAL_CALL echoMediumStruct(const MediumStruct& rStruct) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
210 { return rStruct; }
211 virtual BigStruct SAL_CALL echoBigStruct(const BigStruct& rStruct) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
212 { return rStruct; }
213 virtual TwoFloats SAL_CALL echoTwoFloats(const TwoFloats& rStruct) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
214 { return rStruct; }
215 virtual FourFloats SAL_CALL echoFourFloats(const FourFloats& rStruct) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
216 { return rStruct; }
217 virtual MixedFloatAndInteger SAL_CALL echoMixedFloatAndInteger(const MixedFloatAndInteger& rStruct) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
218 { return rStruct; }
219 virtual ThreeByteStruct SAL_CALL echoThreeByteStruct(const ThreeByteStruct& rStruct) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
220 { return rStruct; }
221 virtual sal_Int32 SAL_CALL testPPCAlignment( sal_Int64, sal_Int64, sal_Int32, sal_Int64, sal_Int32 i2 ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
222 { return i2; }
223 virtual sal_Int32 SAL_CALL testPPC64Alignment( double , double , double , sal_Int32 i1 ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
224 { return i1; }
225 virtual double SAL_CALL testTenDoubles( double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, double d10 ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
226 { return d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10; }
227 virtual sal_Bool SAL_CALL getBool() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
228 { return _aData.Bool; }
229 virtual sal_Int8 SAL_CALL getByte() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
230 { return _aData.Byte; }
231 virtual sal_Unicode SAL_CALL getChar() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
232 { return _aData.Char; }
233 virtual sal_Int16 SAL_CALL getShort() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
234 { return _aData.Short; }
235 virtual sal_uInt16 SAL_CALL getUShort() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
236 { return _aData.UShort; }
237 virtual sal_Int32 SAL_CALL getLong() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
238 { return _aData.Long; }
239 virtual sal_uInt32 SAL_CALL getULong() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
240 { return _aData.ULong; }
241 virtual sal_Int64 SAL_CALL getHyper() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
242 { return _aData.Hyper; }
243 virtual sal_uInt64 SAL_CALL getUHyper() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
244 { return _aData.UHyper; }
245 virtual float SAL_CALL getFloat() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
246 { return _aData.Float; }
247 virtual double SAL_CALL getDouble() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
248 { return _aData.Double; }
249 virtual TestEnum SAL_CALL getEnum() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
250 { return _aData.Enum; }
251 virtual OUString SAL_CALL getString() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
252 { return _aData.String; }
253 virtual com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getInterface( ) throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
254 { return _aData.Interface; }
255 virtual com::sun::star::uno::Any SAL_CALL getAny() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
256 { return _aData.Any; }
257 virtual com::sun::star::uno::Sequence< TestElement > SAL_CALL getSequence() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
258 { return _aData.Sequence; }
259 virtual TestData SAL_CALL getStruct() throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
260 { return _aStructData; }
262 virtual void SAL_CALL setBool( sal_Bool _bool ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
263 { _aData.Bool = _bool; }
264 virtual void SAL_CALL setByte( sal_Int8 _byte ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
265 { _aData.Byte = _byte; }
266 virtual void SAL_CALL setChar( sal_Unicode _char ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
267 { _aData.Char = _char; }
268 virtual void SAL_CALL setShort( sal_Int16 _short ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
269 { _aData.Short = _short; }
270 virtual void SAL_CALL setUShort( sal_uInt16 _ushort ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
271 { _aData.UShort = _ushort; }
272 virtual void SAL_CALL setLong( sal_Int32 _long ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
273 { _aData.Long = _long; }
274 virtual void SAL_CALL setULong( sal_uInt32 _ulong ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
275 { _aData.ULong = _ulong; }
276 virtual void SAL_CALL setHyper( sal_Int64 _hyper ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
277 { _aData.Hyper = _hyper; }
278 virtual void SAL_CALL setUHyper( sal_uInt64 _uhyper ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
279 { _aData.UHyper = _uhyper; }
280 virtual void SAL_CALL setFloat( float _float ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
281 { _aData.Float = _float; }
282 virtual void SAL_CALL setDouble( double _double ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
283 { _aData.Double = _double; }
284 virtual void SAL_CALL setEnum( TestEnum _enum ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
285 { _aData.Enum = _enum; }
286 virtual void SAL_CALL setString( const OUString& _string ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
287 { _aData.String = _string; }
288 virtual void SAL_CALL setInterface( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _interface ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
289 { _aData.Interface = _interface; }
290 virtual void SAL_CALL setAny( const ::com::sun::star::uno::Any& _any ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
291 { _aData.Any = _any; }
292 virtual void SAL_CALL setSequence( const ::com::sun::star::uno::Sequence<TestElement >& _sequence ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
293 { _aData.Sequence = _sequence; }
294 virtual void SAL_CALL setStruct( const TestData& _struct ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
295 { _aStructData = _struct; }
297 virtual sal_Int32 SAL_CALL getRaiseAttr1() throw (RuntimeException, std::exception) SAL_OVERRIDE
298 { throw RuntimeException(); }
300 virtual void SAL_CALL setRaiseAttr1(sal_Int32)
301 throw (IllegalArgumentException, RuntimeException, std::exception) SAL_OVERRIDE
302 { throw IllegalArgumentException(); }
304 virtual sal_Int32 SAL_CALL getRaiseAttr2()
305 throw (IllegalArgumentException, RuntimeException, std::exception) SAL_OVERRIDE
306 { throw IllegalArgumentException(); }
308 virtual TestPolyStruct< sal_Bool > SAL_CALL transportPolyBoolean(
309 TestPolyStruct< sal_Bool > const & arg) throw (RuntimeException, std::exception) SAL_OVERRIDE
310 { return arg; }
312 virtual void SAL_CALL transportPolyHyper(TestPolyStruct< sal_Int64 > &)
313 throw (RuntimeException, std::exception) SAL_OVERRIDE {}
315 virtual void SAL_CALL transportPolySequence(
316 TestPolyStruct< Sequence< Any > > const & arg1,
317 TestPolyStruct< Sequence< Any > > & arg2) throw (RuntimeException, std::exception) SAL_OVERRIDE
318 { arg2 = arg1; }
320 virtual TestPolyStruct< sal_Int32 > SAL_CALL getNullPolyLong()
321 throw (RuntimeException, std::exception) SAL_OVERRIDE
322 { return TestPolyStruct< sal_Int32 >(0); /* work around MS compiler bug */ }
324 virtual TestPolyStruct< OUString > SAL_CALL getNullPolyString()
325 throw (RuntimeException, std::exception) SAL_OVERRIDE
326 { return TestPolyStruct< OUString >(); }
328 virtual TestPolyStruct< Type > SAL_CALL getNullPolyType()
329 throw (RuntimeException, std::exception) SAL_OVERRIDE
330 { return TestPolyStruct< Type >(); }
332 virtual TestPolyStruct< Any > SAL_CALL getNullPolyAny()
333 throw (RuntimeException, std::exception) SAL_OVERRIDE
334 { return TestPolyStruct< Any >(); }
336 virtual TestPolyStruct< Sequence< sal_Bool > > SAL_CALL
337 getNullPolySequence() throw (RuntimeException, std::exception) SAL_OVERRIDE
338 { return TestPolyStruct< Sequence< sal_Bool > >(); }
340 virtual TestPolyStruct< TestEnum > SAL_CALL getNullPolyEnum()
341 throw (RuntimeException, std::exception) SAL_OVERRIDE
342 { return TestPolyStruct< TestEnum >(
343 test::testtools::bridgetest::TestEnum_TEST);
344 /* work around MS compiler bug */ }
346 virtual TestPolyStruct< TestBadEnum > SAL_CALL getNullPolyBadEnum()
347 throw (RuntimeException, std::exception) SAL_OVERRIDE
348 { return TestPolyStruct< TestBadEnum >(
349 test::testtools::bridgetest::TestBadEnum_M);
350 /* explicitly instantiate with default enumerator */ }
352 virtual TestPolyStruct< TestStruct > SAL_CALL getNullPolyStruct()
353 throw (RuntimeException, std::exception) SAL_OVERRIDE
354 { return TestPolyStruct< TestStruct >(); }
356 virtual TestPolyStruct< Reference< XBridgeTestBase > > SAL_CALL
357 getNullPolyInterface() throw (RuntimeException, std::exception) SAL_OVERRIDE
358 { return TestPolyStruct< Reference< XBridgeTestBase > >(); }
360 virtual ::com::sun::star::uno::Any SAL_CALL transportAny(
361 const ::com::sun::star::uno::Any& value )
362 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
364 virtual void SAL_CALL call( sal_Int32 nCallId, sal_Int32 nWaitMUSEC )
365 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
366 virtual void SAL_CALL callOneway( sal_Int32 nCallId, sal_Int32 nWaitMUSEC )
367 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
368 virtual sal_Bool SAL_CALL sequenceOfCallTestPassed( )
369 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
370 virtual void SAL_CALL startRecursiveCall(
371 const ::com::sun::star::uno::Reference< XRecursiveCall >& xCall, sal_Int32 nToCall )
372 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
374 virtual Reference< XMulti > SAL_CALL getMulti() throw (RuntimeException, std::exception) SAL_OVERRIDE;
376 virtual OUString SAL_CALL testMulti(Reference< XMulti > const & multi)
377 throw (RuntimeException, std::exception) SAL_OVERRIDE;
379 public: // XBridgeTest
380 virtual TestData SAL_CALL raiseException( sal_Int16 nArgumentPos, const OUString & rMsg, const Reference< XInterface > & xCOntext )
381 throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
383 virtual void SAL_CALL raiseRuntimeExceptionOneway(
384 const OUString& Message, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Context )
385 throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
387 virtual sal_Int32 SAL_CALL getRuntimeException() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
388 virtual void SAL_CALL setRuntimeException( sal_Int32 _runtimeexception ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
390 // XBridgeTest2
391 virtual Sequence< sal_Bool > SAL_CALL setSequenceBool(
392 const Sequence< sal_Bool >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
393 virtual Sequence< sal_Unicode > SAL_CALL setSequenceChar(
394 const Sequence< sal_Unicode >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
395 virtual Sequence< sal_Int8 > SAL_CALL setSequenceByte(
396 const Sequence< sal_Int8 >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
397 virtual Sequence< sal_Int16 > SAL_CALL setSequenceShort(
398 const Sequence< sal_Int16 >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
399 virtual Sequence< sal_uInt16 > SAL_CALL setSequenceUShort(
400 const Sequence< sal_uInt16 >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
401 virtual Sequence< sal_Int32 > SAL_CALL setSequenceLong(
402 const Sequence< sal_Int32 >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
403 virtual Sequence< sal_uInt32 > SAL_CALL setSequenceULong(
404 const Sequence< sal_uInt32 >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
405 virtual Sequence< sal_Int64 > SAL_CALL setSequenceHyper(
406 const Sequence< sal_Int64 >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
407 virtual Sequence< sal_uInt64 > SAL_CALL setSequenceUHyper(
408 const Sequence< sal_uInt64 >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
409 virtual Sequence< float > SAL_CALL setSequenceFloat(
410 const Sequence< float >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
411 virtual Sequence< double > SAL_CALL setSequenceDouble(
412 const Sequence< double >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
413 virtual Sequence< TestEnum > SAL_CALL setSequenceEnum(
414 const Sequence< TestEnum >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE ;
415 virtual Sequence< OUString > SAL_CALL setSequenceString(
416 const Sequence< OUString >& aString ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
417 virtual Sequence< Reference< XInterface > > SAL_CALL setSequenceXInterface(
418 const Sequence< Reference< XInterface > >& aSeq )
419 throw (RuntimeException, std::exception) SAL_OVERRIDE;
420 virtual Sequence<Any > SAL_CALL setSequenceAny(
421 const Sequence<Any >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
422 virtual Sequence<TestElement > SAL_CALL setSequenceStruct(
423 const Sequence< TestElement >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
424 virtual Sequence< Sequence< sal_Int32 > > SAL_CALL setDim2(
425 const Sequence<Sequence< sal_Int32 > >& aSeq ) throw (RuntimeException, std::exception) SAL_OVERRIDE;
426 virtual Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL setDim3(
427 const Sequence< Sequence< Sequence< sal_Int32 > > >& aSeq )
428 throw (RuntimeException, std::exception) SAL_OVERRIDE;
429 virtual void SAL_CALL setSequencesInOut(Sequence< sal_Bool >& aSeqBoolean,
430 Sequence< sal_Unicode >& aSeqChar,
431 Sequence< sal_Int8 >& aSeqByte,
432 Sequence< sal_Int16 >& aSeqShort,
433 Sequence< sal_uInt16 >& aSeqUShort,
434 Sequence< sal_Int32 >& aSeqLong,
435 Sequence< sal_uInt32 >& aSeqULong,
436 Sequence< sal_Int64 >& aSeqHyper,
437 Sequence< sal_uInt64 >& aSeqUHyper,
438 Sequence< float >& aSeqFloat,
439 Sequence< double >& aSeqDouble,
440 Sequence< TestEnum >& aSeqTestEnum,
441 Sequence< OUString >& aSeqString,
442 Sequence<Reference<XInterface > >& aSeqXInterface,
443 Sequence< Any >& aSeqAny,
444 Sequence< Sequence< sal_Int32 > >& aSeqDim2,
445 Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 )
446 throw (RuntimeException, std::exception) SAL_OVERRIDE;
447 virtual void SAL_CALL setSequencesOut( Sequence< sal_Bool >& aSeqBoolean,
448 Sequence< sal_Unicode >& aSeqChar,
449 Sequence< sal_Int8 >& aSeqByte,
450 Sequence< sal_Int16 >& aSeqShort,
451 Sequence< sal_uInt16 >& aSeqUShort,
452 Sequence< sal_Int32 >& aSeqLong,
453 Sequence< sal_uInt32 >& aSeqULong,
454 Sequence< sal_Int64 >& aSeqHyper,
455 Sequence< sal_uInt64 >& aSeqUHyper,
456 Sequence< float >& aSeqFloat,
457 Sequence< double >& aSeqDouble,
458 Sequence< TestEnum >& aSeqEnum,
459 Sequence< OUString >& aSeqString,
460 Sequence< Reference< XInterface > >& aSeqXInterface,
461 Sequence< Any >& aSeqAny,
462 Sequence< Sequence< sal_Int32 > >& aSeqDim2,
463 Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 )
464 throw (RuntimeException, std::exception) SAL_OVERRIDE;
465 virtual void SAL_CALL testConstructorsService(
466 Reference< XComponentContext > const & context)
467 throw (RuntimeException, std::exception) SAL_OVERRIDE;
468 virtual Reference< XCurrentContextChecker > SAL_CALL
469 getCurrentContextChecker()
470 throw (RuntimeException, std::exception) SAL_OVERRIDE;
472 public:
473 virtual void SAL_CALL callRecursivly( const ::com::sun::star::uno::Reference< XRecursiveCall >& xCall, sal_Int32 nToCall ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
476 //Dummy class for XComponent implementation
477 class Dummy : public osl::DebugBase<Dummy>,
478 public WeakComponentImplHelperBase
480 public:
481 Dummy(): WeakComponentImplHelperBase(*Mutex::getGlobalMutex()){}
485 Any Test_Impl::transportAny( const Any & value ) throw ( ::com::sun::star::uno::RuntimeException, std::exception)
487 return value;
492 namespace {
494 void wait(sal_Int32 microSeconds) {
495 OSL_ASSERT(microSeconds >= 0 && microSeconds <= SAL_MAX_INT32 / 1000);
496 TimeValue t = {
497 static_cast< sal_uInt32 >(microSeconds / 1000000),
498 static_cast< sal_uInt32 >(microSeconds * 1000) };
499 osl_waitThread(&t);
504 void Test_Impl::call( sal_Int32 nCallId , sal_Int32 nWaitMUSEC ) throw(::com::sun::star::uno::RuntimeException, std::exception)
506 wait(nWaitMUSEC);
507 if( m_bFirstCall )
509 m_bFirstCall = false;
511 else
513 m_bSequenceOfCallTestPassed = m_bSequenceOfCallTestPassed && (nCallId > m_nLastCallId);
515 m_nLastCallId = nCallId;
519 void Test_Impl::callOneway( sal_Int32 nCallId , sal_Int32 nWaitMUSEC ) throw (::com::sun::star::uno::RuntimeException, std::exception)
521 wait(nWaitMUSEC);
522 m_bSequenceOfCallTestPassed = m_bSequenceOfCallTestPassed && (nCallId > m_nLastCallId);
523 m_nLastCallId = nCallId;
527 sal_Bool Test_Impl::sequenceOfCallTestPassed() throw (::com::sun::star::uno::RuntimeException, std::exception)
529 return m_bSequenceOfCallTestPassed;
533 void SAL_CALL Test_Impl::startRecursiveCall(
534 const ::com::sun::star::uno::Reference< XRecursiveCall >& xCall, sal_Int32 nToCall )
535 throw(::com::sun::star::uno::RuntimeException, std::exception)
537 MutexGuard guard( m_mutex );
538 if( nToCall )
540 nToCall --;
541 xCall->callRecursivly( this , nToCall );
546 void SAL_CALL Test_Impl::callRecursivly(
547 const ::com::sun::star::uno::Reference< XRecursiveCall >& xCall,
548 sal_Int32 nToCall )
549 throw(::com::sun::star::uno::RuntimeException, std::exception)
551 MutexGuard guard( m_mutex );
552 if( nToCall )
554 nToCall --;
555 xCall->callRecursivly( this , nToCall );
559 Reference< XMulti > Test_Impl::getMulti() throw (RuntimeException, std::exception) {
560 return new testtools::bridgetest::Multi;
563 OUString Test_Impl::testMulti(Reference< XMulti > const & multi)
564 throw (RuntimeException, std::exception)
566 return testtools::bridgetest::testMulti(multi);
570 void Test_Impl::setValues( sal_Bool bBool, sal_Unicode cChar, sal_Int8 nByte,
571 sal_Int16 nShort, sal_uInt16 nUShort,
572 sal_Int32 nLong, sal_uInt32 nULong,
573 sal_Int64 nHyper, sal_uInt64 nUHyper,
574 float fFloat, double fDouble,
575 TestEnum eEnum, const OUString& rStr,
576 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
577 const ::com::sun::star::uno::Any& rAny,
578 const ::com::sun::star::uno::Sequence<TestElement >& rSequence,
579 const TestData& rStruct )
580 throw(com::sun::star::uno::RuntimeException, std::exception)
582 assign( _aData,
583 bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble,
584 eEnum, rStr, xTest, rAny, rSequence );
585 _aStructData = rStruct;
588 TestData Test_Impl::setValues2( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte,
589 sal_Int16& nShort, sal_uInt16& nUShort,
590 sal_Int32& nLong, sal_uInt32& nULong,
591 sal_Int64& nHyper, sal_uInt64& nUHyper,
592 float& fFloat, double& fDouble,
593 TestEnum& eEnum, OUString& rStr,
594 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
595 ::com::sun::star::uno::Any& rAny,
596 ::com::sun::star::uno::Sequence<TestElement >& rSequence,
597 TestData& rStruct )
598 throw(com::sun::star::uno::RuntimeException, std::exception)
600 assign( _aData,
601 bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble,
602 eEnum, rStr, xTest, rAny, rSequence );
603 _aStructData = rStruct;
605 TestElement elem = rSequence[ 0 ];
606 rSequence[ 0 ] = rSequence[ 1 ];
607 rSequence[ 1 ] = elem;
609 return _aStructData;
612 TestData Test_Impl::getValues( sal_Bool& bBool, sal_Unicode& cChar, sal_Int8& nByte,
613 sal_Int16& nShort, sal_uInt16& nUShort,
614 sal_Int32& nLong, sal_uInt32& nULong,
615 sal_Int64& nHyper, sal_uInt64& nUHyper,
616 float& fFloat, double& fDouble,
617 TestEnum& eEnum, OUString& rStr,
618 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xTest,
619 ::com::sun::star::uno::Any& rAny,
620 ::com::sun::star::uno::Sequence<TestElement >& rSequence,
621 TestData& rStruct )
622 throw(com::sun::star::uno::RuntimeException, std::exception)
624 bBool = _aData.Bool;
625 cChar = _aData.Char;
626 nByte = _aData.Byte;
627 nShort = _aData.Short;
628 nUShort = _aData.UShort;
629 nLong = _aData.Long;
630 nULong = _aData.ULong;
631 nHyper = _aData.Hyper;
632 nUHyper = _aData.UHyper;
633 fFloat = _aData.Float;
634 fDouble = _aData.Double;
635 eEnum = _aData.Enum;
636 rStr = _aData.String;
637 xTest = _aData.Interface;
638 rAny = _aData.Any;
639 rSequence = _aData.Sequence;
640 rStruct = _aStructData;
641 return _aStructData;
644 TestData Test_Impl::raiseException( sal_Int16 nArgumentPos, const OUString & rMsg, const Reference< XInterface > & xContext )
645 throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception)
647 IllegalArgumentException aExc;
648 aExc.ArgumentPosition = nArgumentPos;
649 aExc.Message = _aData.String = rMsg;
650 aExc.Context = _aData.Interface = xContext;
651 throw aExc;
654 void Test_Impl::raiseRuntimeExceptionOneway( const OUString & rMsg, const Reference< XInterface > & xContext )
655 throw(::com::sun::star::uno::RuntimeException, std::exception)
657 RuntimeException aExc;
658 aExc.Message = _aData.String = rMsg;
659 aExc.Context = _aData.Interface = xContext;
660 throw aExc;
663 void dothrow2(const RuntimeException& e)
665 throw e;
667 void dothrow(const RuntimeException& e)
669 #if defined _MSC_VER
670 // currently only for MSVC:
671 // just to test whether all bridges fall back to a RuntimeException
672 // in case of a thrown non-UNO exception:
675 throw ::std::bad_alloc();
677 catch (...)
681 Any a( getCaughtException() );
682 RuntimeException exc;
683 OSL_VERIFY( a >>= exc );
684 OSL_TRACE(
685 OUStringToOString(
686 exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() );
688 catch (...) // never throws anything
690 fprintf( stderr, "\ngetCaughtException() failed!\n" );
691 exit( 1 );
694 #endif
695 dothrow2( e );
698 sal_Int32 Test_Impl::getRuntimeException()
699 throw (RuntimeException, std::exception)
703 dothrow( RuntimeException( _aData.String, _aData.Interface ) );
705 catch (Exception &)
707 Any a( getCaughtException() );
708 throwException( a );
710 return 0; // for dummy
713 void Test_Impl::setRuntimeException( sal_Int32 ) throw(::com::sun::star::uno::RuntimeException, std::exception)
715 RuntimeException aExc;
716 aExc.Message = _aData.String;
717 aExc.Context = _aData.Interface;
718 throwException( makeAny( aExc ) );
721 // XBridgeTest2 -------------------------------------------------------------
722 Sequence< sal_Bool > SAL_CALL Test_Impl::setSequenceBool(
723 const Sequence< sal_Bool >& aSeq ) throw (RuntimeException, std::exception)
725 _arBool = aSeq;
726 return aSeq;
729 Sequence< sal_Unicode > SAL_CALL Test_Impl::setSequenceChar(
730 const Sequence< sal_Unicode >& aSeq ) throw (RuntimeException, std::exception)
732 _arChar = aSeq;
733 return aSeq;
736 Sequence< sal_Int8 > SAL_CALL Test_Impl::setSequenceByte(
737 const Sequence< sal_Int8 >& aSeq ) throw (RuntimeException, std::exception)
739 _arByte = aSeq;
740 return aSeq;
743 Sequence< sal_Int16 > SAL_CALL Test_Impl::setSequenceShort(
744 const Sequence< sal_Int16 >& aSeq ) throw (RuntimeException, std::exception)
746 _arShort = aSeq;
747 return aSeq;
750 Sequence< sal_uInt16 > SAL_CALL Test_Impl::setSequenceUShort(
751 const Sequence< sal_uInt16 >& aSeq ) throw (RuntimeException, std::exception)
753 _arUShort = aSeq;
754 return aSeq;
757 Sequence< sal_Int32 > SAL_CALL Test_Impl::setSequenceLong(
758 const Sequence< sal_Int32 >& aSeq ) throw (RuntimeException, std::exception)
760 _arLong = aSeq;
761 return aSeq;
764 Sequence< sal_uInt32 > SAL_CALL Test_Impl::setSequenceULong(
765 const Sequence< sal_uInt32 >& aSeq ) throw (RuntimeException, std::exception)
767 _arULong = aSeq;
768 return aSeq;
771 Sequence< sal_Int64 > SAL_CALL Test_Impl::setSequenceHyper(
772 const Sequence< sal_Int64 >& aSeq ) throw (RuntimeException, std::exception)
774 _arHyper = aSeq;
775 return aSeq;
778 Sequence< sal_uInt64 > SAL_CALL Test_Impl::setSequenceUHyper(
779 const Sequence< sal_uInt64 >& aSeq ) throw (RuntimeException, std::exception)
781 _arUHyper = aSeq;
782 return aSeq;
785 Sequence< float > SAL_CALL Test_Impl::setSequenceFloat(
786 const Sequence< float >& aSeq ) throw (RuntimeException, std::exception)
788 _arFloat = aSeq;
789 return aSeq;
792 Sequence< double > SAL_CALL Test_Impl::setSequenceDouble(
793 const Sequence< double >& aSeq ) throw (RuntimeException, std::exception)
795 _arDouble = aSeq;
796 return aSeq;
799 Sequence< TestEnum > SAL_CALL Test_Impl::setSequenceEnum(
800 const Sequence< TestEnum >& aSeq ) throw (RuntimeException, std::exception)
802 _arEnum = aSeq;
803 return aSeq;
806 Sequence< OUString > SAL_CALL Test_Impl::setSequenceString(
807 const Sequence< OUString >& aSeq ) throw (RuntimeException, std::exception)
809 _arString = aSeq;
810 return aSeq;
813 Sequence< Reference< XInterface > > SAL_CALL Test_Impl::setSequenceXInterface(
814 const Sequence< Reference< XInterface > >& aSeq )
815 throw (RuntimeException, std::exception)
817 _arObject = aSeq;
818 return aSeq;
821 Sequence<Any > SAL_CALL Test_Impl::setSequenceAny(
822 const Sequence<Any >& aSeq ) throw (RuntimeException, std::exception)
824 _arAny = aSeq;
825 return aSeq;
828 Sequence<TestElement > SAL_CALL Test_Impl::setSequenceStruct(
829 const Sequence< TestElement >& aSeq ) throw (RuntimeException, std::exception)
831 _arStruct = aSeq;
832 return aSeq;
835 Sequence< Sequence< sal_Int32 > > SAL_CALL Test_Impl::setDim2(
836 const Sequence<Sequence< sal_Int32 > >& aSeq ) throw (RuntimeException, std::exception)
838 _arLong2 = aSeq;
839 return aSeq;
842 Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL Test_Impl::setDim3(
843 const Sequence< Sequence< Sequence< sal_Int32 > > >& aSeq )
844 throw (RuntimeException, std::exception)
846 _arLong3 = aSeq;
847 return aSeq;
850 void SAL_CALL Test_Impl::setSequencesInOut(Sequence< sal_Bool >& aSeqBoolean,
851 Sequence< sal_Unicode >& aSeqChar,
852 Sequence< sal_Int8 >& aSeqByte,
853 Sequence< sal_Int16 >& aSeqShort,
854 Sequence< sal_uInt16 >& aSeqUShort,
855 Sequence< sal_Int32 >& aSeqLong,
856 Sequence< sal_uInt32 >& aSeqULong,
857 Sequence< sal_Int64 >& aSeqHyper,
858 Sequence< sal_uInt64 >& aSeqUHyper,
859 Sequence< float >& aSeqFloat,
860 Sequence< double >& aSeqDouble,
861 Sequence< TestEnum >& aSeqTestEnum,
862 Sequence< OUString >& aSeqString,
863 Sequence<Reference<XInterface > >& aSeqXInterface,
864 Sequence< Any >& aSeqAny,
865 Sequence< Sequence< sal_Int32 > >& aSeqDim2,
866 Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 )
867 throw (RuntimeException, std::exception)
869 _arBool = aSeqBoolean;
870 _arChar = aSeqChar;
871 _arByte = aSeqByte;
872 _arShort = aSeqShort;
873 _arUShort = aSeqUShort;
874 _arLong = aSeqLong;
875 _arULong = aSeqULong;
876 _arHyper = aSeqHyper;
877 _arUHyper = aSeqUHyper;
878 _arFloat = aSeqFloat;
879 _arDouble = aSeqDouble;
880 _arEnum = aSeqTestEnum;
881 _arString = aSeqString;
882 _arObject = aSeqXInterface;
883 _arAny = aSeqAny;
884 _arLong2 = aSeqDim2;
885 _arLong3 = aSeqDim3;
888 void SAL_CALL Test_Impl::setSequencesOut( Sequence< sal_Bool >& aSeqBoolean,
889 Sequence< sal_Unicode >& aSeqChar,
890 Sequence< sal_Int8 >& aSeqByte,
891 Sequence< sal_Int16 >& aSeqShort,
892 Sequence< sal_uInt16 >& aSeqUShort,
893 Sequence< sal_Int32 >& aSeqLong,
894 Sequence< sal_uInt32 >& aSeqULong,
895 Sequence< sal_Int64 >& aSeqHyper,
896 Sequence< sal_uInt64 >& aSeqUHyper,
897 Sequence< float >& aSeqFloat,
898 Sequence< double >& aSeqDouble,
899 Sequence< TestEnum >& aSeqEnum,
900 Sequence< OUString >& aSeqString,
901 Sequence< Reference< XInterface > >& aSeqXInterface,
902 Sequence< Any >& aSeqAny,
903 Sequence< Sequence< sal_Int32 > >& aSeqDim2,
904 Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 )
905 throw (RuntimeException, std::exception)
907 aSeqBoolean = _arBool;
908 aSeqChar = _arChar;
909 aSeqByte = _arByte;
910 aSeqShort = _arShort;
911 aSeqUShort = _arUShort;
912 aSeqLong = _arLong;
913 aSeqULong = _arULong;
914 aSeqHyper = _arHyper;
915 aSeqUHyper = _arUHyper;
916 aSeqFloat = _arFloat;
917 aSeqDouble = _arDouble;
918 aSeqEnum = _arEnum;
919 aSeqString = _arString;
920 aSeqXInterface = _arObject;
921 aSeqAny = _arAny;
922 aSeqDim2 = _arLong2;
923 aSeqDim3 = _arLong3;
926 void Test_Impl::testConstructorsService(
927 Reference< XComponentContext > const & context) throw (RuntimeException, std::exception)
929 Sequence< sal_Bool > arg14(1); arg14[0] = true;
930 Sequence< sal_Int8 > arg15(1); arg15[0] = SAL_MIN_INT8;
931 Sequence< sal_Int16 > arg16(1); arg16[0] = SAL_MIN_INT16;
932 Sequence< sal_uInt16 > arg17(1); arg17[0] = SAL_MAX_UINT16;
933 Sequence< sal_Int32 > arg18(1); arg18[0] = SAL_MIN_INT32;
934 Sequence< sal_uInt32 > arg19(1); arg19[0] = SAL_MAX_UINT32;
935 Sequence< sal_Int64 > arg20(1); arg20[0] = SAL_MIN_INT64;
936 Sequence< sal_uInt64 > arg21(1); arg21[0] = SAL_MAX_UINT64;
937 Sequence< float > arg22(1); arg22[0] = 0.123f;
938 Sequence< double > arg23(1); arg23[0] = 0.456;
939 Sequence< sal_Unicode > arg24(1); arg24[0] = 'X';
940 Sequence< OUString > arg25(1);
941 arg25[0] = "test";
942 Sequence< Type > arg26(1); arg26[0] = UnoType< Any >::get();
943 Sequence< Any > arg27(1); arg27[0] <<= true;
944 Sequence< Sequence< sal_Bool > > arg28(1);
945 arg28[0] = Sequence< sal_Bool >(1); arg28[0][0] = true;
946 Sequence< Sequence< Any > > arg29(1); arg29[0] = Sequence< Any >(1);
947 arg29[0][0] <<= true;
948 Sequence< TestEnum > arg30(1); arg30[0] = TestEnum_TWO;
949 Sequence< TestStruct > arg31(1); arg31[0].member = 10;
950 Sequence< TestPolyStruct< sal_Bool > > arg32(1); arg32[0].member = true;
951 Sequence< TestPolyStruct< Any > > arg33(1); arg33[0].member <<= true;
952 Sequence< Reference< XInterface > > arg34(1);
953 Constructors::create1(context,
954 true,
955 SAL_MIN_INT8,
956 SAL_MIN_INT16,
957 SAL_MAX_UINT16,
958 SAL_MIN_INT32,
959 SAL_MAX_UINT32,
960 SAL_MIN_INT64,
961 SAL_MAX_UINT64,
962 0.123f,
963 0.456,
964 'X',
965 OUString("test"),
966 UnoType< Any >::get(),
967 makeAny(true),
968 arg14,
969 arg15,
970 arg16,
971 arg17,
972 arg18,
973 arg19,
974 arg20,
975 arg21,
976 arg22,
977 arg23,
978 arg24,
979 arg25,
980 arg26,
981 arg27,
982 arg28,
983 arg29,
984 arg30,
985 arg31,
986 arg32,
987 arg33,
988 arg34,
989 TestEnum_TWO,
990 TestStruct(10),
991 TestPolyStruct< sal_Bool >(true),
992 TestPolyStruct< Any >(makeAny(true)),
993 Reference< XInterface >(0));
994 Sequence< Any > args(40);
995 args[0] <<= true;
996 args[1] <<= SAL_MIN_INT8;
997 args[2] <<= SAL_MIN_INT16;
998 args[3] <<= SAL_MAX_UINT16;
999 args[4] <<= SAL_MIN_INT32;
1000 args[5] <<= SAL_MAX_UINT32;
1001 args[6] <<= SAL_MIN_INT64;
1002 args[7] <<= SAL_MAX_UINT64;
1003 args[8] <<= 0.123f;
1004 args[9] <<= 0.456;
1005 sal_Unicode arg10c = 'X';
1006 args[10].setValue(&arg10c, UnoType< UnoCharType >::get());
1007 args[11] <<= OUString("test");
1008 args[12] <<= UnoType< Any >::get();
1009 args[13] <<= true;
1010 args[14] <<= arg14;
1011 args[15] <<= arg15;
1012 args[16] <<= arg16;
1013 args[17] <<= arg17;
1014 args[18] <<= arg18;
1015 args[19] <<= arg19;
1016 args[20] <<= arg20;
1017 args[21] <<= arg21;
1018 args[22] <<= arg22;
1019 args[23] <<= arg23;
1020 args[24].setValue(&arg24, UnoType< UnoSequenceType< UnoCharType > >::get());
1021 args[25] <<= arg25;
1022 args[26] <<= arg26;
1023 args[27] <<= arg27;
1024 args[28] <<= arg28;
1025 args[29] <<= arg29;
1026 args[30] <<= arg30;
1027 args[31] <<= arg31;
1028 args[32] <<= arg32;
1029 args[33] <<= arg33;
1030 args[34] <<= arg34;
1031 args[35] <<= TestEnum_TWO;
1032 args[36] <<= TestStruct(10);
1033 args[37] <<= TestPolyStruct< sal_Bool >(true);
1034 args[38] <<= TestPolyStruct< Any >(makeAny(true));
1035 args[39] <<= Reference< XInterface >(0);
1036 Constructors::create2(context, args);
1038 Sequence<Type> argSeq1(1); argSeq1[0] = cppu::UnoType<sal_Int32>::get();
1039 Sequence<Reference<XInterface> > argSeq2(1); argSeq2[0] = static_cast<XComponent*>(new Dummy());
1040 Sequence<Reference<XComponent> > argSeq2a(1); argSeq2a[0] = static_cast<XComponent*>(new Dummy());
1042 Sequence<TestPolyStruct2<sal_Unicode, Sequence<Any> > > argSeq3(1);
1043 argSeq3[0] = TestPolyStruct2<sal_Unicode, Sequence<Any> >('X', arg27);
1044 Sequence<TestPolyStruct2<TestPolyStruct<sal_Unicode>, Sequence<Any> > > argSeq4(1);
1045 argSeq4[0] = TestPolyStruct2<TestPolyStruct<sal_Unicode>, Sequence<Any> >(
1046 TestPolyStruct<sal_Unicode>('X'), arg27);
1047 Sequence<Sequence<sal_Int32> > argSeq5(1);
1048 argSeq5[0] = Sequence<sal_Int32>(1); argSeq5[0][0] = SAL_MIN_INT32;
1049 Sequence<TestPolyStruct<sal_Int32> > argSeq6(1);
1050 argSeq6[0] = TestPolyStruct<sal_Int32>(SAL_MIN_INT32);
1051 Sequence<TestPolyStruct<TestPolyStruct2<sal_Unicode, Any> > > argSeq7(1);
1052 argSeq7[0] = TestPolyStruct<TestPolyStruct2<sal_Unicode, Any> >(
1053 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)));
1054 Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > > argSeq8(1);
1055 argSeq8[0] = TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > (
1056 TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString>(
1057 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), OUString("test")));
1058 Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > > argSeq9(1);
1059 argSeq9[0] = TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > >(
1060 OUString("test"), TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >(
1061 'X', TestPolyStruct<Any>(Any(true))));
1062 Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> > > argSeq10(1);
1063 argSeq10[0] = TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> >(
1064 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), TestPolyStruct<sal_Unicode>('X'));
1065 Sequence<Sequence<TestPolyStruct<sal_Unicode > > > argSeq11(1);
1066 argSeq11[0] = Sequence<TestPolyStruct<sal_Unicode > >(1);
1067 argSeq11[0][0] = TestPolyStruct<sal_Unicode>('X');
1068 Sequence<Sequence<TestPolyStruct<TestPolyStruct2<sal_Unicode,Any> > > > argSeq12(1);
1069 argSeq12[0] = Sequence<TestPolyStruct<TestPolyStruct2<sal_Unicode,Any> > >(1);
1070 argSeq12[0][0] = TestPolyStruct<TestPolyStruct2<sal_Unicode,Any> >(
1071 TestPolyStruct2<sal_Unicode,Any>('X', Any(true)));
1072 Sequence<Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> > > > argSeq13(1);
1073 argSeq13[0] = Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> > >(1);
1074 argSeq13[0][0] = TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> >(
1075 TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString>(
1076 TestPolyStruct2<sal_Unicode,Any>('X', Any(true)), OUString("test")));
1077 Sequence<Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > > > argSeq14(1);
1078 argSeq14[0] = Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > >(1);
1079 argSeq14[0][0] = TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > >(
1080 OUString("test"), TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >(
1081 'X', TestPolyStruct<Any>(Any(true))));
1082 Sequence<Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> > > > argSeq15(1);
1083 argSeq15[0] = Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> > >(1);
1084 argSeq15[0][0] = TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> >(
1085 TestPolyStruct2<sal_Unicode,Any>('X',Any(true)), TestPolyStruct<sal_Unicode>('X'));
1087 Constructors2::create1(
1088 context,
1089 TestPolyStruct<Type>(cppu::UnoType<sal_Int32>::get()),
1090 TestPolyStruct<Any>(Any(true)),
1091 TestPolyStruct<sal_Bool>(true),
1092 TestPolyStruct<sal_Int8>(SAL_MIN_INT8),
1093 TestPolyStruct<sal_Int16>(SAL_MIN_INT16),
1094 TestPolyStruct<sal_Int32>(SAL_MIN_INT32),
1095 TestPolyStruct<sal_Int64>(SAL_MIN_INT64),
1096 TestPolyStruct<sal_Unicode>('X'),
1097 TestPolyStruct<OUString>(OUString("test")),
1098 TestPolyStruct<float>(0.123f),
1099 TestPolyStruct<double>(0.456),
1100 TestPolyStruct<Reference<XInterface> >(static_cast<XBridgeTest2*>(this)),
1101 TestPolyStruct<Reference<XComponent> >(static_cast<XComponent*>(new Dummy())),
1102 TestPolyStruct<TestEnum>(TestEnum_TWO),
1103 TestPolyStruct<TestPolyStruct2<sal_Unicode, Any> >(
1104 TestPolyStruct2<sal_Unicode, Any>('X', Any(true))),
1105 TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > (
1106 TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString>(
1107 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), OUString("test"))),
1108 TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode,TestPolyStruct<Any> > >(
1109 OUString("test"),
1110 TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >('X', TestPolyStruct<Any>(Any(true)))),
1111 TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> >(
1112 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)),
1113 TestPolyStruct<sal_Unicode>('X')),
1114 TestPolyStruct<Sequence<Type> >(argSeq1),
1115 TestPolyStruct<Sequence<Any> >(arg27),
1116 TestPolyStruct<Sequence<sal_Bool> >(arg14),
1117 TestPolyStruct<Sequence<sal_Int8> >(arg15),
1118 TestPolyStruct<Sequence<sal_Int16> >(arg16),
1119 TestPolyStruct<Sequence<sal_Int32> >(arg18),
1120 TestPolyStruct<Sequence<sal_Int64> >(arg20),
1121 TestPolyStruct<Sequence<sal_Unicode> >(arg24),
1122 TestPolyStruct<Sequence<OUString> >(arg25),
1123 TestPolyStruct<Sequence<float> >(arg22),
1124 TestPolyStruct<Sequence<double> >(arg23),
1125 TestPolyStruct<Sequence<Reference<XInterface> > >(argSeq2),
1126 TestPolyStruct<Sequence<Reference<XComponent> > >(argSeq2a),
1127 TestPolyStruct<Sequence<TestEnum> >(arg30),
1128 TestPolyStruct<Sequence<TestPolyStruct2<sal_Unicode, Sequence<Any> > > >(argSeq3),
1129 TestPolyStruct<Sequence<TestPolyStruct2<TestPolyStruct<sal_Unicode>, Sequence<Any> > > > (argSeq4),
1130 TestPolyStruct<Sequence<Sequence<sal_Int32> > >(argSeq5),
1131 argSeq6,
1132 argSeq7,
1133 argSeq8,
1134 argSeq9,
1135 argSeq10,
1136 argSeq11,
1137 argSeq12,
1138 argSeq13,
1139 argSeq14,
1140 argSeq15);
1143 Reference< XCurrentContextChecker > Test_Impl::getCurrentContextChecker()
1144 throw (RuntimeException, std::exception)
1146 return new testtools::bridgetest::CurrentContextChecker;
1149 // XServiceInfo
1151 OUString Test_Impl::getImplementationName()
1152 throw (RuntimeException, std::exception)
1154 return OUString( IMPLNAME );
1157 sal_Bool Test_Impl::supportsService( const OUString & rServiceName )
1158 throw (RuntimeException, std::exception)
1160 return cppu::supportsService(this, rServiceName);
1163 Sequence< OUString > Test_Impl::getSupportedServiceNames()
1164 throw (RuntimeException, std::exception)
1166 return bridge_object::getSupportedServiceNames();
1172 static Reference< XInterface > SAL_CALL Test_Impl_create(
1173 SAL_UNUSED_PARAMETER const Reference< XMultiServiceFactory > & )
1175 return Reference< XInterface >( (XBridgeTest *)new Test_Impl() );
1180 extern "C"
1182 SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
1183 const sal_Char * pImplName, SAL_UNUSED_PARAMETER void * pServiceManager,
1184 SAL_UNUSED_PARAMETER void * )
1186 void * pRet = 0;
1188 if (pServiceManager && rtl_str_compare( pImplName, IMPLNAME ) == 0)
1190 Reference< XSingleServiceFactory > xFactory( createSingleFactory(
1191 static_cast< XMultiServiceFactory * >( pServiceManager ),
1192 OUString( IMPLNAME ),
1193 bridge_object::Test_Impl_create,
1194 bridge_object::getSupportedServiceNames() ) );
1196 if (xFactory.is())
1198 xFactory->acquire();
1199 pRet = xFactory.get();
1203 return pRet;
1207 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */