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 module test
{ module testtools
{ module bridgetest
{
33 enum TestBadEnum
{ M
= 1 };
51 unsigned short UShort
;
55 unsigned hyper UHyper
;
61 * equal to max size returned in registers on x86_64
69 * equal to max size returned in registers on ia64
79 * bigger than max size returned in registers on ia64
93 * two floats, BSDs/MacOSX on intel handle returning small
94 * structs differently than Linux
102 * all floats, ia64 handles them specially
112 * Small struct with mixed float and integers.
113 * Should return in registers on BSDs/MACOSx
115 struct MixedFloatAndInteger
128 struct FloatFloatLongByte
{
135 * Small struct with three bytes. Should *not* return in registers on
138 struct ThreeByteStruct
145 * complex types adding string, interface, any
147 struct TestElement
: TestSimple
150 com
::sun
::star
::uno
::XInterface
Interface;
154 * adding even more complexity, sequence< TestElement >
156 struct TestDataElements
: TestElement
158 sequence
< TestElement
> Sequence
;
162 * typedef used in interface
164 typedef TestDataElements TestData
;
166 struct TestPolyStruct
<T
> { T member
; };
167 struct TestPolyStruct2
<T
,C
> {
172 interface XRecursiveCall
: com
::sun
::star
::uno
::XInterface
175 * @param nToCall If nToCall is 0, the method returns immediately.
176 * Otherwise, call the given interface with nToCall -1
179 void callRecursivly
( [in] XRecursiveCall xCall
, [in] long nToCall
);
182 interface XMultiBase1
{
183 [attribute
] double att1
; // initially 0.0
184 long fn11
([in] long arg
); // return 11 * arg
185 string fn12
([in] string arg
); // return "12" + arg
188 interface XMultiBase2
: XMultiBase1
{
189 long fn21
([in] long arg
); // return 21 * arg
190 string fn22
([in] string arg
); // return "22" + arg
193 interface XMultiBase3
{
194 [attribute
] double att3
; // initially 0.0
195 long fn31
([in] long arg
); // return 31 * arg
196 string fn32
([in] string arg
); // return "32" + arg
197 long fn33
(); // return 33
200 interface XMultiBase3a
: XMultiBase3
{};
202 interface XMultiBase4
{
203 long fn41
([in] long arg
); // return 41 * arg
206 interface XMultiBase5
{
207 interface XMultiBase3
;
208 interface XMultiBase4
;
209 interface XMultiBase1
;
212 interface XMultiBase6
{
213 interface XMultiBase2
;
214 interface XMultiBase3a
;
215 interface XMultiBase5
;
216 long fn61
([in] long arg
); // return 61 * arg
217 string fn62
([in] string arg
); // return "62" + arg
220 interface XMultiBase7
{
221 long fn71
([in] long arg
); // return 71 * arg
222 string fn72
([in] string arg
); // return "72" + arg
223 long fn73
(); // return 73
227 interface XMultiBase6
;
228 interface XMultiBase7
;
232 * Monster test interface to test bridge calls.
233 * An implementation of this object has to store given values and return whenever there
234 * is an out param or return value.
236 interface XBridgeTestBase
: com
::sun
::star
::uno
::XInterface
239 * in parameter test, tests by calls reference also (complex types)
241 void setValues
( [in] boolean bBool
,
245 [in] unsigned short nUShort
,
247 [in] unsigned long nULong
,
249 [in] unsigned hyper nUHyper
,
256 [in] com
::sun
::star
::uno
::XInterface xInterface
,
258 [in] sequence
< TestElement
> aSequence
,
259 [in] TestData aStruct
);
261 * inout parameter test
263 * @return aStruct. The out parameter contain the values, that were previously set
264 * by setValues or (if not called before) default constructed values.
267 TestData setValues2
( [inout
] boolean bBool
,
270 [inout
] short nShort
,
271 [inout
] unsigned short nUShort
,
273 [inout
] unsigned long nULong
,
274 [inout
] hyper nHyper
,
275 [inout
] unsigned hyper nUHyper
,
276 [inout
] float fFloat
,
277 [inout
] double fDouble
,
278 [inout
] TestEnum eEnum
,
279 [inout
] string aString
,
281 [inout
] short aShort2
,
282 [inout
] com
::sun
::star
::uno
::XInterface xInterface
,
284 [inout
] sequence
< TestElement
> aSequence
,
285 [inout
] TestData aStruct
);
290 TestData getValues
( [out] boolean bBool
,
294 [out] unsigned short nUShort
,
296 [out] unsigned long nULong
,
298 [out] unsigned hyper nUHyper
,
300 [out] double fDouble
,
301 [out] TestEnum eEnum
,
302 [out] string aString
,
305 [out] com
::sun
::star
::uno
::XInterface xInterface
,
307 [out] sequence
< TestElement
> aSequence
,
308 [out] TestData aStruct
);
311 * register return test 1
313 SmallStruct echoSmallStruct
( [in] SmallStruct aStruct
);
316 * register return test 2
318 MediumStruct echoMediumStruct
( [in] MediumStruct aStruct
);
321 * register return test 3
323 BigStruct echoBigStruct
( [in] BigStruct aStruct
);
326 * register return test 4
328 TwoFloats echoTwoFloats
( [in] TwoFloats aStruct
);
331 * register return test 5
333 FourFloats echoFourFloats
( [in] FourFloats aStruct
);
336 * register return test 6
338 MixedFloatAndInteger echoMixedFloatAndInteger
( [in] MixedFloatAndInteger aStruct
);
340 DoubleHyper echoDoubleHyper
([in] DoubleHyper s
);
342 HyperDouble echoHyperDouble
([in] HyperDouble s
);
344 FloatFloatLongByte echoFloatFloatLongByte
([in] FloatFloatLongByte s
);
347 * register return test 7
349 ThreeByteStruct echoThreeByteStruct
( [in] ThreeByteStruct aStruct
);
352 * PPC Alignment test (#i107182#)
354 long testPPCAlignment
( [in] hyper l1
, [in] hyper l2
, [in] long i1
, [in] hyper l3
, [in] long i2
);
357 * PPC64 Alignment test
359 long testPPC64Alignment
( [in] double d1
, [in] double d2
, [in] double d3
, [in] long i1
);
363 * VFP ABI (armhf) doubles test
365 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
);
367 [attribute
] boolean Bool
;
368 [attribute
] byte Byte;
369 [attribute
] char Char;
370 [attribute
] short Short;
371 [attribute
] unsigned short UShort
;
372 [attribute
] long Long;
373 [attribute
] unsigned long ULong
;
374 [attribute
] hyper Hyper;
375 [attribute
] unsigned hyper UHyper
;
376 [attribute
] float Float;
377 [attribute
] double Double;
378 [attribute
] TestEnum
Enum;
379 [attribute
] string String;
380 [attribute
] byte Byte2
;
381 [attribute
] short Short2
;
382 [attribute
] com
::sun
::star
::uno
::XInterface
Interface;
384 [attribute
] sequence
< TestElement
> Sequence
;
385 [attribute
] TestData
Struct;
387 [attribute
] long RaiseAttr1
{
388 set raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
390 [attribute
, readonly] long RaiseAttr2
{
391 get raises
(com
::sun
::star
::lang
::IllegalArgumentException
);
394 TestPolyStruct
<boolean> transportPolyBoolean
(
395 [in] TestPolyStruct
<boolean> arg
);
396 void transportPolyHyper
([inout
] TestPolyStruct
<hyper> arg
);
397 void transportPolySequence
(
398 [in] TestPolyStruct
<sequence
<any
> > arg1
,
399 [out] TestPolyStruct
<sequence
<any
> > arg2
);
401 TestPolyStruct
<long> getNullPolyLong
();
402 TestPolyStruct
<string> getNullPolyString
();
403 TestPolyStruct
<type
> getNullPolyType
();
404 TestPolyStruct
<any
> getNullPolyAny
();
405 TestPolyStruct
<sequence
<boolean> > getNullPolySequence
();
406 TestPolyStruct
<TestEnum
> getNullPolyEnum
();
407 TestPolyStruct
<TestBadEnum
> getNullPolyBadEnum
();
408 TestPolyStruct
<TestStruct
> getNullPolyStruct
();
409 TestPolyStruct
<XBridgeTestBase
> getNullPolyInterface
();
412 * This method returns the parameter value.
413 * Method to extensively test anys.
415 any transportAny
( [in] any value
);
418 * methods to check sequence of calls. Call call() and callOneway
419 * in an arbitrary sequence. Increase the callId for every call.
420 * The testobject sets an error flag.
422 @see testSequencePassed
424 void call
( [in] long nCallId
, [in] long nWaitMUSEC
);
425 void callOneway
( [in] long nCallId
, [in] long nWaitMUSEC
);
426 boolean sequenceOfCallTestPassed
();
429 * methods to check, if threads thread identity is holded.
432 void startRecursiveCall
( [in] XRecursiveCall xCall
, [in] long nToCall
);
435 string testMulti
([in] XMulti multi
);
440 * Inheriting from monster; adds raiseException(), attribute raising RuntimeException.
442 interface XBridgeTest
: XBridgeTestBase
445 * the exception struct returned has to be filled with given arguments.
446 * return value is for dummy.
448 TestData raiseException
( [in] short ArgumentPosition
,
450 [in] com
::sun
::star
::uno
::XInterface Context
)
451 raises
( com
::sun
::star
::lang
::IllegalArgumentException
);
455 * Throws runtime exception.
456 * check remote bridges handle exceptions during oneway calls properly.
457 * Note that on client side the exception may fly or not. When it flies, it should
458 * have the proper message and context.
460 void raiseRuntimeExceptionOneway
( [in] string Message,
461 [in] com
::sun
::star
::uno
::XInterface Context
);
464 * raises runtime exception;
465 * the exception struct returned has to be filled with formerly set test data.
467 [attribute
] long RuntimeException
;
471 exception BadConstructorArguments
: com
::sun
::star
::uno
::Exception
{};
473 service Constructors
: com
::sun
::star
::uno
::XInterface
{
478 [in] unsigned short arg3
,
480 [in] unsigned long arg5
,
482 [in] unsigned hyper arg7
,
489 [in] sequence
< boolean > arg14
,
490 [in] sequence
< byte > arg15
,
491 [in] sequence
< short > arg16
,
492 [in] sequence
< unsigned short > arg17
,
493 [in] sequence
< long > arg18
,
494 [in] sequence
< unsigned long > arg19
,
495 [in] sequence
< hyper > arg20
,
496 [in] sequence
< unsigned hyper > arg21
,
497 [in] sequence
< float > arg22
,
498 [in] sequence
< double > arg23
,
499 [in] sequence
< char > arg24
,
500 [in] sequence
< string > arg25
,
501 [in] sequence
< type
> arg26
,
502 [in] sequence
< any
> arg27
,
503 [in] sequence
< sequence
< boolean > > arg28
,
504 [in] sequence
< sequence
< any
> > arg29
,
505 [in] sequence
< TestEnum
> arg30
,
506 [in] sequence
< TestStruct
> arg31
,
507 [in] sequence
< TestPolyStruct
< boolean > > arg32
,
508 [in] sequence
< TestPolyStruct
< any
> > arg33
,
509 [in] sequence
< com
::sun
::star
::uno
::XInterface
> arg34
,
511 [in] TestStruct arg36
,
512 [in] TestPolyStruct
< boolean > arg37
,
513 [in] TestPolyStruct
< any
> arg38
,
514 [in] com
::sun
::star
::uno
::XInterface arg39
)
515 raises
(BadConstructorArguments
);
517 create2
([in] any... args
) raises
(BadConstructorArguments
);
521 service Constructors2
: XMultiBase1
{
524 [in] TestPolyStruct
<type
> arg1
,
525 [in] TestPolyStruct
<any
> arg2
,
526 [in] TestPolyStruct
<boolean> arg3
,
527 [in] TestPolyStruct
<byte> arg4
,
528 [in] TestPolyStruct
<short> arg5
,
529 [in] TestPolyStruct
<long> arg6
,
530 [in] TestPolyStruct
<hyper> arg7
,
531 [in] TestPolyStruct
<char> arg8
,
532 [in] TestPolyStruct
<string> arg9
,
533 [in] TestPolyStruct
<float> arg10
,
534 [in] TestPolyStruct
<double> arg11
,
535 [in] TestPolyStruct
<com
::sun
::star
::uno
::XInterface
> arg12
,
536 [in] TestPolyStruct
<com
::sun
::star
::lang
::XComponent
> arg13
,
537 [in] TestPolyStruct
<TestEnum
> arg14
,
538 [in] TestPolyStruct
<TestPolyStruct2
<char,any
> > arg15
,
539 [in] TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<char,any
>,string> > arg16
,
540 [in] TestPolyStruct2
<string, TestPolyStruct2
<char, TestPolyStruct
<any
> > > arg17
,
541 [in] TestPolyStruct2
<TestPolyStruct2
<char,any
>, TestPolyStruct
<char> > arg18
,
542 [in] TestPolyStruct
<sequence
<type
> > arg19
,
543 [in] TestPolyStruct
<sequence
<any
> > arg20
,
544 [in] TestPolyStruct
<sequence
<boolean> > arg21
,
545 [in] TestPolyStruct
<sequence
<byte> > arg22
,
546 [in] TestPolyStruct
<sequence
<short> > arg23
,
547 [in] TestPolyStruct
<sequence
<long> > arg24
,
548 [in] TestPolyStruct
<sequence
<hyper> > arg25
,
549 [in] TestPolyStruct
<sequence
<char> > arg26
,
550 [in] TestPolyStruct
<sequence
<string> > arg27
,
551 [in] TestPolyStruct
<sequence
<float> > arg28
,
552 [in] TestPolyStruct
<sequence
<double> > arg29
,
553 [in] TestPolyStruct
<sequence
<com
::sun
::star
::uno
::XInterface
> > arg30
,
554 [in] TestPolyStruct
<sequence
<com
::sun
::star
::lang
::XComponent
> > arg31
,
555 [in] TestPolyStruct
<sequence
<TestEnum
> > arg32
,
556 [in] TestPolyStruct
<sequence
<TestPolyStruct2
<char, sequence
<any
> > > > arg33
,
557 [in] TestPolyStruct
<sequence
<TestPolyStruct2
<TestPolyStruct
<char>, sequence
<any
> > > > arg34
,
558 [in] TestPolyStruct
<sequence
<sequence
<long> > > arg35
,
559 [in] sequence
<TestPolyStruct
<long > > arg36
,
560 [in] sequence
<TestPolyStruct
<TestPolyStruct2
<char,any
> > > arg37
,
561 [in] sequence
<TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<char,any
>,string> > > arg38
,
562 [in] sequence
<TestPolyStruct2
<string, TestPolyStruct2
<char, TestPolyStruct
<any
> > > > arg39
,
563 [in] sequence
<TestPolyStruct2
<TestPolyStruct2
<char,any
>, TestPolyStruct
<char> > > arg40
,
564 [in] sequence
<sequence
<TestPolyStruct
< char > > > arg41
,
565 [in] sequence
<sequence
<TestPolyStruct
<TestPolyStruct2
<char,any
> > > >arg42
,
566 [in] sequence
<sequence
<TestPolyStruct
<TestPolyStruct2
<TestPolyStruct2
<char,any
>,string> > > > arg43
,
567 [in] sequence
<sequence
<TestPolyStruct2
<string, TestPolyStruct2
<char, TestPolyStruct
<any
> > > > > arg44
,
568 [in] sequence
<sequence
<TestPolyStruct2
<TestPolyStruct2
<char,any
>, TestPolyStruct
<char> > > > arg45
572 interface XCurrentContextChecker
{
574 [in] XCurrentContextChecker other
, [in] long setSteps
,
575 [in] long checkSteps
);
578 /** Extended tests with sequences.
580 interface XBridgeTest2
: XBridgeTest
582 sequence
< boolean > setSequenceBool
( [in] sequence
< boolean > aSeq
);
583 sequence
< char > setSequenceChar
( [in] sequence
< char > aSeq
);
584 sequence
< byte> setSequenceByte
( [in] sequence
< byte > aSeq
);
585 sequence
< short> setSequenceShort
( [in] sequence
< short > aSeq
);
586 sequence
< unsigned short > setSequenceUShort
( [in] sequence
< unsigned short > aSeq
);
587 sequence
< long > setSequenceLong
( [in] sequence
< long > aSeq
);
588 sequence
< unsigned long > setSequenceULong
( [in] sequence
< unsigned long > aSeq
);
589 sequence
< hyper > setSequenceHyper
( [in] sequence
< hyper > aSeq
);
590 sequence
< unsigned hyper > setSequenceUHyper
( [in] sequence
< unsigned hyper > aSeq
);
591 sequence
< float > setSequenceFloat
( [in] sequence
< float > aSeq
);
592 sequence
< double > setSequenceDouble
( [in] sequence
< double > aSeq
);
593 sequence
< TestEnum
> setSequenceEnum
( [in] sequence
< TestEnum
> aSeq
);
594 sequence
< string > setSequenceString
( [in] sequence
< string > aString
);
595 sequence
< com
::sun
::star
::uno
::XInterface
> setSequenceXInterface
(
596 [in] sequence
< com
::sun
::star
::uno
::XInterface
> aSeq
);
597 sequence
< any
> setSequenceAny
( [in] sequence
< any
> aSeq
);
598 sequence
< TestElement
> setSequenceStruct
( [in] sequence
< TestElement
> aSeq
);
600 sequence
< sequence
< long > > setDim2
( [in] sequence
< sequence
< long > > aSeq
);
601 sequence
< sequence
< sequence
< long > > > setDim3
(
602 [in] sequence
< sequence
< sequence
< long > > > aSeq
);
604 void setSequencesInOut
( [inout
] sequence
< boolean > aSeqBoolean
,
605 [inout
] sequence
< char > aSeqChar
,
606 [inout
] sequence
< byte > aSeqByte
,
607 [inout
] sequence
< short > aSeqShort
,
608 [inout
] sequence
< unsigned short> aSeqUShort
,
609 [inout
] sequence
< long > aSeqLong
,
610 [inout
] sequence
< unsigned long > aSeqULong
,
611 [inout
] sequence
< hyper > aSeqHyper
,
612 [inout
] sequence
< unsigned hyper > aSeqUHyper
,
613 [inout
] sequence
< float > aSeqFloat
,
614 [inout
] sequence
< double > aSeqDouble
,
615 [inout
] sequence
< TestEnum
> aSeqEnum
,
616 [inout
] sequence
< string > aSeqString
,
617 [inout
] sequence
< com
::sun
::star
::uno
::XInterface
> aSeqXInterface
,
618 [inout
] sequence
< any
> aSeqAny
,
619 [inout
] sequence
< sequence
< long > > aSeqDim2
,
620 [inout
] sequence
< sequence
< sequence
< long > > > aSeqDim3
);
622 void setSequencesOut
( [out] sequence
< boolean > aSeqBoolean
,
623 [out] sequence
< char > aSeqChar
,
624 [out] sequence
< byte > aSeqByte
,
625 [out] sequence
< short > aSeqShort
,
626 [out] sequence
< unsigned short> aSeqUShort
,
627 [out] sequence
< long > aSeqLong
,
628 [out] sequence
< unsigned long > aSeqULong
,
629 [out] sequence
< hyper > aSeqHyper
,
630 [out] sequence
< unsigned hyper > aSeqUHyper
,
631 [out] sequence
< float > aSeqFloat
,
632 [out] sequence
< double > aSeqDouble
,
633 [out] sequence
< TestEnum
> aSeqEnum
,
634 [out] sequence
< string > aSeqString
,
635 [out] sequence
< com
::sun
::star
::uno
::XInterface
> aSeqXInterface
,
636 [out] sequence
< any
> aSeqAny
,
637 [out] sequence
< sequence
< long > > aSeqDim2
,
638 [out] sequence
< sequence
< sequence
< long > > > aSeqDim3
);
640 void testConstructorsService
(
641 [in] com
::sun
::star
::uno
::XComponentContext context
)
642 raises
(BadConstructorArguments
);
644 XCurrentContextChecker getCurrentContextChecker
();
649 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */