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 };
54 unsigned short UShort
;
58 unsigned hyper UHyper
;
64 * equal to max size returned in registers on x86_64
72 * equal to max size returned in registers on ia64
82 * bigger than max size returned in registers on ia64
96 * two floats, BSDs/MacOSX on intel handle returning small
97 * structs differently than Linux
105 * all floats, ia64 handles them specially
115 * Small struct with mixed float and integers.
116 * Should return in registers on BSDs/MACOSx
118 struct MixedFloatAndInteger
124 * Small struct with three bytes. Should *not* return in registers on
127 struct ThreeByteStruct
134 * complex types adding string, interface, any
136 struct TestElement
: TestSimple
139 com
::sun
::star
::uno
::XInterface
Interface;
143 * adding even more complexity, sequence< TestElement >
145 struct TestDataElements
: TestElement
147 sequence
< TestElement
> Sequence
;
151 * typedef used in interface
153 typedef TestDataElements TestData
;
155 struct TestPolyStruct
<T
> { T member
; };
156 struct TestPolyStruct2
<T
,C
> {
161 interface XRecursiveCall
: com
::sun
::star
::uno
::XInterface
164 * @param nToCall If nToCall is 0, the method returns immeadiatly.
165 * Otherwise, call the given interface with nToCall -1
168 void callRecursivly
( [in] XRecursiveCall xCall
, [in] long nToCall
);
171 interface XMultiBase1
{
172 [attribute
] double att1
; // initially 0.0
173 long fn11
([in] long arg
); // return 11 * arg
174 string fn12
([in] string arg
); // return "12" + arg
177 interface XMultiBase2
: XMultiBase1
{
178 long fn21
([in] long arg
); // return 21 * arg
179 string fn22
([in] string arg
); // return "22" + arg
182 interface XMultiBase3
{
183 [attribute
] double att3
; // initially 0.0
184 long fn31
([in] long arg
); // return 31 * arg
185 string fn32
([in] string arg
); // return "32" + arg
186 long fn33
(); // return 33
189 interface XMultiBase3a
: XMultiBase3
{};
191 interface XMultiBase4
{
192 long fn41
([in] long arg
); // return 41 * arg
195 interface XMultiBase5
{
196 interface XMultiBase3
;
197 interface XMultiBase4
;
198 interface XMultiBase1
;
201 interface XMultiBase6
{
202 interface XMultiBase2
;
203 interface XMultiBase3a
;
204 interface XMultiBase5
;
205 long fn61
([in] long arg
); // return 61 * arg
206 string fn62
([in] string arg
); // return "62" + arg
209 interface XMultiBase7
{
210 long fn71
([in] long arg
); // return 71 * arg
211 string fn72
([in] string arg
); // return "72" + arg
212 long fn73
(); // return 73
216 interface XMultiBase6
;
217 interface XMultiBase7
;
221 * Monster test interface to test bridge calls.
222 * An implementation of this object has to store given values and return whenever there
223 * is an out param or return value.
225 interface XBridgeTestBase
: com
::sun
::star
::uno
::XInterface
228 * in parameter test, tests by calls reference also (complex types)
230 void setValues
( [in] boolean bBool
, [in] char cChar
, [in] byte nByte
,
231 [in] short nShort
, [in] unsigned short nUShort
,
232 [in] long nLong
, [in] unsigned long nULong
,
233 [in] hyper nHyper
, [in] unsigned hyper nUHyper
,
234 [in] float fFloat
, [in] double fDouble
,
235 [in] TestEnum eEnum
, [in] string aString
,
236 [in] com
::sun
::star
::uno
::XInterface xInterface
, [in] any aAny
,
237 [in] sequence
< TestElement
> aSequence
,
238 [in] TestData aStruct
);
240 * inout parameter test
242 * @return aStruct. The out parameter contain the values, that were previously set
243 * by setValues or (if not called before) default constructed values.
246 TestData setValues2
( [inout
] boolean bBool
, [inout
] char cChar
, [inout
] byte nByte
,
247 [inout
] short nShort
, [inout
] unsigned short nUShort
,
248 [inout
] long nLong
, [inout
] unsigned long nULong
,
249 [inout
] hyper nHyper
, [inout
] unsigned hyper nUHyper
,
250 [inout
] float fFloat
, [inout
] double fDouble
,
251 [inout
] TestEnum eEnum
, [inout
] string aString
,
252 [inout
] com
::sun
::star
::uno
::XInterface xInterface
, [inout
] any aAny
,
253 [inout
] sequence
< TestElement
> aSequence
,
254 [inout
] TestData aStruct
);
259 TestData getValues
( [out] boolean bBool
, [out] char cChar
, [out] byte nByte
,
260 [out] short nShort
, [out] unsigned short nUShort
,
261 [out] long nLong
, [out] unsigned long nULong
,
262 [out] hyper nHyper
, [out] unsigned hyper nUHyper
,
263 [out] float fFloat
, [out] double fDouble
,
264 [out] TestEnum eEnum
, [out] string aString
,
265 [out] com
::sun
::star
::uno
::XInterface xInterface
, [out] any aAny
,
266 [out] sequence
< TestElement
> aSequence
,
267 [out] TestData aStruct
);
270 * register return test 1
272 SmallStruct echoSmallStruct
( [in] SmallStruct aStruct
);
275 * register return test 2
277 MediumStruct echoMediumStruct
( [in] MediumStruct aStruct
);
280 * register return test 3
282 BigStruct echoBigStruct
( [in] BigStruct aStruct
);
285 * register return test 4
287 TwoFloats echoTwoFloats
( [in] TwoFloats aStruct
);
290 * register return test 5
292 FourFloats echoFourFloats
( [in] FourFloats aStruct
);
295 * register return test 6
297 MixedFloatAndInteger echoMixedFloatAndInteger
( [in] MixedFloatAndInteger aStruct
);
300 * register return test 7
302 ThreeByteStruct echoThreeByteStruct
( [in] ThreeByteStruct aStruct
);
305 * PPC Alignment test (#i107182#)
307 long testPPCAlignment
( [in] hyper l1
, [in] hyper l2
, [in] long i1
, [in] hyper l3
, [in] long i2
);
310 * PPC64 Alignment test
312 long testPPC64Alignment
( [in] double d1
, [in] double d2
, [in] double d3
, [in] long i1
);
316 * VFP ABI (armhf) doubles test
318 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
);
320 [attribute
] boolean Bool
;
321 [attribute
] byte Byte;
322 [attribute
] char Char;
323 [attribute
] short Short;
324 [attribute
] unsigned short UShort
;
325 [attribute
] long Long;
326 [attribute
] unsigned long ULong
;
327 [attribute
] hyper Hyper;
328 [attribute
] unsigned hyper UHyper
;
329 [attribute
] float Float;
330 [attribute
] double Double;
331 [attribute
] TestEnum
Enum;
332 [attribute
] string String;
333 [attribute
] com
::sun
::star
::uno
::XInterface
Interface;
335 [attribute
] sequence
< TestElement
> Sequence
;
336 [attribute
] TestData
Struct;
338 [attribute
] long RaiseAttr1
{
339 set raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
341 [attribute
, readonly] long RaiseAttr2
{
342 get raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
345 TestPolyStruct
<boolean> transportPolyBoolean
(
346 [in] TestPolyStruct
<boolean> arg
);
347 void transportPolyHyper
([inout
] TestPolyStruct
<hyper> arg
);
348 void transportPolySequence
(
349 [in] TestPolyStruct
<sequence
<any
> > arg1
,
350 [out] TestPolyStruct
<sequence
<any
> > arg2
);
352 TestPolyStruct
<long> getNullPolyLong
();
353 TestPolyStruct
<string> getNullPolyString
();
354 TestPolyStruct
<type
> getNullPolyType
();
355 TestPolyStruct
<any
> getNullPolyAny
();
356 TestPolyStruct
<sequence
<boolean> > getNullPolySequence
();
357 TestPolyStruct
<TestEnum
> getNullPolyEnum
();
358 TestPolyStruct
<TestBadEnum
> getNullPolyBadEnum
();
359 TestPolyStruct
<TestStruct
> getNullPolyStruct
();
360 TestPolyStruct
<XBridgeTestBase
> getNullPolyInterface
();
363 * This method returns the parameter value.
364 * Method to extensivly test anys.
366 any transportAny
( [in] any value
);
369 * methods to check sequence of calls. Call call() and callOneway
370 * in an arbitrary sequence. Increase the callId for every call.
371 * The testobject sets an error flag.
373 @see testSequencePassed
375 void call
( [in] long nCallId
, [in] long nWaitMUSEC
);
376 void callOneway
( [in] long nCallId
, [in] long nWaitMUSEC
);
377 boolean sequenceOfCallTestPassed
();
380 * methods to check, if threads thread identity is holded.
383 void startRecursiveCall
( [in] XRecursiveCall xCall
, [in] long nToCall
);
386 string testMulti
([in] XMulti multi
);
391 * Inherting from monster; adds raiseException(), attribute raising RuntimeException.
393 interface XBridgeTest
: XBridgeTestBase
396 * the exception struct returned has to be filled with given arguments.
397 * return value is for dummy.
399 TestData raiseException
( [in] short ArgumentPosition
,
401 [in] com
::sun
::star
::uno
::XInterface Context
)
402 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
406 * Throws runtime exception.
407 * check remote bridges handle exceptions during oneway calls properly.
408 * Note that on client side the exception may fly or not. When it flies, it should
409 * have the proper message and context.
411 void raiseRuntimeExceptionOneway
( [in] string Message,
412 [in] com
::sun
::star
::uno
::XInterface Context
);
415 * raises runtime exception;
416 * the exception struct returned has to be filled with formerly set test data.
418 [attribute
] long RuntimeException
;
422 exception BadConstructorArguments
: com
::sun
::star
::uno
::Exception
{};
424 service Constructors
: com
::sun
::star
::uno
::XInterface
{
429 [in] unsigned short arg3
,
431 [in] unsigned long arg5
,
433 [in] unsigned hyper arg7
,
440 [in] sequence
< boolean > arg14
,
441 [in] sequence
< byte > arg15
,
442 [in] sequence
< short > arg16
,
443 [in] sequence
< unsigned short > arg17
,
444 [in] sequence
< long > arg18
,
445 [in] sequence
< unsigned long > arg19
,
446 [in] sequence
< hyper > arg20
,
447 [in] sequence
< unsigned hyper > arg21
,
448 [in] sequence
< float > arg22
,
449 [in] sequence
< double > arg23
,
450 [in] sequence
< char > arg24
,
451 [in] sequence
< string > arg25
,
452 [in] sequence
< type
> arg26
,
453 [in] sequence
< any
> arg27
,
454 [in] sequence
< sequence
< boolean > > arg28
,
455 [in] sequence
< sequence
< any
> > arg29
,
456 [in] sequence
< TestEnum
> arg30
,
457 [in] sequence
< TestStruct
> arg31
,
458 [in] sequence
< TestPolyStruct
< boolean > > arg32
,
459 [in] sequence
< TestPolyStruct
< any
> > arg33
,
460 [in] sequence
< com
::sun
::star
::uno
::XInterface
> arg34
,
462 [in] TestStruct arg36
,
463 [in] TestPolyStruct
< boolean > arg37
,
464 [in] TestPolyStruct
< any
> arg38
,
465 [in] com
::sun
::star
::uno
::XInterface arg39
)
466 raises
(BadConstructorArguments
);
468 create2
([in] any... args
) raises
(BadConstructorArguments
);
472 service Constructors2
: XMultiBase1
{
475 [in] TestPolyStruct
<type
> arg1
,
476 [in] TestPolyStruct
<any
> arg2
,
477 [in] TestPolyStruct
<boolean> arg3
,
478 [in] TestPolyStruct
<byte> arg4
,
479 [in] TestPolyStruct
<short> arg5
,
480 [in] TestPolyStruct
<long> arg6
,
481 [in] TestPolyStruct
<hyper> arg7
,
482 [in] TestPolyStruct
<char> arg8
,
483 [in] TestPolyStruct
<string> arg9
,
484 [in] TestPolyStruct
<float> arg10
,
485 [in] TestPolyStruct
<double> arg11
,
486 [in] TestPolyStruct
<com
::sun
::star
::uno
::XInterface
> arg12
,
487 [in] TestPolyStruct
<com
::sun
::star
::lang
::XComponent
> arg13
,
488 [in] TestPolyStruct
<TestEnum
> arg14
,
489 [in] TestPolyStruct
<TestPolyStruct2
<char,any
> > arg15
,
490 [in] TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<char,any
>,string> > arg16
,
491 [in] TestPolyStruct2
<string, TestPolyStruct2
<char, TestPolyStruct
<any
> > > arg17
,
492 [in] TestPolyStruct2
<TestPolyStruct2
<char,any
>, TestPolyStruct
<char> > arg18
,
493 [in] TestPolyStruct
<sequence
<type
> > arg19
,
494 [in] TestPolyStruct
<sequence
<any
> > arg20
,
495 [in] TestPolyStruct
<sequence
<boolean> > arg21
,
496 [in] TestPolyStruct
<sequence
<byte> > arg22
,
497 [in] TestPolyStruct
<sequence
<short> > arg23
,
498 [in] TestPolyStruct
<sequence
<long> > arg24
,
499 [in] TestPolyStruct
<sequence
<hyper> > arg25
,
500 [in] TestPolyStruct
<sequence
<char> > arg26
,
501 [in] TestPolyStruct
<sequence
<string> > arg27
,
502 [in] TestPolyStruct
<sequence
<float> > arg28
,
503 [in] TestPolyStruct
<sequence
<double> > arg29
,
504 [in] TestPolyStruct
<sequence
<com
::sun
::star
::uno
::XInterface
> > arg30
,
505 [in] TestPolyStruct
<sequence
<com
::sun
::star
::lang
::XComponent
> > arg31
,
506 [in] TestPolyStruct
<sequence
<TestEnum
> > arg32
,
507 [in] TestPolyStruct
<sequence
<TestPolyStruct2
<char, sequence
<any
> > > > arg33
,
508 [in] TestPolyStruct
<sequence
<TestPolyStruct2
<TestPolyStruct
<char>, sequence
<any
> > > > arg34
,
509 [in] TestPolyStruct
<sequence
<sequence
<long> > > arg35
,
510 [in] sequence
<TestPolyStruct
<long > > arg36
,
511 [in] sequence
<TestPolyStruct
<TestPolyStruct2
<char,any
> > > arg37
,
512 [in] sequence
<TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<char,any
>,string> > > arg38
,
513 [in] sequence
<TestPolyStruct2
<string, TestPolyStruct2
<char, TestPolyStruct
<any
> > > > arg39
,
514 [in] sequence
<TestPolyStruct2
<TestPolyStruct2
<char,any
>, TestPolyStruct
<char> > > arg40
,
515 [in] sequence
<sequence
<TestPolyStruct
< char > > > arg41
,
516 [in] sequence
<sequence
<TestPolyStruct
<TestPolyStruct2
<char,any
> > > >arg42
,
517 [in] sequence
<sequence
<TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<char,any
>,string> > > > arg43
,
518 [in] sequence
<sequence
<TestPolyStruct2
<string, TestPolyStruct2
<char, TestPolyStruct
<any
> > > > > arg44
,
519 [in] sequence
<sequence
<TestPolyStruct2
<TestPolyStruct2
<char,any
>, TestPolyStruct
<char> > > > arg45
523 interface XCurrentContextChecker
{
525 [in] XCurrentContextChecker other
, [in] long setSteps
,
526 [in] long checkSteps
);
529 /** Extended tests with sequences.
531 interface XBridgeTest2
: XBridgeTest
533 sequence
< boolean > setSequenceBool
( [in] sequence
< boolean > aSeq
);
534 sequence
< char > setSequenceChar
( [in] sequence
< char > aSeq
);
535 sequence
< byte> setSequenceByte
( [in] sequence
< byte > aSeq
);
536 sequence
< short> setSequenceShort
( [in] sequence
< short > aSeq
);
537 sequence
< unsigned short > setSequenceUShort
( [in] sequence
< unsigned short > aSeq
);
538 sequence
< long > setSequenceLong
( [in] sequence
< long > aSeq
);
539 sequence
< unsigned long > setSequenceULong
( [in] sequence
< unsigned long > aSeq
);
540 sequence
< hyper > setSequenceHyper
( [in] sequence
< hyper > aSeq
);
541 sequence
< unsigned hyper > setSequenceUHyper
( [in] sequence
< unsigned hyper > aSeq
);
542 sequence
< float > setSequenceFloat
( [in] sequence
< float > aSeq
);
543 sequence
< double > setSequenceDouble
( [in] sequence
< double > aSeq
);
544 sequence
< TestEnum
> setSequenceEnum
( [in] sequence
< TestEnum
> aSeq
);
545 sequence
< string > setSequenceString
( [in] sequence
< string > aString
);
546 sequence
< com
::sun
::star
::uno
::XInterface
> setSequenceXInterface
(
547 [in] sequence
< com
::sun
::star
::uno
::XInterface
> aSeq
);
548 sequence
< any
> setSequenceAny
( [in] sequence
< any
> aSeq
);
549 sequence
< TestElement
> setSequenceStruct
( [in] sequence
< TestElement
> aSeq
);
551 sequence
< sequence
< long > > setDim2
( [in] sequence
< sequence
< long > > aSeq
);
552 sequence
< sequence
< sequence
< long > > > setDim3
(
553 [in] sequence
< sequence
< sequence
< long > > > aSeq
);
555 void setSequencesInOut
( [inout
] sequence
< boolean > aSeqBoolean
,
556 [inout
] sequence
< char > aSeqChar
,
557 [inout
] sequence
< byte > aSeqByte
,
558 [inout
] sequence
< short > aSeqShort
,
559 [inout
] sequence
< unsigned short> aSeqUShort
,
560 [inout
] sequence
< long > aSeqLong
,
561 [inout
] sequence
< unsigned long > aSeqULong
,
562 [inout
] sequence
< hyper > aSeqHyper
,
563 [inout
] sequence
< unsigned hyper > aSeqUHyper
,
564 [inout
] sequence
< float > aSeqFloat
,
565 [inout
] sequence
< double > aSeqDouble
,
566 [inout
] sequence
< TestEnum
> aSeqEnum
,
567 [inout
] sequence
< string > aSeqString
,
568 [inout
] sequence
< com
::sun
::star
::uno
::XInterface
> aSeqXInterface
,
569 [inout
] sequence
< any
> aSeqAny
,
570 [inout
] sequence
< sequence
< long > > aSeqDim2
,
571 [inout
] sequence
< sequence
< sequence
< long > > > aSeqDim3
);
573 void setSequencesOut
( [out] sequence
< boolean > aSeqBoolean
,
574 [out] sequence
< char > aSeqChar
,
575 [out] sequence
< byte > aSeqByte
,
576 [out] sequence
< short > aSeqShort
,
577 [out] sequence
< unsigned short> aSeqUShort
,
578 [out] sequence
< long > aSeqLong
,
579 [out] sequence
< unsigned long > aSeqULong
,
580 [out] sequence
< hyper > aSeqHyper
,
581 [out] sequence
< unsigned hyper > aSeqUHyper
,
582 [out] sequence
< float > aSeqFloat
,
583 [out] sequence
< double > aSeqDouble
,
584 [out] sequence
< TestEnum
> aSeqEnum
,
585 [out] sequence
< string > aSeqString
,
586 [out] sequence
< com
::sun
::star
::uno
::XInterface
> aSeqXInterface
,
587 [out] sequence
< any
> aSeqAny
,
588 [out] sequence
< sequence
< long > > aSeqDim2
,
589 [out] sequence
< sequence
< sequence
< long > > > aSeqDim3
);
591 void testConstructorsService
(
592 [in] com
::sun
::star
::uno
::XComponentContext context
)
593 raises
(BadConstructorArguments
);
595 XCurrentContextChecker getCurrentContextChecker
();
600 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */