android: Update app-specific/MIME type icons
[LibreOffice.git] / testtools / source / bridgetest / cppobj.cxx
blob32742110f34166de60a6d50cee088fe542e27c22
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 OUStringLiteral SERVICENAME = u"com.sun.star.test.bridge.CppTestObject";
65 constexpr OUStringLiteral IMPLNAME = u"com.sun.star.comp.bridge.CppTestObject";
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 IllegalArgumentException aExc;
686 aExc.ArgumentPosition = nArgumentPos;
687 aExc.Message = _aData.String = rMsg;
688 aExc.Context = _aData.Interface = xContext;
689 throw aExc;
692 void Test_Impl::raiseRuntimeExceptionOneway( const OUString & rMsg, const Reference< XInterface > & xContext )
694 RuntimeException aExc;
695 aExc.Message = _aData.String = rMsg;
696 aExc.Context = _aData.Interface = xContext;
697 throw aExc;
700 static void dothrow2(const RuntimeException& e)
702 throw e;
704 static void dothrow(const RuntimeException& e)
706 #if defined _MSC_VER
707 // currently only for MSVC:
708 // just to test whether all bridges fall back to a RuntimeException
709 // in case of a thrown non-UNO exception:
712 throw ::std::bad_alloc();
714 catch (...)
718 Any a( getCaughtException() );
719 RuntimeException exc;
720 OSL_VERIFY( a >>= exc );
722 catch (...) // never throws anything
724 fprintf( stderr, "\ngetCaughtException() failed!\n" );
725 exit( 1 );
728 #endif
729 dothrow2( e );
732 sal_Int32 Test_Impl::getRuntimeException()
736 dothrow( RuntimeException( _aData.String, _aData.Interface ) );
738 catch (Exception &)
740 Any a( getCaughtException() );
741 throwException( a );
743 return 0; // for dummy
746 void Test_Impl::setRuntimeException( sal_Int32 )
748 RuntimeException aExc;
749 aExc.Message = _aData.String;
750 aExc.Context = _aData.Interface;
751 throwException( Any( aExc ) );
754 // XBridgeTest2 -------------------------------------------------------------
755 Sequence< sal_Bool > SAL_CALL Test_Impl::setSequenceBool(
756 const Sequence< sal_Bool >& aSeq )
758 _arBool = aSeq;
759 return aSeq;
762 Sequence< sal_Unicode > SAL_CALL Test_Impl::setSequenceChar(
763 const Sequence< sal_Unicode >& aSeq )
765 _arChar = aSeq;
766 return aSeq;
769 Sequence< sal_Int8 > SAL_CALL Test_Impl::setSequenceByte(
770 const Sequence< sal_Int8 >& aSeq )
772 _arByte = aSeq;
773 return aSeq;
776 Sequence< sal_Int16 > SAL_CALL Test_Impl::setSequenceShort(
777 const Sequence< sal_Int16 >& aSeq )
779 _arShort = aSeq;
780 return aSeq;
783 Sequence< sal_uInt16 > SAL_CALL Test_Impl::setSequenceUShort(
784 const Sequence< sal_uInt16 >& aSeq )
786 _arUShort = aSeq;
787 return aSeq;
790 Sequence< sal_Int32 > SAL_CALL Test_Impl::setSequenceLong(
791 const Sequence< sal_Int32 >& aSeq )
793 _arLong = aSeq;
794 return aSeq;
797 Sequence< sal_uInt32 > SAL_CALL Test_Impl::setSequenceULong(
798 const Sequence< sal_uInt32 >& aSeq )
800 _arULong = aSeq;
801 return aSeq;
804 Sequence< sal_Int64 > SAL_CALL Test_Impl::setSequenceHyper(
805 const Sequence< sal_Int64 >& aSeq )
807 _arHyper = aSeq;
808 return aSeq;
811 Sequence< sal_uInt64 > SAL_CALL Test_Impl::setSequenceUHyper(
812 const Sequence< sal_uInt64 >& aSeq )
814 _arUHyper = aSeq;
815 return aSeq;
818 Sequence< float > SAL_CALL Test_Impl::setSequenceFloat(
819 const Sequence< float >& aSeq )
821 _arFloat = aSeq;
822 return aSeq;
825 Sequence< double > SAL_CALL Test_Impl::setSequenceDouble(
826 const Sequence< double >& aSeq )
828 _arDouble = aSeq;
829 return aSeq;
832 Sequence< TestEnum > SAL_CALL Test_Impl::setSequenceEnum(
833 const Sequence< TestEnum >& aSeq )
835 _arEnum = aSeq;
836 return aSeq;
839 Sequence< OUString > SAL_CALL Test_Impl::setSequenceString(
840 const Sequence< OUString >& aSeq )
842 _arString = aSeq;
843 return aSeq;
846 Sequence< Reference< XInterface > > SAL_CALL Test_Impl::setSequenceXInterface(
847 const Sequence< Reference< XInterface > >& aSeq )
849 _arObject = aSeq;
850 return aSeq;
853 Sequence<Any > SAL_CALL Test_Impl::setSequenceAny(
854 const Sequence<Any >& aSeq )
856 _arAny = aSeq;
857 return aSeq;
860 Sequence<TestElement > SAL_CALL Test_Impl::setSequenceStruct(
861 const Sequence< TestElement >& aSeq )
863 _arStruct = aSeq;
864 return aSeq;
867 Sequence< Sequence< sal_Int32 > > SAL_CALL Test_Impl::setDim2(
868 const Sequence<Sequence< sal_Int32 > >& aSeq )
870 _arLong2 = aSeq;
871 return aSeq;
874 Sequence< Sequence< Sequence< sal_Int32 > > > SAL_CALL Test_Impl::setDim3(
875 const Sequence< Sequence< Sequence< sal_Int32 > > >& aSeq )
877 _arLong3 = aSeq;
878 return aSeq;
881 void SAL_CALL Test_Impl::setSequencesInOut(Sequence< sal_Bool >& aSeqBoolean,
882 Sequence< sal_Unicode >& aSeqChar,
883 Sequence< sal_Int8 >& aSeqByte,
884 Sequence< sal_Int16 >& aSeqShort,
885 Sequence< sal_uInt16 >& aSeqUShort,
886 Sequence< sal_Int32 >& aSeqLong,
887 Sequence< sal_uInt32 >& aSeqULong,
888 Sequence< sal_Int64 >& aSeqHyper,
889 Sequence< sal_uInt64 >& aSeqUHyper,
890 Sequence< float >& aSeqFloat,
891 Sequence< double >& aSeqDouble,
892 Sequence< TestEnum >& aSeqTestEnum,
893 Sequence< OUString >& aSeqString,
894 Sequence<Reference<XInterface > >& aSeqXInterface,
895 Sequence< Any >& aSeqAny,
896 Sequence< Sequence< sal_Int32 > >& aSeqDim2,
897 Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 )
899 _arBool = aSeqBoolean;
900 _arChar = aSeqChar;
901 _arByte = aSeqByte;
902 _arShort = aSeqShort;
903 _arUShort = aSeqUShort;
904 _arLong = aSeqLong;
905 _arULong = aSeqULong;
906 _arHyper = aSeqHyper;
907 _arUHyper = aSeqUHyper;
908 _arFloat = aSeqFloat;
909 _arDouble = aSeqDouble;
910 _arEnum = aSeqTestEnum;
911 _arString = aSeqString;
912 _arObject = aSeqXInterface;
913 _arAny = aSeqAny;
914 _arLong2 = aSeqDim2;
915 _arLong3 = aSeqDim3;
918 void SAL_CALL Test_Impl::setSequencesOut( Sequence< sal_Bool >& aSeqBoolean,
919 Sequence< sal_Unicode >& aSeqChar,
920 Sequence< sal_Int8 >& aSeqByte,
921 Sequence< sal_Int16 >& aSeqShort,
922 Sequence< sal_uInt16 >& aSeqUShort,
923 Sequence< sal_Int32 >& aSeqLong,
924 Sequence< sal_uInt32 >& aSeqULong,
925 Sequence< sal_Int64 >& aSeqHyper,
926 Sequence< sal_uInt64 >& aSeqUHyper,
927 Sequence< float >& aSeqFloat,
928 Sequence< double >& aSeqDouble,
929 Sequence< TestEnum >& aSeqEnum,
930 Sequence< OUString >& aSeqString,
931 Sequence< Reference< XInterface > >& aSeqXInterface,
932 Sequence< Any >& aSeqAny,
933 Sequence< Sequence< sal_Int32 > >& aSeqDim2,
934 Sequence< Sequence< Sequence< sal_Int32 > > >& aSeqDim3 )
936 aSeqBoolean = _arBool;
937 aSeqChar = _arChar;
938 aSeqByte = _arByte;
939 aSeqShort = _arShort;
940 aSeqUShort = _arUShort;
941 aSeqLong = _arLong;
942 aSeqULong = _arULong;
943 aSeqHyper = _arHyper;
944 aSeqUHyper = _arUHyper;
945 aSeqFloat = _arFloat;
946 aSeqDouble = _arDouble;
947 aSeqEnum = _arEnum;
948 aSeqString = _arString;
949 aSeqXInterface = _arObject;
950 aSeqAny = _arAny;
951 aSeqDim2 = _arLong2;
952 aSeqDim3 = _arLong3;
955 void Test_Impl::testConstructorsService(
956 Reference< XComponentContext > const & context)
958 Sequence< sal_Bool > arg14{ true };
959 Sequence< sal_Int8 > arg15{ SAL_MIN_INT8 };
960 Sequence< sal_Int16 > arg16{ SAL_MIN_INT16 };
961 Sequence< sal_uInt16 > arg17{ SAL_MAX_UINT16 };
962 Sequence< sal_Int32 > arg18{ SAL_MIN_INT32 };
963 Sequence< sal_uInt32 > arg19{ SAL_MAX_UINT32 };
964 Sequence< sal_Int64 > arg20{ SAL_MIN_INT64 };
965 Sequence< sal_uInt64 > arg21{ SAL_MAX_UINT64 };
966 Sequence< float > arg22{ 0.123f };
967 Sequence< double > arg23{ 0.456 };
968 Sequence< sal_Unicode > arg24{ 'X' };
969 Sequence< OUString > arg25 { "test" };
970 Sequence< Type > arg26{ UnoType< Any >::get() };
971 Sequence< Any > arg27{ Any(true) };
972 Sequence< Sequence< sal_Bool > > arg28{ { true } };
973 Sequence< Sequence< Any > > arg29{ { Any(true) } };
974 Sequence< TestEnum > arg30{ TestEnum_TWO };
975 Sequence< TestStruct > arg31(1); arg31.getArray()[0].member = 10;
976 Sequence< TestPolyStruct< sal_Bool > > arg32{ { true } };
977 Sequence< TestPolyStruct< Any > > arg33(1); arg33.getArray()[0].member <<= true;
978 Sequence< Reference< XInterface > > arg34(1);
979 Constructors::create1(context,
980 true,
981 SAL_MIN_INT8,
982 SAL_MIN_INT16,
983 SAL_MAX_UINT16,
984 SAL_MIN_INT32,
985 SAL_MAX_UINT32,
986 SAL_MIN_INT64,
987 SAL_MAX_UINT64,
988 0.123f,
989 0.456,
990 'X',
991 "test",
992 UnoType< Any >::get(),
993 Any(true),
994 arg14,
995 arg15,
996 arg16,
997 arg17,
998 arg18,
999 arg19,
1000 arg20,
1001 arg21,
1002 arg22,
1003 arg23,
1004 arg24,
1005 arg25,
1006 arg26,
1007 arg27,
1008 arg28,
1009 arg29,
1010 arg30,
1011 arg31,
1012 arg32,
1013 arg33,
1014 arg34,
1015 TestEnum_TWO,
1016 TestStruct(10),
1017 TestPolyStruct< sal_Bool >(true),
1018 TestPolyStruct< Any >(Any(true)),
1019 Reference< XInterface >(nullptr));
1020 Sequence< Any > args{
1021 Any(true),
1022 Any(SAL_MIN_INT8),
1023 Any(SAL_MIN_INT16),
1024 Any(SAL_MAX_UINT16),
1025 Any(SAL_MIN_INT32),
1026 Any(SAL_MAX_UINT32),
1027 Any(SAL_MIN_INT64),
1028 Any(SAL_MAX_UINT64),
1029 Any(0.123f),
1030 Any(0.456),
1031 Any(u'X'),
1032 Any(OUString("test")),
1033 Any(UnoType< Any >::get()),
1034 Any(true),
1035 Any(arg14),
1036 Any(arg15),
1037 Any(arg16),
1038 Any(arg17),
1039 Any(arg18),
1040 Any(arg19),
1041 Any(arg20),
1042 Any(arg21),
1043 Any(arg22),
1044 Any(arg23),
1045 Any(arg24),
1046 Any(arg25),
1047 Any(arg26),
1048 Any(arg27),
1049 Any(arg28),
1050 Any(arg29),
1051 Any(arg30),
1052 Any(arg31),
1053 Any(arg32),
1054 Any(arg33),
1055 Any(arg34),
1056 Any(TestEnum_TWO),
1057 Any(TestStruct(10)),
1058 Any(TestPolyStruct< sal_Bool >(true)),
1059 Any(TestPolyStruct< Any >(Any(true))),
1060 Any(Reference< XInterface >(nullptr))
1062 assert(args.getLength() == 40);
1063 Constructors::create2(context, args);
1065 Sequence<Type> argSeq1{ cppu::UnoType<sal_Int32>::get() };
1066 Sequence<Reference<XInterface> > argSeq2 { static_cast<XComponent*>(new Dummy()) };
1067 Sequence<Reference<XComponent> > argSeq2a { static_cast<XComponent*>(new Dummy()) };
1069 Sequence<TestPolyStruct2<sal_Unicode, Sequence<Any> > > argSeq3
1070 { TestPolyStruct2<sal_Unicode, Sequence<Any> >('X', arg27) };
1071 Sequence<TestPolyStruct2<TestPolyStruct<sal_Unicode>, Sequence<Any> > > argSeq4
1072 { TestPolyStruct2<TestPolyStruct<sal_Unicode>, Sequence<Any> >(
1073 TestPolyStruct<sal_Unicode>('X'), arg27) };
1074 Sequence<Sequence<sal_Int32> > argSeq5{ { SAL_MIN_INT32 } };
1075 Sequence<TestPolyStruct<sal_Int32> > argSeq6{ TestPolyStruct<sal_Int32>(SAL_MIN_INT32) };
1076 Sequence<TestPolyStruct<TestPolyStruct2<sal_Unicode, Any> > > argSeq7
1077 { TestPolyStruct<TestPolyStruct2<sal_Unicode, Any> >(
1078 TestPolyStruct2<sal_Unicode, Any>('X', Any(true))) };
1079 Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > > argSeq8
1080 { TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > (
1081 TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString>(
1082 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), OUString("test"))) };
1083 Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > > argSeq9
1084 { TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > >(
1085 OUString("test"), TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >(
1086 'X', TestPolyStruct<Any>(Any(true)))) };
1087 Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> > > argSeq10
1088 { TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> >(
1089 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), TestPolyStruct<sal_Unicode>('X')) };
1090 Sequence<Sequence<TestPolyStruct<sal_Unicode > > > argSeq11
1091 { { TestPolyStruct<sal_Unicode>('X') } };
1092 Sequence<Sequence<TestPolyStruct<TestPolyStruct2<sal_Unicode,Any> > > > argSeq12
1093 { { TestPolyStruct<TestPolyStruct2<sal_Unicode,Any> >(
1094 TestPolyStruct2<sal_Unicode,Any>('X', Any(true))) } };
1095 Sequence<Sequence<TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> > > > argSeq13
1096 { {TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString> >(
1097 TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>,OUString>(
1098 TestPolyStruct2<sal_Unicode,Any>('X', Any(true)), OUString("test")))} };
1099 Sequence<Sequence<TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > > > > argSeq14
1100 { { TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> > >(
1101 OUString("test"), TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >(
1102 'X', TestPolyStruct<Any>(Any(true)))) } };
1103 Sequence<Sequence<TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> > > > argSeq15
1104 { { TestPolyStruct2<TestPolyStruct2<sal_Unicode,Any>, TestPolyStruct<sal_Unicode> >(
1105 TestPolyStruct2<sal_Unicode,Any>('X',Any(true)), TestPolyStruct<sal_Unicode>('X')) } };
1107 Constructors2::create1(
1108 context,
1109 TestPolyStruct<Type>(cppu::UnoType<sal_Int32>::get()),
1110 TestPolyStruct<Any>(Any(true)),
1111 TestPolyStruct<sal_Bool>(true),
1112 TestPolyStruct<sal_Int8>(SAL_MIN_INT8),
1113 TestPolyStruct<sal_Int16>(SAL_MIN_INT16),
1114 TestPolyStruct<sal_Int32>(SAL_MIN_INT32),
1115 TestPolyStruct<sal_Int64>(SAL_MIN_INT64),
1116 TestPolyStruct<sal_Unicode>('X'),
1117 TestPolyStruct<OUString>(OUString("test")),
1118 TestPolyStruct<float>(0.123f),
1119 TestPolyStruct<double>(0.456),
1120 TestPolyStruct<Reference<XInterface> >(static_cast<XBridgeTest2*>(this)),
1121 TestPolyStruct<Reference<XComponent> >(static_cast<XComponent*>(new Dummy())),
1122 TestPolyStruct<TestEnum>(TestEnum_TWO),
1123 TestPolyStruct<TestPolyStruct2<sal_Unicode, Any> >(
1124 TestPolyStruct2<sal_Unicode, Any>('X', Any(true))),
1125 TestPolyStruct<TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString> > (
1126 TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>,OUString>(
1127 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)), OUString("test"))),
1128 TestPolyStruct2<OUString, TestPolyStruct2<sal_Unicode,TestPolyStruct<Any> > >(
1129 OUString("test"),
1130 TestPolyStruct2<sal_Unicode, TestPolyStruct<Any> >('X', TestPolyStruct<Any>(Any(true)))),
1131 TestPolyStruct2<TestPolyStruct2<sal_Unicode, Any>, TestPolyStruct<sal_Unicode> >(
1132 TestPolyStruct2<sal_Unicode, Any>('X', Any(true)),
1133 TestPolyStruct<sal_Unicode>('X')),
1134 TestPolyStruct<Sequence<Type> >(argSeq1),
1135 TestPolyStruct<Sequence<Any> >(arg27),
1136 TestPolyStruct<Sequence<sal_Bool> >(arg14),
1137 TestPolyStruct<Sequence<sal_Int8> >(arg15),
1138 TestPolyStruct<Sequence<sal_Int16> >(arg16),
1139 TestPolyStruct<Sequence<sal_Int32> >(arg18),
1140 TestPolyStruct<Sequence<sal_Int64> >(arg20),
1141 TestPolyStruct<Sequence<sal_Unicode> >(arg24),
1142 TestPolyStruct<Sequence<OUString> >(arg25),
1143 TestPolyStruct<Sequence<float> >(arg22),
1144 TestPolyStruct<Sequence<double> >(arg23),
1145 TestPolyStruct<Sequence<Reference<XInterface> > >(argSeq2),
1146 TestPolyStruct<Sequence<Reference<XComponent> > >(argSeq2a),
1147 TestPolyStruct<Sequence<TestEnum> >(arg30),
1148 TestPolyStruct<Sequence<TestPolyStruct2<sal_Unicode, Sequence<Any> > > >(argSeq3),
1149 TestPolyStruct<Sequence<TestPolyStruct2<TestPolyStruct<sal_Unicode>, Sequence<Any> > > > (argSeq4),
1150 TestPolyStruct<Sequence<Sequence<sal_Int32> > >(argSeq5),
1151 argSeq6,
1152 argSeq7,
1153 argSeq8,
1154 argSeq9,
1155 argSeq10,
1156 argSeq11,
1157 argSeq12,
1158 argSeq13,
1159 argSeq14,
1160 argSeq15);
1163 Reference< XCurrentContextChecker > Test_Impl::getCurrentContextChecker()
1165 return new testtools::bridgetest::CurrentContextChecker;
1168 // XServiceInfo
1170 OUString Test_Impl::getImplementationName()
1172 return IMPLNAME;
1175 sal_Bool Test_Impl::supportsService( const OUString & rServiceName )
1177 return cppu::supportsService(this, rServiceName);
1180 Sequence< OUString > Test_Impl::getSupportedServiceNames()
1182 return bridge_object::getSupportedServiceNames();
1186 static Reference< XInterface > Test_Impl_create(
1187 SAL_UNUSED_PARAMETER const Reference< XMultiServiceFactory > & )
1189 return Reference< XInterface >( static_cast<XBridgeTest *>(new Test_Impl()) );
1194 extern "C"
1196 SAL_DLLPUBLIC_EXPORT void * component_getFactory(
1197 const char * pImplName, SAL_UNUSED_PARAMETER void * pServiceManager,
1198 SAL_UNUSED_PARAMETER void * )
1200 void * pRet = nullptr;
1202 if (pServiceManager && o3tl::equalsAscii(IMPLNAME, pImplName))
1204 Reference< XSingleServiceFactory > xFactory( createSingleFactory(
1205 static_cast< XMultiServiceFactory * >( pServiceManager ),
1206 IMPLNAME,
1207 bridge_object::Test_Impl_create,
1208 bridge_object::getSupportedServiceNames() ) );
1210 if (xFactory.is())
1212 xFactory->acquire();
1213 pRet = xFactory.get();
1217 return pRet;
1221 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */