1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
<com
/sun
/star
/lang
/IllegalArgumentException.idl
>
21 #include
<com
/sun
/star
/lang
/XComponent.idl
>
22 #include
<com
/sun
/star
/uno
/XComponentContext.idl
>
23 #include
<com
/sun
/star
/uno
/XInterface.idl
>
25 module test
{ module testtools
{ module bridgetest
{
38 enum TestBadEnum
{ M
= 1 };
56 unsigned short UShort
;
60 unsigned hyper UHyper
;
66 * equal to max size returned in registers on x86_64
74 * equal to max size returned in registers on ia64
84 * bigger than max size returned in registers on ia64
98 * two floats, BSDs/MacOSX on intel handle returning small
99 * structs differently than Linux
107 * all floats, ia64 handles them specially
117 * Small struct with mixed float and integers.
118 * Should return in registers on BSDs/MACOSx
120 struct MixedFloatAndInteger
133 struct FloatFloatLongByte
{
140 * Small struct with three bytes. Should *not* return in registers on
143 struct ThreeByteStruct
150 * complex types adding string, interface, any
152 struct TestElement
: TestSimple
155 com
::sun
::star
::uno
::XInterface
Interface;
159 * adding even more complexity, sequence< TestElement >
161 struct TestDataElements
: TestElement
163 sequence
< TestElement
> Sequence
;
167 * typedef used in interface
169 typedef TestDataElements TestData
;
171 struct TestPolyStruct
<T
> { T member
; };
172 struct TestPolyStruct2
<T
,C
> {
177 interface XRecursiveCall
: com
::sun
::star
::uno
::XInterface
180 * @param nToCall If nToCall is 0, the method returns immediately.
181 * Otherwise, call the given interface with nToCall -1
184 void callRecursivly
( [in] XRecursiveCall xCall
, [in] long nToCall
);
187 interface XMultiBase1
{
188 [attribute
] double att1
; // initially 0.0
189 long fn11
([in] long arg
); // return 11 * arg
190 string fn12
([in] string arg
); // return "12" + arg
193 interface XMultiBase2
: XMultiBase1
{
194 long fn21
([in] long arg
); // return 21 * arg
195 string fn22
([in] string arg
); // return "22" + arg
198 interface XMultiBase3
{
199 [attribute
] double att3
; // initially 0.0
200 long fn31
([in] long arg
); // return 31 * arg
201 string fn32
([in] string arg
); // return "32" + arg
202 long fn33
(); // return 33
205 interface XMultiBase3a
: XMultiBase3
{};
207 interface XMultiBase4
{
208 long fn41
([in] long arg
); // return 41 * arg
211 interface XMultiBase5
{
212 interface XMultiBase3
;
213 interface XMultiBase4
;
214 interface XMultiBase1
;
217 interface XMultiBase6
{
218 interface XMultiBase2
;
219 interface XMultiBase3a
;
220 interface XMultiBase5
;
221 long fn61
([in] long arg
); // return 61 * arg
222 string fn62
([in] string arg
); // return "62" + arg
225 interface XMultiBase7
{
226 long fn71
([in] long arg
); // return 71 * arg
227 string fn72
([in] string arg
); // return "72" + arg
228 long fn73
(); // return 73
232 interface XMultiBase6
;
233 interface XMultiBase7
;
237 * Monster test interface to test bridge calls.
238 * An implementation of this object has to store given values and return whenever there
239 * is an out param or return value.
241 interface XBridgeTestBase
: com
::sun
::star
::uno
::XInterface
244 * in parameter test, tests by calls reference also (complex types)
246 void setValues
( [in] boolean bBool
,
250 [in] unsigned short nUShort
,
252 [in] unsigned long nULong
,
254 [in] unsigned hyper nUHyper
,
261 [in] com
::sun
::star
::uno
::XInterface xInterface
,
263 [in] sequence
< TestElement
> aSequence
,
264 [in] TestData aStruct
);
266 * inout parameter test
268 * @return aStruct. The out parameter contain the values, that were previously set
269 * by setValues or (if not called before) default constructed values.
272 TestData setValues2
( [inout
] boolean bBool
,
275 [inout
] short nShort
,
276 [inout
] unsigned short nUShort
,
278 [inout
] unsigned long nULong
,
279 [inout
] hyper nHyper
,
280 [inout
] unsigned hyper nUHyper
,
281 [inout
] float fFloat
,
282 [inout
] double fDouble
,
283 [inout
] TestEnum eEnum
,
284 [inout
] string aString
,
286 [inout
] short aShort2
,
287 [inout
] com
::sun
::star
::uno
::XInterface xInterface
,
289 [inout
] sequence
< TestElement
> aSequence
,
290 [inout
] TestData aStruct
);
295 TestData getValues
( [out] boolean bBool
,
299 [out] unsigned short nUShort
,
301 [out] unsigned long nULong
,
303 [out] unsigned hyper nUHyper
,
305 [out] double fDouble
,
306 [out] TestEnum eEnum
,
307 [out] string aString
,
310 [out] com
::sun
::star
::uno
::XInterface xInterface
,
312 [out] sequence
< TestElement
> aSequence
,
313 [out] TestData aStruct
);
316 * register return test 1
318 SmallStruct echoSmallStruct
( [in] SmallStruct aStruct
);
321 * register return test 2
323 MediumStruct echoMediumStruct
( [in] MediumStruct aStruct
);
326 * register return test 3
328 BigStruct echoBigStruct
( [in] BigStruct aStruct
);
331 * register return test 4
333 TwoFloats echoTwoFloats
( [in] TwoFloats aStruct
);
336 * register return test 5
338 FourFloats echoFourFloats
( [in] FourFloats aStruct
);
341 * register return test 6
343 MixedFloatAndInteger echoMixedFloatAndInteger
( [in] MixedFloatAndInteger aStruct
);
345 DoubleHyper echoDoubleHyper
([in] DoubleHyper s
);
347 HyperDouble echoHyperDouble
([in] HyperDouble s
);
349 FloatFloatLongByte echoFloatFloatLongByte
([in] FloatFloatLongByte s
);
352 * register return test 7
354 ThreeByteStruct echoThreeByteStruct
( [in] ThreeByteStruct aStruct
);
357 * PPC Alignment test (#i107182#)
359 long testPPCAlignment
( [in] hyper l1
, [in] hyper l2
, [in] long i1
, [in] hyper l3
, [in] long i2
);
362 * PPC64 Alignment test
364 long testPPC64Alignment
( [in] double d1
, [in] double d2
, [in] double d3
, [in] long i1
);
368 * VFP ABI (armhf) doubles test
370 double testTenDoubles
( [in] double d1
, [in] double d2
, [in] double d3
, [in] double d4
, [in] double d5
, [in] double d6
, [in] double d7
, [in] double d8
, [in] double d9
, [in] double d10
);
372 [attribute
] boolean Bool
;
373 [attribute
] byte Byte;
374 [attribute
] char Char;
375 [attribute
] short Short;
376 [attribute
] unsigned short UShort
;
377 [attribute
] long Long;
378 [attribute
] unsigned long ULong
;
379 [attribute
] hyper Hyper;
380 [attribute
] unsigned hyper UHyper
;
381 [attribute
] float Float;
382 [attribute
] double Double;
383 [attribute
] TestEnum
Enum;
384 [attribute
] string String;
385 [attribute
] byte Byte2
;
386 [attribute
] short Short2
;
387 [attribute
] com
::sun
::star
::uno
::XInterface
Interface;
389 [attribute
] sequence
< TestElement
> Sequence
;
390 [attribute
] TestData
Struct;
392 [attribute
] long RaiseAttr1
{
393 set raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
395 [attribute
, readonly] long RaiseAttr2
{
396 get raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
399 TestPolyStruct
<boolean> transportPolyBoolean
(
400 [in] TestPolyStruct
<boolean> arg
);
401 void transportPolyHyper
([inout
] TestPolyStruct
<hyper> arg
);
402 void transportPolySequence
(
403 [in] TestPolyStruct
<sequence
<any
> > arg1
,
404 [out] TestPolyStruct
<sequence
<any
> > arg2
);
406 TestPolyStruct
<long> getNullPolyLong
();
407 TestPolyStruct
<string> getNullPolyString
();
408 TestPolyStruct
<type
> getNullPolyType
();
409 TestPolyStruct
<any
> getNullPolyAny
();
410 TestPolyStruct
<sequence
<boolean> > getNullPolySequence
();
411 TestPolyStruct
<TestEnum
> getNullPolyEnum
();
412 TestPolyStruct
<TestBadEnum
> getNullPolyBadEnum
();
413 TestPolyStruct
<TestStruct
> getNullPolyStruct
();
414 TestPolyStruct
<XBridgeTestBase
> getNullPolyInterface
();
417 * This method returns the parameter value.
418 * Method to extensively test anys.
420 any transportAny
( [in] any value
);
423 * methods to check sequence of calls. Call call() and callOneway
424 * in an arbitrary sequence. Increase the callId for every call.
425 * The testobject sets an error flag.
427 @see testSequencePassed
429 void call
( [in] long nCallId
, [in] long nWaitMUSEC
);
430 void callOneway
( [in] long nCallId
, [in] long nWaitMUSEC
);
431 boolean sequenceOfCallTestPassed
();
434 * methods to check, if threads thread identity is holded.
437 void startRecursiveCall
( [in] XRecursiveCall xCall
, [in] long nToCall
);
440 string testMulti
([in] XMulti multi
);
445 * Inheriting from monster; adds raiseException(), attribute raising RuntimeException.
447 interface XBridgeTest
: XBridgeTestBase
450 * the exception struct returned has to be filled with given arguments.
451 * return value is for dummy.
453 TestData raiseException
( [in] short ArgumentPosition
,
455 [in] com
::sun
::star
::uno
::XInterface Context
)
456 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
460 * Throws runtime exception.
461 * check remote bridges handle exceptions during oneway calls properly.
462 * Note that on client side the exception may fly or not. When it flies, it should
463 * have the proper message and context.
465 void raiseRuntimeExceptionOneway
( [in] string Message,
466 [in] com
::sun
::star
::uno
::XInterface Context
);
469 * raises runtime exception;
470 * the exception struct returned has to be filled with formerly set test data.
472 [attribute
] long RuntimeException
;
476 exception BadConstructorArguments
: com
::sun
::star
::uno
::Exception
{};
478 service Constructors
: com
::sun
::star
::uno
::XInterface
{
483 [in] unsigned short arg3
,
485 [in] unsigned long arg5
,
487 [in] unsigned hyper arg7
,
494 [in] sequence
< boolean > arg14
,
495 [in] sequence
< byte > arg15
,
496 [in] sequence
< short > arg16
,
497 [in] sequence
< unsigned short > arg17
,
498 [in] sequence
< long > arg18
,
499 [in] sequence
< unsigned long > arg19
,
500 [in] sequence
< hyper > arg20
,
501 [in] sequence
< unsigned hyper > arg21
,
502 [in] sequence
< float > arg22
,
503 [in] sequence
< double > arg23
,
504 [in] sequence
< char > arg24
,
505 [in] sequence
< string > arg25
,
506 [in] sequence
< type
> arg26
,
507 [in] sequence
< any
> arg27
,
508 [in] sequence
< sequence
< boolean > > arg28
,
509 [in] sequence
< sequence
< any
> > arg29
,
510 [in] sequence
< TestEnum
> arg30
,
511 [in] sequence
< TestStruct
> arg31
,
512 [in] sequence
< TestPolyStruct
< boolean > > arg32
,
513 [in] sequence
< TestPolyStruct
< any
> > arg33
,
514 [in] sequence
< com
::sun
::star
::uno
::XInterface
> arg34
,
516 [in] TestStruct arg36
,
517 [in] TestPolyStruct
< boolean > arg37
,
518 [in] TestPolyStruct
< any
> arg38
,
519 [in] com
::sun
::star
::uno
::XInterface arg39
)
520 raises
(BadConstructorArguments
);
522 create2
([in] any... args
) raises
(BadConstructorArguments
);
526 service Constructors2
: XMultiBase1
{
529 [in] TestPolyStruct
<type
> arg1
,
530 [in] TestPolyStruct
<any
> arg2
,
531 [in] TestPolyStruct
<boolean> arg3
,
532 [in] TestPolyStruct
<byte> arg4
,
533 [in] TestPolyStruct
<short> arg5
,
534 [in] TestPolyStruct
<long> arg6
,
535 [in] TestPolyStruct
<hyper> arg7
,
536 [in] TestPolyStruct
<char> arg8
,
537 [in] TestPolyStruct
<string> arg9
,
538 [in] TestPolyStruct
<float> arg10
,
539 [in] TestPolyStruct
<double> arg11
,
540 [in] TestPolyStruct
<com
::sun
::star
::uno
::XInterface
> arg12
,
541 [in] TestPolyStruct
<com
::sun
::star
::lang
::XComponent
> arg13
,
542 [in] TestPolyStruct
<TestEnum
> arg14
,
543 [in] TestPolyStruct
<TestPolyStruct2
<char,any
> > arg15
,
544 [in] TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<char,any
>,string> > arg16
,
545 [in] TestPolyStruct2
<string, TestPolyStruct2
<char, TestPolyStruct
<any
> > > arg17
,
546 [in] TestPolyStruct2
<TestPolyStruct2
<char,any
>, TestPolyStruct
<char> > arg18
,
547 [in] TestPolyStruct
<sequence
<type
> > arg19
,
548 [in] TestPolyStruct
<sequence
<any
> > arg20
,
549 [in] TestPolyStruct
<sequence
<boolean> > arg21
,
550 [in] TestPolyStruct
<sequence
<byte> > arg22
,
551 [in] TestPolyStruct
<sequence
<short> > arg23
,
552 [in] TestPolyStruct
<sequence
<long> > arg24
,
553 [in] TestPolyStruct
<sequence
<hyper> > arg25
,
554 [in] TestPolyStruct
<sequence
<char> > arg26
,
555 [in] TestPolyStruct
<sequence
<string> > arg27
,
556 [in] TestPolyStruct
<sequence
<float> > arg28
,
557 [in] TestPolyStruct
<sequence
<double> > arg29
,
558 [in] TestPolyStruct
<sequence
<com
::sun
::star
::uno
::XInterface
> > arg30
,
559 [in] TestPolyStruct
<sequence
<com
::sun
::star
::lang
::XComponent
> > arg31
,
560 [in] TestPolyStruct
<sequence
<TestEnum
> > arg32
,
561 [in] TestPolyStruct
<sequence
<TestPolyStruct2
<char, sequence
<any
> > > > arg33
,
562 [in] TestPolyStruct
<sequence
<TestPolyStruct2
<TestPolyStruct
<char>, sequence
<any
> > > > arg34
,
563 [in] TestPolyStruct
<sequence
<sequence
<long> > > arg35
,
564 [in] sequence
<TestPolyStruct
<long > > arg36
,
565 [in] sequence
<TestPolyStruct
<TestPolyStruct2
<char,any
> > > arg37
,
566 [in] sequence
<TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<char,any
>,string> > > arg38
,
567 [in] sequence
<TestPolyStruct2
<string, TestPolyStruct2
<char, TestPolyStruct
<any
> > > > arg39
,
568 [in] sequence
<TestPolyStruct2
<TestPolyStruct2
<char,any
>, TestPolyStruct
<char> > > arg40
,
569 [in] sequence
<sequence
<TestPolyStruct
< char > > > arg41
,
570 [in] sequence
<sequence
<TestPolyStruct
<TestPolyStruct2
<char,any
> > > >arg42
,
571 [in] sequence
<sequence
<TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<char,any
>,string> > > > arg43
,
572 [in] sequence
<sequence
<TestPolyStruct2
<string, TestPolyStruct2
<char, TestPolyStruct
<any
> > > > > arg44
,
573 [in] sequence
<sequence
<TestPolyStruct2
<TestPolyStruct2
<char,any
>, TestPolyStruct
<char> > > > arg45
577 interface XCurrentContextChecker
{
579 [in] XCurrentContextChecker other
, [in] long setSteps
,
580 [in] long checkSteps
);
583 /** Extended tests with sequences.
585 interface XBridgeTest2
: XBridgeTest
587 sequence
< boolean > setSequenceBool
( [in] sequence
< boolean > aSeq
);
588 sequence
< char > setSequenceChar
( [in] sequence
< char > aSeq
);
589 sequence
< byte> setSequenceByte
( [in] sequence
< byte > aSeq
);
590 sequence
< short> setSequenceShort
( [in] sequence
< short > aSeq
);
591 sequence
< unsigned short > setSequenceUShort
( [in] sequence
< unsigned short > aSeq
);
592 sequence
< long > setSequenceLong
( [in] sequence
< long > aSeq
);
593 sequence
< unsigned long > setSequenceULong
( [in] sequence
< unsigned long > aSeq
);
594 sequence
< hyper > setSequenceHyper
( [in] sequence
< hyper > aSeq
);
595 sequence
< unsigned hyper > setSequenceUHyper
( [in] sequence
< unsigned hyper > aSeq
);
596 sequence
< float > setSequenceFloat
( [in] sequence
< float > aSeq
);
597 sequence
< double > setSequenceDouble
( [in] sequence
< double > aSeq
);
598 sequence
< TestEnum
> setSequenceEnum
( [in] sequence
< TestEnum
> aSeq
);
599 sequence
< string > setSequenceString
( [in] sequence
< string > aString
);
600 sequence
< com
::sun
::star
::uno
::XInterface
> setSequenceXInterface
(
601 [in] sequence
< com
::sun
::star
::uno
::XInterface
> aSeq
);
602 sequence
< any
> setSequenceAny
( [in] sequence
< any
> aSeq
);
603 sequence
< TestElement
> setSequenceStruct
( [in] sequence
< TestElement
> aSeq
);
605 sequence
< sequence
< long > > setDim2
( [in] sequence
< sequence
< long > > aSeq
);
606 sequence
< sequence
< sequence
< long > > > setDim3
(
607 [in] sequence
< sequence
< sequence
< long > > > aSeq
);
609 void setSequencesInOut
( [inout
] sequence
< boolean > aSeqBoolean
,
610 [inout
] sequence
< char > aSeqChar
,
611 [inout
] sequence
< byte > aSeqByte
,
612 [inout
] sequence
< short > aSeqShort
,
613 [inout
] sequence
< unsigned short> aSeqUShort
,
614 [inout
] sequence
< long > aSeqLong
,
615 [inout
] sequence
< unsigned long > aSeqULong
,
616 [inout
] sequence
< hyper > aSeqHyper
,
617 [inout
] sequence
< unsigned hyper > aSeqUHyper
,
618 [inout
] sequence
< float > aSeqFloat
,
619 [inout
] sequence
< double > aSeqDouble
,
620 [inout
] sequence
< TestEnum
> aSeqEnum
,
621 [inout
] sequence
< string > aSeqString
,
622 [inout
] sequence
< com
::sun
::star
::uno
::XInterface
> aSeqXInterface
,
623 [inout
] sequence
< any
> aSeqAny
,
624 [inout
] sequence
< sequence
< long > > aSeqDim2
,
625 [inout
] sequence
< sequence
< sequence
< long > > > aSeqDim3
);
627 void setSequencesOut
( [out] sequence
< boolean > aSeqBoolean
,
628 [out] sequence
< char > aSeqChar
,
629 [out] sequence
< byte > aSeqByte
,
630 [out] sequence
< short > aSeqShort
,
631 [out] sequence
< unsigned short> aSeqUShort
,
632 [out] sequence
< long > aSeqLong
,
633 [out] sequence
< unsigned long > aSeqULong
,
634 [out] sequence
< hyper > aSeqHyper
,
635 [out] sequence
< unsigned hyper > aSeqUHyper
,
636 [out] sequence
< float > aSeqFloat
,
637 [out] sequence
< double > aSeqDouble
,
638 [out] sequence
< TestEnum
> aSeqEnum
,
639 [out] sequence
< string > aSeqString
,
640 [out] sequence
< com
::sun
::star
::uno
::XInterface
> aSeqXInterface
,
641 [out] sequence
< any
> aSeqAny
,
642 [out] sequence
< sequence
< long > > aSeqDim2
,
643 [out] sequence
< sequence
< sequence
< long > > > aSeqDim3
);
645 void testConstructorsService
(
646 [in] com
::sun
::star
::uno
::XComponentContext context
)
647 raises
(BadConstructorArguments
);
649 XCurrentContextChecker getCurrentContextChecker
();
654 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */