tdf#130857 qt weld: Support mail merge "Server Auth" dialog
[LibreOffice.git] / testtools / source / bridgetest / cppobj.cxx
blob1c749ef8a086c87fe965ef3a403a6589a67963a0
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 <thread>
21 #include <utility>
23 #include <cppu/unotype.hxx>
24 #include <o3tl/string_view.hxx>
25 #include <osl/diagnose.h>
26 #include <osl/diagnose.hxx>
27 #include <osl/thread.hxx>
28 #include <osl/mutex.hxx>
30 #include <cppuhelper/implbase.hxx>
31 #include <cppuhelper/factory.hxx>
32 #include <cppuhelper/exc_hlp.hxx>
33 #include <cppuhelper/compbase_ex.hxx>
34 #include <cppuhelper/supportsservice.hxx>
35 #include <com/sun/star/lang/IllegalArgumentException.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/lang/XComponent.hpp>
38 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
39 #include <com/sun/star/uno/Any.hxx>
40 #include <com/sun/star/uno/RuntimeException.hpp>
41 #include <com/sun/star/uno/Sequence.hxx>
43 #include <test/testtools/bridgetest/Constructors.hpp>
44 #include <test/testtools/bridgetest/Constructors2.hpp>
45 #include <test/testtools/bridgetest/TestPolyStruct.hpp>
46 #include <test/testtools/bridgetest/TestPolyStruct2.hpp>
47 #include <test/testtools/bridgetest/XBridgeTest2.hpp>
48 #include <test/testtools/bridgetest/XMulti.hpp>
50 #include "currentcontextchecker.hxx"
51 #include "multi.hxx"
53 using namespace osl;
54 using namespace cppu;
55 using namespace com::sun::star::uno;
56 using namespace com::sun::star::lang;
57 using namespace com::sun::star::registry;
58 using namespace test::testtools::bridgetest;
60 #ifdef _MSC_VER
61 #pragma warning (disable : 4503) // irrelevant for test code
62 #endif
64 constexpr OUString SERVICENAME = u"com.sun.star.test.bridge.CppTestObject"_ustr;
65 constexpr OUString IMPLNAME = u"com.sun.star.comp.bridge.CppTestObject"_ustr;
67 namespace bridge_object
71 static Sequence< OUString > getSupportedServiceNames()
73 return { SERVICENAME };
77 static void assign( TestElement & rData,
78 bool bBool, sal_Unicode cChar, sal_Int8 nByte,
79 sal_Int16 nShort, sal_uInt16 nUShort,
80 sal_Int32 nLong, sal_uInt32 nULong,
81 sal_Int64 nHyper, sal_uInt64 nUHyper,
82 float fFloat, double fDouble,
83 TestEnum eEnum, const OUString& rStr,
84 sal_Int8 nByte2, sal_Int16 nShort2,
85 const css::uno::Reference< css::uno::XInterface >& xTest,
86 const css::uno::Any& rAny )
88 rData.Bool = bBool;
89 rData.Char = cChar;
90 rData.Byte = nByte;
91 rData.Short = nShort;
92 rData.UShort = nUShort;
93 rData.Long = nLong;
94 rData.ULong = nULong;
95 rData.Hyper = nHyper;
96 rData.UHyper = nUHyper;
97 rData.Float = fFloat;
98 rData.Double = fDouble;
99 rData.Enum = eEnum;
100 rData.String = rStr;
101 rData.Byte2 = nByte2;
102 rData.Short2 = nShort2;
103 rData.Interface = xTest;
104 rData.Any = rAny;
107 static void assign( TestData & rData,
108 bool bBool, sal_Unicode cChar, sal_Int8 nByte,
109 sal_Int16 nShort, sal_uInt16 nUShort,
110 sal_Int32 nLong, sal_uInt32 nULong,
111 sal_Int64 nHyper, sal_uInt64 nUHyper,
112 float fFloat, double fDouble,
113 TestEnum eEnum, const OUString& rStr,
114 sal_Int8 nByte2, sal_Int16 nShort2,
115 const css::uno::Reference< css::uno::XInterface >& xTest,
116 const css::uno::Any& rAny,
117 const css::uno::Sequence< TestElement >& rSequence )
119 assign( static_cast<TestElement &>(rData),
120 bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble,
121 eEnum, rStr, nByte2, nShort2, xTest, rAny );
122 rData.Sequence = rSequence;
125 namespace {
127 class Test_Impl :
128 public osl::DebugBase<Test_Impl>,
129 public WeakImplHelper< XBridgeTest2, XServiceInfo , XRecursiveCall >
131 TestData _aData, _aStructData;
132 sal_Int32 m_nLastCallId;
133 bool m_bFirstCall;
134 bool m_bSequenceOfCallTestPassed;
135 Mutex m_mutex;
137 Sequence<sal_Bool> _arBool;
138 Sequence<sal_Unicode> _arChar;
139 Sequence<sal_Int8> _arByte;
140 Sequence<sal_Int16> _arShort;
141 Sequence<sal_uInt16> _arUShort;
142 Sequence<sal_Int32> _arLong;
143 Sequence<sal_uInt32> _arULong;
144 Sequence<sal_Int64> _arHyper;
145 Sequence<sal_uInt64> _arUHyper;
146 Sequence<OUString> _arString;
147 Sequence<float> _arFloat;
148 Sequence<double> _arDouble;
149 Sequence<TestEnum> _arEnum;
150 Sequence<Reference<XInterface> > _arObject;
151 Sequence<Sequence<sal_Int32> > _arLong2;
152 Sequence<Sequence<Sequence<sal_Int32> > > _arLong3;
153 Sequence<Any> _arAny;
154 Sequence<TestElement> _arStruct;
156 public:
157 Test_Impl() : m_nLastCallId( 0 ),
158 m_bFirstCall( true ),
159 m_bSequenceOfCallTestPassed( true )
162 void SAL_CALL acquire() noexcept override
164 OWeakObject::acquire();
166 void SAL_CALL release() noexcept override
168 OWeakObject::release();
171 // XServiceInfo
172 virtual OUString SAL_CALL getImplementationName() override;
173 virtual sal_Bool SAL_CALL supportsService( const OUString & rServiceName ) override;
174 virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
176 // XLBTestBase
177 virtual void SAL_CALL setValues( sal_Bool bBool,
178 sal_Unicode cChar,
179 sal_Int8 nByte,
180 sal_Int16 nShort,
181 sal_uInt16 nUShort,
182 sal_Int32 nLong,
183 sal_uInt32 nULong,
184 sal_Int64 nHyper,
185 sal_uInt64 nUHyper,
186 float fFloat,
187 double fDouble,
188 TestEnum eEnum,
189 const OUString& rStr,
190 sal_Int8 nByte2,
191 sal_Int16 nShort2,
192 const css::uno::Reference< css::uno::XInterface >& xTest,
193 const css::uno::Any& rAny,
194 const css::uno::Sequence<TestElement >& rSequence,
195 const ::test::testtools::bridgetest::TestDataElements& rStruct ) override;
197 virtual ::test::testtools::bridgetest::TestDataElements SAL_CALL setValues2( sal_Bool& bBool,
198 sal_Unicode& cChar,
199 sal_Int8& nByte,
200 sal_Int16& nShort,
201 sal_uInt16& nUShort,
202 sal_Int32& nLong,
203 sal_uInt32& nULong,
204 sal_Int64& nHyper,
205 sal_uInt64& nUHyper,
206 float& fFloat,
207 double& fDouble,
208 TestEnum& eEnum,
209 OUString& rStr,
210 sal_Int8& nByte2,
211 sal_Int16& nShort2,
212 css::uno::Reference< css::uno::XInterface >& xTest,
213 css::uno::Any& rAny,
214 css::uno::Sequence<TestElement >& rSequence,
215 ::test::testtools::bridgetest::TestDataElements& rStruct ) override;
217 virtual ::test::testtools::bridgetest::TestDataElements SAL_CALL getValues( sal_Bool& bBool,
218 sal_Unicode& cChar,
219 sal_Int8& nByte,
220 sal_Int16& nShort,
221 sal_uInt16& nUShort,
222 sal_Int32& nLong,
223 sal_uInt32& nULong,
224 sal_Int64& nHyper,
225 sal_uInt64& nUHyper,
226 float& fFloat,
227 double& fDouble,
228 TestEnum& eEnum,
229 OUString& rStr,
230 sal_Int8& nByte2,
231 sal_Int16& nShort2,
232 css::uno::Reference< css::uno::XInterface >& xTest,
233 css::uno::Any& rAny,
234 css::uno::Sequence< TestElement >& rSequence,
235 ::test::testtools::bridgetest::TestDataElements& rStruct ) override;
237 virtual SmallStruct SAL_CALL echoSmallStruct(const SmallStruct& rStruct) override
238 { return rStruct; }
239 virtual MediumStruct SAL_CALL echoMediumStruct(const MediumStruct& rStruct) override
240 { return rStruct; }
241 virtual BigStruct SAL_CALL echoBigStruct(const BigStruct& rStruct) override
242 { return rStruct; }
243 virtual TwoFloats SAL_CALL echoTwoFloats(const TwoFloats& rStruct) override
244 { return rStruct; }
245 virtual FourFloats SAL_CALL echoFourFloats(const FourFloats& rStruct) override
246 { return rStruct; }
247 virtual MixedFloatAndInteger SAL_CALL echoMixedFloatAndInteger(const MixedFloatAndInteger& rStruct) override
248 { return rStruct; }
249 virtual DoubleHyper SAL_CALL echoDoubleHyper(DoubleHyper const & s) override { return s; }
250 virtual HyperDouble SAL_CALL echoHyperDouble(HyperDouble const & s) override { return s; }
251 virtual FloatFloatLongByte SAL_CALL echoFloatFloatLongByte(FloatFloatLongByte const & s)
252 override
253 { return s; }
254 virtual ThreeByteStruct SAL_CALL echoThreeByteStruct(const ThreeByteStruct& rStruct) override
255 { return rStruct; }
256 virtual sal_Int32 SAL_CALL testPPCAlignment( sal_Int64, sal_Int64, sal_Int32, sal_Int64, sal_Int32 i2 ) override
257 { return i2; }
258 virtual sal_Int32 SAL_CALL testPPC64Alignment( double , double , double , sal_Int32 i1 ) override
259 { return i1; }
260 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 ) override
261 { return d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10; }
262 virtual sal_Bool SAL_CALL getBool() override
263 { return _aData.Bool; }
264 virtual sal_Int8 SAL_CALL getByte() override
265 { return _aData.Byte; }
266 virtual sal_Unicode SAL_CALL getChar() override
267 { return _aData.Char; }
268 virtual sal_Int16 SAL_CALL getShort() override
269 { return _aData.Short; }
270 virtual sal_uInt16 SAL_CALL getUShort() override
271 { return _aData.UShort; }
272 virtual sal_Int32 SAL_CALL getLong() override
273 { return _aData.Long; }
274 virtual sal_uInt32 SAL_CALL getULong() override
275 { return _aData.ULong; }
276 virtual sal_Int64 SAL_CALL getHyper() override
277 { return _aData.Hyper; }
278 virtual sal_uInt64 SAL_CALL getUHyper() override
279 { return _aData.UHyper; }
280 virtual float SAL_CALL getFloat() override
281 { return _aData.Float; }
282 virtual double SAL_CALL getDouble() override
283 { return _aData.Double; }
284 virtual TestEnum SAL_CALL getEnum() override
285 { return _aData.Enum; }
286 virtual OUString SAL_CALL getString() override
287 { return _aData.String; }
288 virtual sal_Int8 SAL_CALL getByte2() override
289 { return _aData.Byte2; }
290 virtual sal_Int16 SAL_CALL getShort2() override
291 { return _aData.Short2; }
292 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getInterface( ) override
293 { return _aData.Interface; }
294 virtual css::uno::Any SAL_CALL getAny() override
295 { return _aData.Any; }
296 virtual css::uno::Sequence< TestElement > SAL_CALL getSequence() override
297 { return _aData.Sequence; }
298 virtual ::test::testtools::bridgetest::TestDataElements SAL_CALL getStruct() override
299 { return _aStructData; }
301 virtual void SAL_CALL setBool( sal_Bool _bool ) override
302 { _aData.Bool = _bool; }
303 virtual void SAL_CALL setByte( sal_Int8 _byte ) override
304 { _aData.Byte = _byte; }
305 virtual void SAL_CALL setChar( sal_Unicode _char ) override
306 { _aData.Char = _char; }
307 virtual void SAL_CALL setShort( sal_Int16 _short ) override
308 { _aData.Short = _short; }
309 virtual void SAL_CALL setUShort( sal_uInt16 _ushort ) override
310 { _aData.UShort = _ushort; }
311 virtual void SAL_CALL setLong( sal_Int32 _long ) override
312 { _aData.Long = _long; }
313 virtual void SAL_CALL setULong( sal_uInt32 _ulong ) override
314 { _aData.ULong = _ulong; }
315 virtual void SAL_CALL setHyper( sal_Int64 _hyper ) override
316 { _aData.Hyper = _hyper; }
317 virtual void SAL_CALL setUHyper( sal_uInt64 _uhyper ) override
318 { _aData.UHyper = _uhyper; }
319 virtual void SAL_CALL setFloat( float _float ) override
320 { _aData.Float = _float; }
321 virtual void SAL_CALL setDouble( double _double ) override
322 { _aData.Double = _double; }
323 virtual void SAL_CALL setEnum( TestEnum _enum ) override
324 { _aData.Enum = _enum; }
325 virtual void SAL_CALL setString( const OUString& _string ) override
326 { _aData.String = _string; }
327 virtual void SAL_CALL setByte2( sal_Int8 _byte ) override
328 { _aData.Byte2 = _byte; }
329 virtual void SAL_CALL setShort2( sal_Int16 _short ) override
330 { _aData.Short2 = _short; }
331 virtual void SAL_CALL setInterface( const css::uno::Reference< css::uno::XInterface >& _interface ) override
332 { _aData.Interface = _interface; }
333 virtual void SAL_CALL setAny( const css::uno::Any& _any ) override
334 { _aData.Any = _any; }
335 virtual void SAL_CALL setSequence( const css::uno::Sequence<TestElement >& _sequence ) override
336 { _aData.Sequence = _sequence; }
337 virtual void SAL_CALL setStruct( const ::test::testtools::bridgetest::TestDataElements& _struct ) override
338 { _aStructData = _struct; }
340 virtual sal_Int32 SAL_CALL getRaiseAttr1() override
341 { throw RuntimeException(); }
343 virtual void SAL_CALL setRaiseAttr1(sal_Int32) override
344 { throw IllegalArgumentException(); }
346 virtual sal_Int32 SAL_CALL getRaiseAttr2() override
347 { throw IllegalArgumentException(); }
349 virtual TestPolyStruct< sal_Bool > SAL_CALL transportPolyBoolean(
350 TestPolyStruct< sal_Bool > const & arg) override
351 { return arg; }
353 virtual void SAL_CALL transportPolyHyper(TestPolyStruct< sal_Int64 > &) override {}
355 virtual void SAL_CALL transportPolySequence(
356 TestPolyStruct< Sequence< Any > > const & arg1,
357 TestPolyStruct< Sequence< Any > > & arg2) override
358 { arg2 = arg1; }
360 virtual TestPolyStruct< sal_Int32 > SAL_CALL getNullPolyLong() override
361 { return TestPolyStruct< sal_Int32 >(0); /* work around MS compiler bug */ }
363 virtual TestPolyStruct< OUString > SAL_CALL getNullPolyString() override
364 { return TestPolyStruct< OUString >(); }
366 virtual TestPolyStruct< Type > SAL_CALL getNullPolyType() override
367 { return TestPolyStruct< Type >(); }
369 virtual TestPolyStruct< Any > SAL_CALL getNullPolyAny() override
370 { return TestPolyStruct< Any >(); }
372 virtual TestPolyStruct< Sequence< sal_Bool > > SAL_CALL
373 getNullPolySequence() override
374 { return TestPolyStruct< Sequence< sal_Bool > >(); }
376 virtual TestPolyStruct< TestEnum > SAL_CALL getNullPolyEnum() override
377 { return TestPolyStruct< TestEnum >(
378 test::testtools::bridgetest::TestEnum_TEST);
379 /* work around MS compiler bug */ }
381 virtual TestPolyStruct< TestBadEnum > SAL_CALL getNullPolyBadEnum() override
382 { return TestPolyStruct< TestBadEnum >(
383 test::testtools::bridgetest::TestBadEnum_M);
384 /* explicitly instantiate with default enumerator */ }
386 virtual TestPolyStruct< TestStruct > SAL_CALL getNullPolyStruct() override
387 { return TestPolyStruct< TestStruct >(); }
389 virtual TestPolyStruct< Reference< XBridgeTestBase > > SAL_CALL
390 getNullPolyInterface() override
391 { return TestPolyStruct< Reference< XBridgeTestBase > >(); }
393 virtual css::uno::Any SAL_CALL transportAny(
394 const css::uno::Any& value ) override;
396 virtual void SAL_CALL call( sal_Int32 nCallId, sal_Int32 nWaitMUSEC ) override;
397 virtual void SAL_CALL callOneway( sal_Int32 nCallId, sal_Int32 nWaitMUSEC ) override;
398 virtual sal_Bool SAL_CALL sequenceOfCallTestPassed( ) override;
399 virtual void SAL_CALL startRecursiveCall(
400 const css::uno::Reference< XRecursiveCall >& xCall, sal_Int32 nToCall ) override;
402 virtual Reference< XMulti > SAL_CALL getMulti() override;
404 virtual OUString SAL_CALL testMulti(Reference< XMulti > const & multi) override;
406 public: // XBridgeTest
407 virtual ::test::testtools::bridgetest::TestDataElements SAL_CALL raiseException( sal_Int16 nArgumentPos, const OUString & rMsg, const Reference< XInterface > & xCOntext ) override;
409 virtual void SAL_CALL raiseRuntimeExceptionOneway(
410 const OUString& Message, const css::uno::Reference< css::uno::XInterface >& Context ) override;
412 virtual sal_Int32 SAL_CALL getRuntimeException() override;
413 virtual void SAL_CALL setRuntimeException( sal_Int32 _runtimeexception ) override;
415 // XBridgeTest2
416 virtual Sequence< sal_Bool > SAL_CALL setSequenceBool(
417 const Sequence< sal_Bool >& aSeq ) override;
418 virtual Sequence< sal_Unicode > SAL_CALL setSequenceChar(
419 const Sequence< sal_Unicode >& aSeq ) override;
420 virtual Sequence< sal_Int8 > SAL_CALL setSequenceByte(
421 const Sequence< sal_Int8 >& aSeq ) override;
422 virtual Sequence< sal_Int16 > SAL_CALL setSequenceShort(
423 const Sequence< sal_Int16 >& aSeq ) override;
424 virtual Sequence< sal_uInt16 > SAL_CALL setSequenceUShort(
425 const Sequence< sal_uInt16 >& aSeq ) override;
426 virtual Sequence< sal_Int32 > SAL_CALL setSequenceLong(
427 const Sequence< sal_Int32 >& aSeq ) override;
428 virtual Sequence< sal_uInt32 > SAL_CALL setSequenceULong(
429 const Sequence< sal_uInt32 >& aSeq ) override;
430 virtual Sequence< sal_Int64 > SAL_CALL setSequenceHyper(
431 const Sequence< sal_Int64 >& aSeq ) override;
432 virtual Sequence< sal_uInt64 > SAL_CALL setSequenceUHyper(
433 const Sequence< sal_uInt64 >& aSeq ) override;
434 virtual Sequence< float > SAL_CALL setSequenceFloat(
435 const Sequence< float >& aSeq ) override;
436 virtual Sequence< double > SAL_CALL setSequenceDouble(
437 const Sequence< double >& aSeq ) override;
438 virtual Sequence< TestEnum > SAL_CALL setSequenceEnum(
439 const Sequence< TestEnum >& aSeq ) override ;
440 virtual Sequence< OUString > SAL_CALL setSequenceString(
441 const Sequence< OUString >& aString ) override;
442 virtual Sequence< Reference< XInterface > > SAL_CALL setSequenceXInterface(
443 const Sequence< Reference< XInterface > >& aSeq ) override;
444 virtual Sequence<Any > SAL_CALL setSequenceAny(
445 const Sequence<Any >& aSeq ) override;
446 virtual Sequence<TestElement > SAL_CALL setSequenceStruct(
447 const Sequence< TestElement >& aSeq ) override;
448 virtual Sequence< Sequence< sal_Int32 > > SAL_CALL setDim2(
449 const Sequence<Sequence< sal_Int32 > >& aSeq ) override;
450 virtual Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL setDim3(
451 const Sequence< Sequence< Sequence< sal_Int32 > > >& aSeq ) override;
452 virtual void SAL_CALL setSequencesInOut(Sequence< sal_Bool >& aSeqBoolean,
453 Sequence< sal_Unicode >& aSeqChar,
454 Sequence< sal_Int8 >& aSeqByte,
455 Sequence< sal_Int16 >& aSeqShort,
456 Sequence< sal_uInt16 >& aSeqUShort,
457 Sequence< sal_Int32 >& aSeqLong,
458 Sequence< sal_uInt32 >& aSeqULong,
459 Sequence< sal_Int64 >& aSeqHyper,
460 Sequence< sal_uInt64 >& aSeqUHyper,
461 Sequence< float >& aSeqFloat,
462 Sequence< double >& aSeqDouble,
463 Sequence< TestEnum >& aSeqTestEnum,
464 Sequence< OUString >& aSeqString,
465 Sequence<Reference<XInterface > >& aSeqXInterface,
466 Sequence< Any >& aSeqAny,
467 Sequence< Sequence< sal_Int32 > >& aSeqDim2,
468 Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 ) override;
469 virtual void SAL_CALL setSequencesOut( Sequence< sal_Bool >& aSeqBoolean,
470 Sequence< sal_Unicode >& aSeqChar,
471 Sequence< sal_Int8 >& aSeqByte,
472 Sequence< sal_Int16 >& aSeqShort,
473 Sequence< sal_uInt16 >& aSeqUShort,
474 Sequence< sal_Int32 >& aSeqLong,
475 Sequence< sal_uInt32 >& aSeqULong,
476 Sequence< sal_Int64 >& aSeqHyper,
477 Sequence< sal_uInt64 >& aSeqUHyper,
478 Sequence< float >& aSeqFloat,
479 Sequence< double >& aSeqDouble,
480 Sequence< TestEnum >& aSeqEnum,
481 Sequence< OUString >& aSeqString,
482 Sequence< Reference< XInterface > >& aSeqXInterface,
483 Sequence< Any >& aSeqAny,
484 Sequence< Sequence< sal_Int32 > >& aSeqDim2,
485 Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 ) override;
486 virtual void SAL_CALL testConstructorsService(
487 Reference< XComponentContext > const & context) override;
488 virtual Reference< XCurrentContextChecker > SAL_CALL
489 getCurrentContextChecker() override;
491 public:
492 virtual void SAL_CALL callRecursivly( const css::uno::Reference< XRecursiveCall >& xCall, sal_Int32 nToCall ) override;
495 //Dummy class for XComponent implementation
496 class Dummy : public osl::DebugBase<Dummy>,
497 public WeakComponentImplHelperBase
499 public:
500 Dummy(): WeakComponentImplHelperBase(*Mutex::getGlobalMutex()){}
506 Any Test_Impl::transportAny( const Any & value )
508 return value;
512 namespace {
514 void wait(sal_Int32 microSeconds) {
515 OSL_ASSERT(microSeconds >= 0 && microSeconds <= SAL_MAX_INT32 / 1000);
516 std::this_thread::sleep_for(std::chrono::microseconds(microSeconds));
521 void Test_Impl::call( sal_Int32 nCallId , sal_Int32 nWaitMUSEC )
523 wait(nWaitMUSEC);
524 if( m_bFirstCall )
526 m_bFirstCall = false;
528 else
530 m_bSequenceOfCallTestPassed = m_bSequenceOfCallTestPassed && (nCallId > m_nLastCallId);
532 m_nLastCallId = nCallId;
536 void Test_Impl::callOneway( sal_Int32 nCallId , sal_Int32 nWaitMUSEC )
538 wait(nWaitMUSEC);
539 m_bSequenceOfCallTestPassed = m_bSequenceOfCallTestPassed && (nCallId > m_nLastCallId);
540 m_nLastCallId = nCallId;
544 sal_Bool Test_Impl::sequenceOfCallTestPassed()
546 return m_bSequenceOfCallTestPassed;
550 void SAL_CALL Test_Impl::startRecursiveCall(
551 const css::uno::Reference< XRecursiveCall >& xCall, sal_Int32 nToCall )
553 MutexGuard guard( m_mutex );
554 if( nToCall )
556 nToCall --;
557 xCall->callRecursivly( this , nToCall );
562 void SAL_CALL Test_Impl::callRecursivly(
563 const css::uno::Reference< XRecursiveCall >& xCall,
564 sal_Int32 nToCall )
566 MutexGuard guard( m_mutex );
567 if( nToCall )
569 nToCall --;
570 xCall->callRecursivly( this , nToCall );
574 Reference< XMulti > Test_Impl::getMulti() {
575 return new testtools::bridgetest::Multi;
578 OUString Test_Impl::testMulti(Reference< XMulti > const & multi)
580 return testtools::bridgetest::testMulti(multi);
584 void Test_Impl::setValues( sal_Bool bBool,
585 sal_Unicode cChar,
586 sal_Int8 nByte,
587 sal_Int16 nShort,
588 sal_uInt16 nUShort,
589 sal_Int32 nLong,
590 sal_uInt32 nULong,
591 sal_Int64 nHyper,
592 sal_uInt64 nUHyper,
593 float fFloat,
594 double fDouble,
595 TestEnum eEnum,
596 const OUString& rStr,
597 sal_Int8 nByte2,
598 sal_Int16 nShort2,
599 const css::uno::Reference< css::uno::XInterface >& xTest,
600 const css::uno::Any& rAny,
601 const css::uno::Sequence<TestElement >& rSequence,
602 const ::test::testtools::bridgetest::TestDataElements& rStruct )
604 assign( _aData,
605 bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble,
606 eEnum, rStr, nByte2, nShort2, xTest, rAny, rSequence );
607 _aStructData = rStruct;
610 ::test::testtools::bridgetest::TestDataElements Test_Impl::setValues2( sal_Bool& bBool,
611 sal_Unicode& cChar,
612 sal_Int8& nByte,
613 sal_Int16& nShort,
614 sal_uInt16& nUShort,
615 sal_Int32& nLong,
616 sal_uInt32& nULong,
617 sal_Int64& nHyper,
618 sal_uInt64& nUHyper,
619 float& fFloat,
620 double& fDouble,
621 TestEnum& eEnum,
622 OUString& rStr,
623 sal_Int8& nByte2,
624 sal_Int16& nShort2,
625 css::uno::Reference< css::uno::XInterface >& xTest,
626 css::uno::Any& rAny,
627 css::uno::Sequence<TestElement >& rSequence,
628 ::test::testtools::bridgetest::TestDataElements& rStruct )
630 assign( _aData,
631 bBool, cChar, nByte, nShort, nUShort, nLong, nULong, nHyper, nUHyper, fFloat, fDouble,
632 eEnum, rStr, nByte2, nShort2, xTest, rAny, rSequence );
633 _aStructData = rStruct;
635 auto pSequence = rSequence.getArray();
636 std::swap(pSequence[ 0 ], pSequence[ 1 ]);
638 return _aStructData;
641 ::test::testtools::bridgetest::TestDataElements Test_Impl::getValues( sal_Bool& bBool,
642 sal_Unicode& cChar,
643 sal_Int8& nByte,
644 sal_Int16& nShort,
645 sal_uInt16& nUShort,
646 sal_Int32& nLong,
647 sal_uInt32& nULong,
648 sal_Int64& nHyper,
649 sal_uInt64& nUHyper,
650 float& fFloat,
651 double& fDouble,
652 TestEnum& eEnum,
653 OUString& rStr,
654 sal_Int8& nByte2,
655 sal_Int16& nShort2,
656 css::uno::Reference< css::uno::XInterface >& xTest,
657 css::uno::Any& rAny,
658 css::uno::Sequence<TestElement >& rSequence,
659 ::test::testtools::bridgetest::TestDataElements& rStruct )
661 bBool = _aData.Bool;
662 cChar = _aData.Char;
663 nByte = _aData.Byte;
664 nShort = _aData.Short;
665 nUShort = _aData.UShort;
666 nLong = _aData.Long;
667 nULong = _aData.ULong;
668 nHyper = _aData.Hyper;
669 nUHyper = _aData.UHyper;
670 fFloat = _aData.Float;
671 fDouble = _aData.Double;
672 eEnum = _aData.Enum;
673 rStr = _aData.String;
674 nByte2 = _aData.Byte2;
675 nShort2 = _aData.Short2;
676 xTest = _aData.Interface;
677 rAny = _aData.Any;
678 rSequence = _aData.Sequence;
679 rStruct = _aStructData;
680 return _aStructData;
683 ::test::testtools::bridgetest::TestDataElements Test_Impl::raiseException( sal_Int16 nArgumentPos, const OUString & rMsg, const Reference< XInterface > & xContext )
685 _aData.String = rMsg;
686 _aData.Interface = xContext;
687 throw IllegalArgumentException(rMsg, xContext, nArgumentPos);
690 void Test_Impl::raiseRuntimeExceptionOneway( const OUString & rMsg, const Reference< XInterface > & xContext )
692 _aData.String = rMsg;
693 _aData.Interface = xContext;
694 throw RuntimeException(rMsg, xContext);
697 static void dothrow2(const RuntimeException& e)
699 throw e;
701 static void dothrow(const RuntimeException& e)
703 #if defined _MSC_VER
704 // currently only for MSVC:
705 // just to test whether all bridges fall back to a RuntimeException
706 // in case of a thrown non-UNO exception:
709 throw ::std::bad_alloc();
711 catch (...)
715 Any a( getCaughtException() );
716 RuntimeException exc;
717 OSL_VERIFY( a >>= exc );
719 catch (...) // never throws anything
721 fprintf( stderr, "\ngetCaughtException() failed!\n" );
722 exit( 1 );
725 #endif
726 dothrow2( e );
729 sal_Int32 Test_Impl::getRuntimeException()
733 dothrow( RuntimeException( _aData.String, _aData.Interface ) );
735 catch (Exception &)
737 Any a( getCaughtException() );
738 throwException( a );
740 return 0; // for dummy
743 void Test_Impl::setRuntimeException( sal_Int32 )
745 RuntimeException aExc(_aData.String, _aData.Interface);
746 throwException( Any( aExc ) );
749 // XBridgeTest2 -------------------------------------------------------------
750 Sequence< sal_Bool > SAL_CALL Test_Impl::setSequenceBool(
751 const Sequence< sal_Bool >& aSeq )
753 _arBool = aSeq;
754 return aSeq;
757 Sequence< sal_Unicode > SAL_CALL Test_Impl::setSequenceChar(
758 const Sequence< sal_Unicode >& aSeq )
760 _arChar = aSeq;
761 return aSeq;
764 Sequence< sal_Int8 > SAL_CALL Test_Impl::setSequenceByte(
765 const Sequence< sal_Int8 >& aSeq )
767 _arByte = aSeq;
768 return aSeq;
771 Sequence< sal_Int16 > SAL_CALL Test_Impl::setSequenceShort(
772 const Sequence< sal_Int16 >& aSeq )
774 _arShort = aSeq;
775 return aSeq;
778 Sequence< sal_uInt16 > SAL_CALL Test_Impl::setSequenceUShort(
779 const Sequence< sal_uInt16 >& aSeq )
781 _arUShort = aSeq;
782 return aSeq;
785 Sequence< sal_Int32 > SAL_CALL Test_Impl::setSequenceLong(
786 const Sequence< sal_Int32 >& aSeq )
788 _arLong = aSeq;
789 return aSeq;
792 Sequence< sal_uInt32 > SAL_CALL Test_Impl::setSequenceULong(
793 const Sequence< sal_uInt32 >& aSeq )
795 _arULong = aSeq;
796 return aSeq;
799 Sequence< sal_Int64 > SAL_CALL Test_Impl::setSequenceHyper(
800 const Sequence< sal_Int64 >& aSeq )
802 _arHyper = aSeq;
803 return aSeq;
806 Sequence< sal_uInt64 > SAL_CALL Test_Impl::setSequenceUHyper(
807 const Sequence< sal_uInt64 >& aSeq )
809 _arUHyper = aSeq;
810 return aSeq;
813 Sequence< float > SAL_CALL Test_Impl::setSequenceFloat(
814 const Sequence< float >& aSeq )
816 _arFloat = aSeq;
817 return aSeq;
820 Sequence< double > SAL_CALL Test_Impl::setSequenceDouble(
821 const Sequence< double >& aSeq )
823 _arDouble = aSeq;
824 return aSeq;
827 Sequence< TestEnum > SAL_CALL Test_Impl::setSequenceEnum(
828 const Sequence< TestEnum >& aSeq )
830 _arEnum = aSeq;
831 return aSeq;
834 Sequence< OUString > SAL_CALL Test_Impl::setSequenceString(
835 const Sequence< OUString >& aSeq )
837 _arString = aSeq;
838 return aSeq;
841 Sequence< Reference< XInterface > > SAL_CALL Test_Impl::setSequenceXInterface(
842 const Sequence< Reference< XInterface > >& aSeq )
844 _arObject = aSeq;
845 return aSeq;
848 Sequence<Any > SAL_CALL Test_Impl::setSequenceAny(
849 const Sequence<Any >& aSeq )
851 _arAny = aSeq;
852 return aSeq;
855 Sequence<TestElement > SAL_CALL Test_Impl::setSequenceStruct(
856 const Sequence< TestElement >& aSeq )
858 _arStruct = aSeq;
859 return aSeq;
862 Sequence< Sequence< sal_Int32 > > SAL_CALL Test_Impl::setDim2(
863 const Sequence<Sequence< sal_Int32 > >& aSeq )
865 _arLong2 = aSeq;
866 return aSeq;
869 Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL Test_Impl::setDim3(
870 const Sequence< Sequence< Sequence< sal_Int32 > > >& aSeq )
872 _arLong3 = aSeq;
873 return aSeq;
876 void SAL_CALL Test_Impl::setSequencesInOut(Sequence< sal_Bool >& aSeqBoolean,
877 Sequence< sal_Unicode >& aSeqChar,
878 Sequence< sal_Int8 >& aSeqByte,
879 Sequence< sal_Int16 >& aSeqShort,
880 Sequence< sal_uInt16 >& aSeqUShort,
881 Sequence< sal_Int32 >& aSeqLong,
882 Sequence< sal_uInt32 >& aSeqULong,
883 Sequence< sal_Int64 >& aSeqHyper,
884 Sequence< sal_uInt64 >& aSeqUHyper,
885 Sequence< float >& aSeqFloat,
886 Sequence< double >& aSeqDouble,
887 Sequence< TestEnum >& aSeqTestEnum,
888 Sequence< OUString >& aSeqString,
889 Sequence<Reference<XInterface > >& aSeqXInterface,
890 Sequence< Any >& aSeqAny,
891 Sequence< Sequence< sal_Int32 > >& aSeqDim2,
892 Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 )
894 _arBool = aSeqBoolean;
895 _arChar = aSeqChar;
896 _arByte = aSeqByte;
897 _arShort = aSeqShort;
898 _arUShort = aSeqUShort;
899 _arLong = aSeqLong;
900 _arULong = aSeqULong;
901 _arHyper = aSeqHyper;
902 _arUHyper = aSeqUHyper;
903 _arFloat = aSeqFloat;
904 _arDouble = aSeqDouble;
905 _arEnum = aSeqTestEnum;
906 _arString = aSeqString;
907 _arObject = aSeqXInterface;
908 _arAny = aSeqAny;
909 _arLong2 = aSeqDim2;
910 _arLong3 = aSeqDim3;
913 void SAL_CALL Test_Impl::setSequencesOut( Sequence< sal_Bool >& aSeqBoolean,
914 Sequence< sal_Unicode >& aSeqChar,
915 Sequence< sal_Int8 >& aSeqByte,
916 Sequence< sal_Int16 >& aSeqShort,
917 Sequence< sal_uInt16 >& aSeqUShort,
918 Sequence< sal_Int32 >& aSeqLong,
919 Sequence< sal_uInt32 >& aSeqULong,
920 Sequence< sal_Int64 >& aSeqHyper,
921 Sequence< sal_uInt64 >& aSeqUHyper,
922 Sequence< float >& aSeqFloat,
923 Sequence< double >& aSeqDouble,
924 Sequence< TestEnum >& aSeqEnum,
925 Sequence< OUString >& aSeqString,
926 Sequence< Reference< XInterface > >& aSeqXInterface,
927 Sequence< Any >& aSeqAny,
928 Sequence< Sequence< sal_Int32 > >& aSeqDim2,
929 Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 )
931 aSeqBoolean = _arBool;
932 aSeqChar = _arChar;
933 aSeqByte = _arByte;
934 aSeqShort = _arShort;
935 aSeqUShort = _arUShort;
936 aSeqLong = _arLong;
937 aSeqULong = _arULong;
938 aSeqHyper = _arHyper;
939 aSeqUHyper = _arUHyper;
940 aSeqFloat = _arFloat;
941 aSeqDouble = _arDouble;
942 aSeqEnum = _arEnum;
943 aSeqString = _arString;
944 aSeqXInterface = _arObject;
945 aSeqAny = _arAny;
946 aSeqDim2 = _arLong2;
947 aSeqDim3 = _arLong3;
950 void Test_Impl::testConstructorsService(
951 Reference< XComponentContext > const & context)
953 Sequence< sal_Bool > arg14{ true };
954 Sequence< sal_Int8 > arg15{ SAL_MIN_INT8 };
955 Sequence< sal_Int16 > arg16{ SAL_MIN_INT16 };
956 Sequence< sal_uInt16 > arg17{ SAL_MAX_UINT16 };
957 Sequence< sal_Int32 > arg18{ SAL_MIN_INT32 };
958 Sequence< sal_uInt32 > arg19{ SAL_MAX_UINT32 };
959 Sequence< sal_Int64 > arg20{ SAL_MIN_INT64 };
960 Sequence< sal_uInt64 > arg21{ SAL_MAX_UINT64 };
961 Sequence< float > arg22{ 0.123f };
962 Sequence< double > arg23{ 0.456 };
963 Sequence< sal_Unicode > arg24{ 'X' };
964 Sequence< OUString > arg25 { u"test"_ustr };
965 Sequence< Type > arg26{ UnoType< Any >::get() };
966 Sequence< Any > arg27{ Any(true) };
967 Sequence< Sequence< sal_Bool > > arg28{ { true } };
968 Sequence< Sequence< Any > > arg29{ { Any(true) } };
969 Sequence< TestEnum > arg30{ TestEnum_TWO };
970 Sequence< TestStruct > arg31(1); arg31.getArray()[0].member = 10;
971 Sequence< TestPolyStruct< sal_Bool > > arg32{ { true } };
972 Sequence< TestPolyStruct< Any > > arg33(1); arg33.getArray()[0].member <<= true;
973 Sequence< Reference< XInterface > > arg34(1);
974 Constructors::create1(context,
975 true,
976 SAL_MIN_INT8,
977 SAL_MIN_INT16,
978 SAL_MAX_UINT16,
979 SAL_MIN_INT32,
980 SAL_MAX_UINT32,
981 SAL_MIN_INT64,
982 SAL_MAX_UINT64,
983 0.123f,
984 0.456,
985 'X',
986 u"test"_ustr,
987 UnoType< Any >::get(),
988 Any(true),
989 arg14,
990 arg15,
991 arg16,
992 arg17,
993 arg18,
994 arg19,
995 arg20,
996 arg21,
997 arg22,
998 arg23,
999 arg24,
1000 arg25,
1001 arg26,
1002 arg27,
1003 arg28,
1004 arg29,
1005 arg30,
1006 arg31,
1007 arg32,
1008 arg33,
1009 arg34,
1010 TestEnum_TWO,
1011 TestStruct(10),
1012 TestPolyStruct< sal_Bool >(true),
1013 TestPolyStruct< Any >(Any(true)),
1014 Reference< XInterface >(nullptr));
1015 Sequence< Any > args{
1016 Any(true),
1017 Any(SAL_MIN_INT8),
1018 Any(SAL_MIN_INT16),
1019 Any(SAL_MAX_UINT16),
1020 Any(SAL_MIN_INT32),
1021 Any(SAL_MAX_UINT32),
1022 Any(SAL_MIN_INT64),
1023 Any(SAL_MAX_UINT64),
1024 Any(0.123f),
1025 Any(0.456),
1026 Any(u'X'),
1027 Any(u"test"_ustr),
1028 Any(UnoType< Any >::get()),
1029 Any(true),
1030 Any(arg14),
1031 Any(arg15),
1032 Any(arg16),
1033 Any(arg17),
1034 Any(arg18),
1035 Any(arg19),
1036 Any(arg20),
1037 Any(arg21),
1038 Any(arg22),
1039 Any(arg23),
1040 Any(arg24),
1041 Any(arg25),
1042 Any(arg26),
1043 Any(arg27),
1044 Any(arg28),
1045 Any(arg29),
1046 Any(arg30),
1047 Any(arg31),
1048 Any(arg32),
1049 Any(arg33),
1050 Any(arg34),
1051 Any(TestEnum_TWO),
1052 Any(TestStruct(10)),
1053 Any(TestPolyStruct< sal_Bool >(true)),
1054 Any(TestPolyStruct< Any >(Any(true))),
1055 Any(Reference< XInterface >(nullptr))
1057 assert(args.getLength() == 40);
1058 Constructors::create2(context, args);
1060 Sequence<Type> argSeq1{ cppu::UnoType<sal_Int32>::get() };
1061 Sequence<Reference<XInterface> > argSeq2 { static_cast<XComponent*>(new Dummy()) };
1062 Sequence<Reference<XComponent> > argSeq2a { static_cast<XComponent*>(new Dummy()) };
1064 Sequence<TestPolyStruct2<sal_Unicode, Sequence<Any> > > argSeq3
1065 { TestPolyStruct2<sal_Unicode, Sequence<Any> >('X', arg27) };
1066 Sequence<TestPolyStruct2<TestPolyStruct<sal_Unicode>, Sequence<Any> > > argSeq4
1067 { TestPolyStruct2<TestPolyStruct<sal_Unicode>, Sequence<Any> >(
1068 TestPolyStruct<sal_Unicode>('X'), arg27) };
1069 Sequence<Sequence<sal_Int32> > argSeq5{ { SAL_MIN_INT32 } };
1070 Sequence<TestPolyStruct<sal_Int32> > argSeq6{ TestPolyStruct<sal_Int32>(SAL_MIN_INT32) };
1071 Sequence<TestPolyStruct<TestPolyStruct2<sal_Unicode, Any> > > argSeq7
1072 { TestPolyStruct<TestPolyStruct2<sal_Unicode, Any> >(
1073 TestPolyStruct2<sal_Unicode, Any>('X', Any(true))) };
1074 Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > > argSeq8
1075 { TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > (
1076 TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString>(
1077 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), u"test"_ustr)) };
1078 Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > > argSeq9
1079 { TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > >(
1080 u"test"_ustr, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >(
1081 'X', TestPolyStruct<Any>(Any(true)))) };
1082 Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> > > argSeq10
1083 { TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> >(
1084 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), TestPolyStruct<sal_Unicode>('X')) };
1085 Sequence<Sequence<TestPolyStruct<sal_Unicode > > > argSeq11
1086 { { TestPolyStruct<sal_Unicode>('X') } };
1087 Sequence<Sequence<TestPolyStruct<TestPolyStruct2<sal_Unicode,Any> > > > argSeq12
1088 { { TestPolyStruct<TestPolyStruct2<sal_Unicode,Any> >(
1089 TestPolyStruct2<sal_Unicode,Any>('X', Any(true))) } };
1090 Sequence<Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> > > > argSeq13
1091 { {TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> >(
1092 TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString>(
1093 TestPolyStruct2<sal_Unicode,Any>('X', Any(true)), u"test"_ustr))} };
1094 Sequence<Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > > > argSeq14
1095 { { TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > >(
1096 u"test"_ustr, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >(
1097 'X', TestPolyStruct<Any>(Any(true)))) } };
1098 Sequence<Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> > > > argSeq15
1099 { { TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> >(
1100 TestPolyStruct2<sal_Unicode,Any>('X',Any(true)), TestPolyStruct<sal_Unicode>('X')) } };
1102 Constructors2::create1(
1103 context,
1104 TestPolyStruct<Type>(cppu::UnoType<sal_Int32>::get()),
1105 TestPolyStruct<Any>(Any(true)),
1106 TestPolyStruct<sal_Bool>(true),
1107 TestPolyStruct<sal_Int8>(SAL_MIN_INT8),
1108 TestPolyStruct<sal_Int16>(SAL_MIN_INT16),
1109 TestPolyStruct<sal_Int32>(SAL_MIN_INT32),
1110 TestPolyStruct<sal_Int64>(SAL_MIN_INT64),
1111 TestPolyStruct<sal_Unicode>('X'),
1112 TestPolyStruct<OUString>(u"test"_ustr),
1113 TestPolyStruct<float>(0.123f),
1114 TestPolyStruct<double>(0.456),
1115 TestPolyStruct<Reference<XInterface> >(static_cast<XBridgeTest2*>(this)),
1116 TestPolyStruct<Reference<XComponent> >(static_cast<XComponent*>(new Dummy())),
1117 TestPolyStruct<TestEnum>(TestEnum_TWO),
1118 TestPolyStruct<TestPolyStruct2<sal_Unicode, Any> >(
1119 TestPolyStruct2<sal_Unicode, Any>('X', Any(true))),
1120 TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > (
1121 TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString>(
1122 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), u"test"_ustr)),
1123 TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode,TestPolyStruct<Any> > >(
1124 u"test"_ustr,
1125 TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >('X', TestPolyStruct<Any>(Any(true)))),
1126 TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> >(
1127 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)),
1128 TestPolyStruct<sal_Unicode>('X')),
1129 TestPolyStruct<Sequence<Type> >(argSeq1),
1130 TestPolyStruct<Sequence<Any> >(arg27),
1131 TestPolyStruct<Sequence<sal_Bool> >(arg14),
1132 TestPolyStruct<Sequence<sal_Int8> >(arg15),
1133 TestPolyStruct<Sequence<sal_Int16> >(arg16),
1134 TestPolyStruct<Sequence<sal_Int32> >(arg18),
1135 TestPolyStruct<Sequence<sal_Int64> >(arg20),
1136 TestPolyStruct<Sequence<sal_Unicode> >(arg24),
1137 TestPolyStruct<Sequence<OUString> >(arg25),
1138 TestPolyStruct<Sequence<float> >(arg22),
1139 TestPolyStruct<Sequence<double> >(arg23),
1140 TestPolyStruct<Sequence<Reference<XInterface> > >(argSeq2),
1141 TestPolyStruct<Sequence<Reference<XComponent> > >(argSeq2a),
1142 TestPolyStruct<Sequence<TestEnum> >(arg30),
1143 TestPolyStruct<Sequence<TestPolyStruct2<sal_Unicode, Sequence<Any> > > >(argSeq3),
1144 TestPolyStruct<Sequence<TestPolyStruct2<TestPolyStruct<sal_Unicode>, Sequence<Any> > > > (argSeq4),
1145 TestPolyStruct<Sequence<Sequence<sal_Int32> > >(argSeq5),
1146 argSeq6,
1147 argSeq7,
1148 argSeq8,
1149 argSeq9,
1150 argSeq10,
1151 argSeq11,
1152 argSeq12,
1153 argSeq13,
1154 argSeq14,
1155 argSeq15);
1158 Reference< XCurrentContextChecker > Test_Impl::getCurrentContextChecker()
1160 return new testtools::bridgetest::CurrentContextChecker;
1163 // XServiceInfo
1165 OUString Test_Impl::getImplementationName()
1167 return IMPLNAME;
1170 sal_Bool Test_Impl::supportsService( const OUString & rServiceName )
1172 return cppu::supportsService(this, rServiceName);
1175 Sequence< OUString > Test_Impl::getSupportedServiceNames()
1177 return bridge_object::getSupportedServiceNames();
1181 static Reference< XInterface > Test_Impl_create(
1182 SAL_UNUSED_PARAMETER const Reference< XMultiServiceFactory > & )
1184 return Reference< XInterface >( static_cast<XBridgeTest *>(new Test_Impl()) );
1189 extern "C"
1191 SAL_DLLPUBLIC_EXPORT void * component_getFactory(
1192 const char * pImplName, SAL_UNUSED_PARAMETER void * pServiceManager,
1193 SAL_UNUSED_PARAMETER void * )
1195 void * pRet = nullptr;
1197 if (pServiceManager && o3tl::equalsAscii(IMPLNAME, pImplName))
1199 Reference< XSingleServiceFactory > xFactory( createSingleFactory(
1200 static_cast< XMultiServiceFactory * >( pServiceManager ),
1201 IMPLNAME,
1202 bridge_object::Test_Impl_create,
1203 bridge_object::getSupportedServiceNames() ) );
1205 if (xFactory.is())
1207 xFactory->acquire();
1208 pRet = xFactory.get();
1212 return pRet;
1216 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */