xref: /AOO41X/main/testtools/source/bridgetest/cli/cli_cs_testobj.cs (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir using System;
29*cdf0e10cSrcweir using System.Diagnostics;
30*cdf0e10cSrcweir using System.Threading;
31*cdf0e10cSrcweir using System.Runtime.CompilerServices;
32*cdf0e10cSrcweir using uno;
33*cdf0e10cSrcweir using uno.util;
34*cdf0e10cSrcweir using unoidl.com.sun.star.uno;
35*cdf0e10cSrcweir using unoidl.com.sun.star.lang;
36*cdf0e10cSrcweir using unoidl.test.testtools.bridgetest;
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir namespace cs_testobj
39*cdf0e10cSrcweir {
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir class CheckFailed: System.Exception {
42*cdf0e10cSrcweir     public CheckFailed(string message): base(message) {}
43*cdf0e10cSrcweir }
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir public class BridgeTestObject : WeakBase, XRecursiveCall, XBridgeTest2
46*cdf0e10cSrcweir {
47*cdf0e10cSrcweir     private XComponentContext m_xContext;
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir     public BridgeTestObject( XComponentContext xContext )
50*cdf0e10cSrcweir     {
51*cdf0e10cSrcweir         m_xContext = xContext;
52*cdf0e10cSrcweir     }
53*cdf0e10cSrcweir     public BridgeTestObject()
54*cdf0e10cSrcweir     {
55*cdf0e10cSrcweir     }
56*cdf0e10cSrcweir 
57*cdf0e10cSrcweir     private bool  _bool;
58*cdf0e10cSrcweir     private char     _char;
59*cdf0e10cSrcweir     private byte     _byte;
60*cdf0e10cSrcweir     private short    _short;
61*cdf0e10cSrcweir     private ushort    _ushort;
62*cdf0e10cSrcweir     private int      _long;
63*cdf0e10cSrcweir     private uint      _ulong;
64*cdf0e10cSrcweir     private long     _hyper;
65*cdf0e10cSrcweir     private ulong     _uhyper;
66*cdf0e10cSrcweir     private float    _float;
67*cdf0e10cSrcweir     private double   _double;
68*cdf0e10cSrcweir     private String   _string;
69*cdf0e10cSrcweir     private Object   _xInterface;
70*cdf0e10cSrcweir     private Any   _any;
71*cdf0e10cSrcweir     private TestEnum _testEnum = TestEnum.TEST;
72*cdf0e10cSrcweir     private TestElement[] _testElements = new TestElement[0];
73*cdf0e10cSrcweir     private TestDataElements _testDataElements = new TestDataElements();
74*cdf0e10cSrcweir     private int     _nLastCallId = 0;
75*cdf0e10cSrcweir     private bool _bFirstCall = true;
76*cdf0e10cSrcweir     private bool _bSequenceOfCallTestPassed = true;
77*cdf0e10cSrcweir 
78*cdf0e10cSrcweir     private bool[] _arBool;
79*cdf0e10cSrcweir     private char[] _arChar;
80*cdf0e10cSrcweir     private byte[] _arByte;
81*cdf0e10cSrcweir     private short[]_arShort;
82*cdf0e10cSrcweir     private int[] _arLong;
83*cdf0e10cSrcweir     private long[] _arHyper;
84*cdf0e10cSrcweir     private UInt16[] _arUShort;
85*cdf0e10cSrcweir     private UInt32[] _arULong;
86*cdf0e10cSrcweir     private UInt64[] _arUHyper;
87*cdf0e10cSrcweir     private string[] _arString;
88*cdf0e10cSrcweir     private float[] _arFloat;
89*cdf0e10cSrcweir     private double[] _arDouble;
90*cdf0e10cSrcweir     private TestEnum[] _arEnum;
91*cdf0e10cSrcweir     private Object[] _arObject;
92*cdf0e10cSrcweir     private int[][] _arLong2;
93*cdf0e10cSrcweir     private int[][][] _arLong3;
94*cdf0e10cSrcweir     private Any[] _arAny;
95*cdf0e10cSrcweir 
96*cdf0e10cSrcweir //    private int _raiseAttr1;
97*cdf0e10cSrcweir 
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir     public void setValues(
100*cdf0e10cSrcweir         bool          bBool,
101*cdf0e10cSrcweir         char             cChar,
102*cdf0e10cSrcweir         byte             nByte,
103*cdf0e10cSrcweir         short            nShort,
104*cdf0e10cSrcweir         ushort            nUShort,
105*cdf0e10cSrcweir         int              nLong,
106*cdf0e10cSrcweir         uint              nULong,
107*cdf0e10cSrcweir         long             nHyper,
108*cdf0e10cSrcweir         ulong             nUHyper,
109*cdf0e10cSrcweir         float            fFloat,
110*cdf0e10cSrcweir         double           fDouble,
111*cdf0e10cSrcweir         TestEnum         testEnum,
112*cdf0e10cSrcweir         String           str,
113*cdf0e10cSrcweir         Object           xInterface,
114*cdf0e10cSrcweir         Any              any,
115*cdf0e10cSrcweir         TestElement []      testElements,
116*cdf0e10cSrcweir         TestDataElements testDataElements )
117*cdf0e10cSrcweir     {
118*cdf0e10cSrcweir          Debug.WriteLine( "##### " + GetType().FullName + ".setValues:" + any );
119*cdf0e10cSrcweir 
120*cdf0e10cSrcweir         _bool             = bBool;
121*cdf0e10cSrcweir         _char             = cChar;
122*cdf0e10cSrcweir         _byte             = nByte;
123*cdf0e10cSrcweir         _short            = nShort;
124*cdf0e10cSrcweir         _ushort           = nUShort;
125*cdf0e10cSrcweir         _long             = nLong;
126*cdf0e10cSrcweir         _ulong            = nULong;
127*cdf0e10cSrcweir         _hyper            = nHyper;
128*cdf0e10cSrcweir         _uhyper           = nUHyper;
129*cdf0e10cSrcweir         _float            = fFloat;
130*cdf0e10cSrcweir         _double           = fDouble;
131*cdf0e10cSrcweir         _testEnum         = testEnum;
132*cdf0e10cSrcweir         _string           = str;
133*cdf0e10cSrcweir         _xInterface       = xInterface;
134*cdf0e10cSrcweir         _any              = any;
135*cdf0e10cSrcweir         _testElements     = testElements;
136*cdf0e10cSrcweir         _testDataElements = testDataElements;
137*cdf0e10cSrcweir     }
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir     public TestDataElements setValues2(
140*cdf0e10cSrcweir         /*INOUT*/ref bool          io_bool,
141*cdf0e10cSrcweir         /*INOUT*/ref char             io_char,
142*cdf0e10cSrcweir         /*INOUT*/ref byte             io_byte,
143*cdf0e10cSrcweir         /*INOUT*/ref short            io_short,
144*cdf0e10cSrcweir         /*INOUT*/ref ushort            io_ushort,
145*cdf0e10cSrcweir         /*INOUT*/ref int              io_long,
146*cdf0e10cSrcweir         /*INOUT*/ref uint              io_ulong,
147*cdf0e10cSrcweir         /*INOUT*/ref long             io_hyper,
148*cdf0e10cSrcweir         /*INOUT*/ref ulong             io_uhyper,
149*cdf0e10cSrcweir         /*INOUT*/ref float            io_float,
150*cdf0e10cSrcweir         /*INOUT*/ref double           io_double,
151*cdf0e10cSrcweir         /*INOUT*/ref TestEnum         io_testEnum,
152*cdf0e10cSrcweir         /*INOUT*/ref String           io_string,
153*cdf0e10cSrcweir         /*INOUT*/ref Object           io_xInterface,
154*cdf0e10cSrcweir         /*INOUT*/ref Any           io_any,
155*cdf0e10cSrcweir         /*INOUT*/ref TestElement[]    io_testElements,
156*cdf0e10cSrcweir         /*INOUT*/ref TestDataElements io_testDataElements )
157*cdf0e10cSrcweir     {
158*cdf0e10cSrcweir         Debug.WriteLine( "##### " + GetType().FullName + ".setValues2:" + io_any );
159*cdf0e10cSrcweir 
160*cdf0e10cSrcweir         _bool             = io_bool;
161*cdf0e10cSrcweir         _char             = io_char;
162*cdf0e10cSrcweir         _byte             = io_byte;
163*cdf0e10cSrcweir         _short            = io_short;
164*cdf0e10cSrcweir         _ushort           = io_ushort;
165*cdf0e10cSrcweir         _long             = io_long;
166*cdf0e10cSrcweir         _ulong            = io_ulong;
167*cdf0e10cSrcweir         _hyper            = io_hyper;
168*cdf0e10cSrcweir         _uhyper           = io_uhyper;
169*cdf0e10cSrcweir         _float            = io_float;
170*cdf0e10cSrcweir         _double           = io_double;
171*cdf0e10cSrcweir         _testEnum         = io_testEnum;
172*cdf0e10cSrcweir         _string           = io_string;
173*cdf0e10cSrcweir         _xInterface       = io_xInterface;
174*cdf0e10cSrcweir         _any              = io_any;
175*cdf0e10cSrcweir         _testElements     = (TestElement[]) io_testElements.Clone();
176*cdf0e10cSrcweir         _testDataElements = io_testDataElements;
177*cdf0e10cSrcweir 
178*cdf0e10cSrcweir         TestElement temp = io_testElements[ 0 ];
179*cdf0e10cSrcweir         io_testElements[ 0 ] = io_testElements[ 1 ];
180*cdf0e10cSrcweir         io_testElements[ 1 ] = temp;
181*cdf0e10cSrcweir 
182*cdf0e10cSrcweir         return _testDataElements;
183*cdf0e10cSrcweir     }
184*cdf0e10cSrcweir 
185*cdf0e10cSrcweir     public TestDataElements getValues(
186*cdf0e10cSrcweir         /*OUT*/out bool          o_bool,
187*cdf0e10cSrcweir         /*OUT*/out char             o_char,
188*cdf0e10cSrcweir         /*OUT*/out byte             o_byte,
189*cdf0e10cSrcweir         /*OUT*/out short            o_short,
190*cdf0e10cSrcweir         /*OUT*/out ushort            o_ushort,
191*cdf0e10cSrcweir         /*OUT*/out int              o_long,
192*cdf0e10cSrcweir         /*OUT*/out uint              o_ulong,
193*cdf0e10cSrcweir         /*OUT*/out long             o_hyper,
194*cdf0e10cSrcweir         /*OUT*/out ulong             o_uhyper,
195*cdf0e10cSrcweir         /*OUT*/out float            o_float,
196*cdf0e10cSrcweir         /*OUT*/out double           o_double,
197*cdf0e10cSrcweir         /*OUT*/out TestEnum         o_testEnum,
198*cdf0e10cSrcweir         /*OUT*/out String           o_string,
199*cdf0e10cSrcweir         /*OUT*/out Object           o_xInterface,
200*cdf0e10cSrcweir         /*OUT*/out Any           o_any,
201*cdf0e10cSrcweir         /*OUT*/out TestElement[]    o_testElements,
202*cdf0e10cSrcweir         /*OUT*/out TestDataElements o_testDataElements )
203*cdf0e10cSrcweir     {
204*cdf0e10cSrcweir         Debug.WriteLine( "##### " + GetType().FullName + ".getValues" );
205*cdf0e10cSrcweir 
206*cdf0e10cSrcweir         o_bool             = _bool;
207*cdf0e10cSrcweir         o_char             = _char;
208*cdf0e10cSrcweir         o_byte             = _byte;
209*cdf0e10cSrcweir         o_short            = _short;
210*cdf0e10cSrcweir         o_ushort           = _ushort;
211*cdf0e10cSrcweir         o_long             = _long;
212*cdf0e10cSrcweir         o_ulong            = _ulong;
213*cdf0e10cSrcweir         o_hyper            = _hyper;
214*cdf0e10cSrcweir         o_uhyper           = _uhyper;
215*cdf0e10cSrcweir         o_float            = _float;
216*cdf0e10cSrcweir         o_double           = _double;
217*cdf0e10cSrcweir         o_testEnum         = _testEnum;
218*cdf0e10cSrcweir         o_string           = _string;
219*cdf0e10cSrcweir         o_xInterface       = _xInterface;
220*cdf0e10cSrcweir         o_any              = _any;
221*cdf0e10cSrcweir         o_testElements     = _testElements;
222*cdf0e10cSrcweir         o_testDataElements = _testDataElements;
223*cdf0e10cSrcweir 
224*cdf0e10cSrcweir         return _testDataElements;
225*cdf0e10cSrcweir     }
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir     public SmallStruct echoSmallStruct(/*[in]*/SmallStruct arg)
228*cdf0e10cSrcweir     {
229*cdf0e10cSrcweir         return arg;
230*cdf0e10cSrcweir     }
231*cdf0e10cSrcweir 
232*cdf0e10cSrcweir     public MediumStruct echoMediumStruct(/*[in]*/MediumStruct arg)
233*cdf0e10cSrcweir     {
234*cdf0e10cSrcweir         return arg;
235*cdf0e10cSrcweir     }
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir     public BigStruct echoBigStruct(/*[in]*/BigStruct arg)
238*cdf0e10cSrcweir     {
239*cdf0e10cSrcweir         return arg;
240*cdf0e10cSrcweir     }
241*cdf0e10cSrcweir 
242*cdf0e10cSrcweir     public AllFloats echoAllFloats(/*[in]*/AllFloats arg)
243*cdf0e10cSrcweir     {
244*cdf0e10cSrcweir         return arg;
245*cdf0e10cSrcweir     }
246*cdf0e10cSrcweir 
247*cdf0e10cSrcweir     public int testPPCAlignment( long l1, long l2, int i1, long l3, int i2 )
248*cdf0e10cSrcweir     {
249*cdf0e10cSrcweir         return i2;
250*cdf0e10cSrcweir     }
251*cdf0e10cSrcweir 
252*cdf0e10cSrcweir     // Attributes
253*cdf0e10cSrcweir     public bool Bool
254*cdf0e10cSrcweir     {
255*cdf0e10cSrcweir         get { return _bool; }
256*cdf0e10cSrcweir         set { _bool = value; }
257*cdf0e10cSrcweir     }
258*cdf0e10cSrcweir     public byte Byte
259*cdf0e10cSrcweir     {
260*cdf0e10cSrcweir         get { return _byte; }
261*cdf0e10cSrcweir         set { _byte = value; }
262*cdf0e10cSrcweir     }
263*cdf0e10cSrcweir     public char Char
264*cdf0e10cSrcweir     {
265*cdf0e10cSrcweir         get { return _char; }
266*cdf0e10cSrcweir         set { _char = value; }
267*cdf0e10cSrcweir     }
268*cdf0e10cSrcweir     public short Short
269*cdf0e10cSrcweir     {
270*cdf0e10cSrcweir         get { return _short; }
271*cdf0e10cSrcweir         set { _short = value; }
272*cdf0e10cSrcweir     }
273*cdf0e10cSrcweir     public ushort UShort
274*cdf0e10cSrcweir     {
275*cdf0e10cSrcweir         get { return _ushort; }
276*cdf0e10cSrcweir         set { _ushort = value; }
277*cdf0e10cSrcweir     }
278*cdf0e10cSrcweir     public int Long
279*cdf0e10cSrcweir     {
280*cdf0e10cSrcweir         get { return _long; }
281*cdf0e10cSrcweir         set { _long = value; }
282*cdf0e10cSrcweir     }
283*cdf0e10cSrcweir     public uint ULong
284*cdf0e10cSrcweir     {
285*cdf0e10cSrcweir         get { return _ulong; }
286*cdf0e10cSrcweir         set { _ulong = value; }
287*cdf0e10cSrcweir     }
288*cdf0e10cSrcweir     public long Hyper
289*cdf0e10cSrcweir     {
290*cdf0e10cSrcweir         get { return _hyper; }
291*cdf0e10cSrcweir         set { _hyper = value; }
292*cdf0e10cSrcweir     }
293*cdf0e10cSrcweir     public ulong UHyper
294*cdf0e10cSrcweir     {
295*cdf0e10cSrcweir         get { return _uhyper; }
296*cdf0e10cSrcweir         set { _uhyper = value; }
297*cdf0e10cSrcweir     }
298*cdf0e10cSrcweir     public float Float
299*cdf0e10cSrcweir     {
300*cdf0e10cSrcweir         get { return _float; }
301*cdf0e10cSrcweir         set { _float = value; }
302*cdf0e10cSrcweir     }
303*cdf0e10cSrcweir     public double Double
304*cdf0e10cSrcweir     {
305*cdf0e10cSrcweir         get { return _double; }
306*cdf0e10cSrcweir         set { _double = value; }
307*cdf0e10cSrcweir     }
308*cdf0e10cSrcweir     public TestEnum Enum
309*cdf0e10cSrcweir     {
310*cdf0e10cSrcweir         get { return _testEnum; }
311*cdf0e10cSrcweir         set { _testEnum = value; }
312*cdf0e10cSrcweir     }
313*cdf0e10cSrcweir     public String String
314*cdf0e10cSrcweir     {
315*cdf0e10cSrcweir         get { return _string; }
316*cdf0e10cSrcweir         set { _string = value; }
317*cdf0e10cSrcweir     }
318*cdf0e10cSrcweir     public Object Interface
319*cdf0e10cSrcweir     {
320*cdf0e10cSrcweir         get { return _xInterface; }
321*cdf0e10cSrcweir         set { _xInterface = value; }
322*cdf0e10cSrcweir     }
323*cdf0e10cSrcweir     public uno.Any Any
324*cdf0e10cSrcweir     {
325*cdf0e10cSrcweir         get {
326*cdf0e10cSrcweir 
327*cdf0e10cSrcweir             Debug.WriteLine( "##### " + GetType().FullName + ".Any" );
328*cdf0e10cSrcweir             return _any;
329*cdf0e10cSrcweir         }
330*cdf0e10cSrcweir         set {
331*cdf0e10cSrcweir             Debug.WriteLine( "##### " + GetType().FullName + ".Any:" + value );
332*cdf0e10cSrcweir             _any = value;
333*cdf0e10cSrcweir         }
334*cdf0e10cSrcweir     }
335*cdf0e10cSrcweir     public TestElement [] Sequence
336*cdf0e10cSrcweir     {
337*cdf0e10cSrcweir         get { return _testElements; }
338*cdf0e10cSrcweir         set { _testElements = value; }
339*cdf0e10cSrcweir     }
340*cdf0e10cSrcweir     public TestDataElements Struct
341*cdf0e10cSrcweir     {
342*cdf0e10cSrcweir         get { return _testDataElements; }
343*cdf0e10cSrcweir         set { _testDataElements = value; }
344*cdf0e10cSrcweir     }
345*cdf0e10cSrcweir     public Any transportAny(Any value)
346*cdf0e10cSrcweir     {
347*cdf0e10cSrcweir         return value;
348*cdf0e10cSrcweir     }
349*cdf0e10cSrcweir     public void call(int nCallId , int nWaitMUSEC)
350*cdf0e10cSrcweir     {
351*cdf0e10cSrcweir         Thread.Sleep(nWaitMUSEC / 10000);
352*cdf0e10cSrcweir 
353*cdf0e10cSrcweir         if(_bFirstCall)
354*cdf0e10cSrcweir             _bFirstCall = false;
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir         else
357*cdf0e10cSrcweir             _bSequenceOfCallTestPassed = _bSequenceOfCallTestPassed && (nCallId > _nLastCallId);
358*cdf0e10cSrcweir 
359*cdf0e10cSrcweir         _nLastCallId = nCallId;
360*cdf0e10cSrcweir     }
361*cdf0e10cSrcweir     public void callOneway( int nCallId , int nWaitMUSEC )
362*cdf0e10cSrcweir     {
363*cdf0e10cSrcweir         Thread.Sleep(nWaitMUSEC / 10000);
364*cdf0e10cSrcweir 
365*cdf0e10cSrcweir         _bSequenceOfCallTestPassed = _bSequenceOfCallTestPassed && (nCallId > _nLastCallId);
366*cdf0e10cSrcweir         _nLastCallId = nCallId;
367*cdf0e10cSrcweir     }
368*cdf0e10cSrcweir     public bool sequenceOfCallTestPassed()
369*cdf0e10cSrcweir     {
370*cdf0e10cSrcweir         return _bSequenceOfCallTestPassed;
371*cdf0e10cSrcweir     }
372*cdf0e10cSrcweir     [MethodImpl( MethodImplOptions.Synchronized )]
373*cdf0e10cSrcweir     public void callRecursivly( XRecursiveCall xCall,   int nToCall )
374*cdf0e10cSrcweir     {
375*cdf0e10cSrcweir         lock (this)
376*cdf0e10cSrcweir         {
377*cdf0e10cSrcweir             if(nToCall != 0)
378*cdf0e10cSrcweir             {
379*cdf0e10cSrcweir                 nToCall --;
380*cdf0e10cSrcweir                 xCall.callRecursivly(this , nToCall);
381*cdf0e10cSrcweir             }
382*cdf0e10cSrcweir         }
383*cdf0e10cSrcweir     }
384*cdf0e10cSrcweir     [MethodImpl( MethodImplOptions.Synchronized )]
385*cdf0e10cSrcweir     public void startRecursiveCall( XRecursiveCall xCall, int nToCall )
386*cdf0e10cSrcweir     {
387*cdf0e10cSrcweir         lock (this)
388*cdf0e10cSrcweir         {
389*cdf0e10cSrcweir             if(nToCall != 0)
390*cdf0e10cSrcweir             {
391*cdf0e10cSrcweir                 nToCall --;
392*cdf0e10cSrcweir                 xCall.callRecursivly( this , nToCall );
393*cdf0e10cSrcweir             }
394*cdf0e10cSrcweir         }
395*cdf0e10cSrcweir     }
396*cdf0e10cSrcweir 
397*cdf0e10cSrcweir     // XBridgeTest
398*cdf0e10cSrcweir     public TestDataElements raiseException(
399*cdf0e10cSrcweir         short nArgumentPos, String rMsg, Object xContext )
400*cdf0e10cSrcweir     {
401*cdf0e10cSrcweir         throw new IllegalArgumentException(rMsg, xContext, nArgumentPos);
402*cdf0e10cSrcweir     }
403*cdf0e10cSrcweir     public void raiseRuntimeExceptionOneway( String rMsg, Object xContext )
404*cdf0e10cSrcweir     {
405*cdf0e10cSrcweir         throw new RuntimeException(rMsg, xContext);
406*cdf0e10cSrcweir     }
407*cdf0e10cSrcweir 
408*cdf0e10cSrcweir     private void dothrow( System.Exception e )
409*cdf0e10cSrcweir     {
410*cdf0e10cSrcweir         throw e;
411*cdf0e10cSrcweir     }
412*cdf0e10cSrcweir     public int RuntimeException
413*cdf0e10cSrcweir     {
414*cdf0e10cSrcweir         get {
415*cdf0e10cSrcweir             try
416*cdf0e10cSrcweir             {
417*cdf0e10cSrcweir                 dothrow( new RuntimeException(_string, _xInterface) );
418*cdf0e10cSrcweir                 return 0; // dummy
419*cdf0e10cSrcweir             }
420*cdf0e10cSrcweir             catch (System.Exception exc)
421*cdf0e10cSrcweir             {
422*cdf0e10cSrcweir                 throw exc;
423*cdf0e10cSrcweir             }
424*cdf0e10cSrcweir         }
425*cdf0e10cSrcweir         set { throw new RuntimeException(_string, _xInterface); }
426*cdf0e10cSrcweir     }
427*cdf0e10cSrcweir 
428*cdf0e10cSrcweir     // XBridgeTest2
429*cdf0e10cSrcweir     public int[][] setDim2(int[][] val)
430*cdf0e10cSrcweir     {
431*cdf0e10cSrcweir         _arLong2 = val;
432*cdf0e10cSrcweir         return val;
433*cdf0e10cSrcweir     }
434*cdf0e10cSrcweir 
435*cdf0e10cSrcweir     public int[][][] setDim3(int[][][] val)
436*cdf0e10cSrcweir     {
437*cdf0e10cSrcweir         _arLong3 = val;
438*cdf0e10cSrcweir         return val;
439*cdf0e10cSrcweir     }
440*cdf0e10cSrcweir 
441*cdf0e10cSrcweir     public Any[] setSequenceAny(Any[] val)
442*cdf0e10cSrcweir     {
443*cdf0e10cSrcweir         _arAny = val;
444*cdf0e10cSrcweir         return val;
445*cdf0e10cSrcweir     }
446*cdf0e10cSrcweir 
447*cdf0e10cSrcweir     public bool[] setSequenceBool(bool[] val)
448*cdf0e10cSrcweir     {
449*cdf0e10cSrcweir         _arBool = val;
450*cdf0e10cSrcweir         return val;
451*cdf0e10cSrcweir     }
452*cdf0e10cSrcweir 
453*cdf0e10cSrcweir     public byte[] setSequenceByte(byte[] val)
454*cdf0e10cSrcweir     {
455*cdf0e10cSrcweir         _arByte = val;
456*cdf0e10cSrcweir         return val;
457*cdf0e10cSrcweir     }
458*cdf0e10cSrcweir 
459*cdf0e10cSrcweir     public char[] setSequenceChar(char[] val)
460*cdf0e10cSrcweir     {
461*cdf0e10cSrcweir         _arChar = val;
462*cdf0e10cSrcweir         return val;
463*cdf0e10cSrcweir     }
464*cdf0e10cSrcweir 
465*cdf0e10cSrcweir     public short[] setSequenceShort(short[] val)
466*cdf0e10cSrcweir     {
467*cdf0e10cSrcweir         _arShort = val;
468*cdf0e10cSrcweir         return val;
469*cdf0e10cSrcweir     }
470*cdf0e10cSrcweir 
471*cdf0e10cSrcweir     public int[] setSequenceLong(int[] val)
472*cdf0e10cSrcweir     {
473*cdf0e10cSrcweir         _arLong = val;
474*cdf0e10cSrcweir         return val;
475*cdf0e10cSrcweir     }
476*cdf0e10cSrcweir 
477*cdf0e10cSrcweir     public long[] setSequenceHyper(long[] val)
478*cdf0e10cSrcweir     {
479*cdf0e10cSrcweir         _arHyper = val;
480*cdf0e10cSrcweir         return val;
481*cdf0e10cSrcweir     }
482*cdf0e10cSrcweir 
483*cdf0e10cSrcweir     public float[] setSequenceFloat(float[] val)
484*cdf0e10cSrcweir     {
485*cdf0e10cSrcweir         _arFloat = val;
486*cdf0e10cSrcweir         return val;
487*cdf0e10cSrcweir     }
488*cdf0e10cSrcweir 
489*cdf0e10cSrcweir     public double[] setSequenceDouble(double[] val)
490*cdf0e10cSrcweir     {
491*cdf0e10cSrcweir         _arDouble = val;
492*cdf0e10cSrcweir         return val;
493*cdf0e10cSrcweir     }
494*cdf0e10cSrcweir 
495*cdf0e10cSrcweir     public TestEnum[] setSequenceEnum(TestEnum[] val)
496*cdf0e10cSrcweir     {
497*cdf0e10cSrcweir         _arEnum = val;
498*cdf0e10cSrcweir         return val;
499*cdf0e10cSrcweir     }
500*cdf0e10cSrcweir 
501*cdf0e10cSrcweir     public UInt16[] setSequenceUShort(UInt16[] val)
502*cdf0e10cSrcweir     {
503*cdf0e10cSrcweir         _arUShort = val;
504*cdf0e10cSrcweir         return val;
505*cdf0e10cSrcweir     }
506*cdf0e10cSrcweir 
507*cdf0e10cSrcweir     public UInt32[] setSequenceULong(UInt32[] val)
508*cdf0e10cSrcweir     {
509*cdf0e10cSrcweir         _arULong = val;
510*cdf0e10cSrcweir         return  val;
511*cdf0e10cSrcweir     }
512*cdf0e10cSrcweir 
513*cdf0e10cSrcweir     public UInt64[] setSequenceUHyper(UInt64[] val)
514*cdf0e10cSrcweir     {
515*cdf0e10cSrcweir         _arUHyper = val;
516*cdf0e10cSrcweir         return val;
517*cdf0e10cSrcweir     }
518*cdf0e10cSrcweir 
519*cdf0e10cSrcweir     public Object[] setSequenceXInterface(Object[] val)
520*cdf0e10cSrcweir     {
521*cdf0e10cSrcweir         _arObject = val;
522*cdf0e10cSrcweir         return val;
523*cdf0e10cSrcweir     }
524*cdf0e10cSrcweir 
525*cdf0e10cSrcweir     public string[] setSequenceString(string[] val)
526*cdf0e10cSrcweir     {
527*cdf0e10cSrcweir         _arString = val;
528*cdf0e10cSrcweir         return val;
529*cdf0e10cSrcweir     }
530*cdf0e10cSrcweir 
531*cdf0e10cSrcweir     public TestElement[] setSequenceStruct(TestElement[] val)
532*cdf0e10cSrcweir     {
533*cdf0e10cSrcweir         _testElements = val;
534*cdf0e10cSrcweir         return val;
535*cdf0e10cSrcweir     }
536*cdf0e10cSrcweir 
537*cdf0e10cSrcweir     public void setSequencesInOut(ref bool[] aSeqBoolean,
538*cdf0e10cSrcweir                                ref char[] aSeqChar,
539*cdf0e10cSrcweir                                ref byte[] aSeqByte,
540*cdf0e10cSrcweir                                ref short[] aSeqShort,
541*cdf0e10cSrcweir                                ref UInt16[] aSeqUShort,
542*cdf0e10cSrcweir                                ref int[] aSeqLong,
543*cdf0e10cSrcweir                                ref UInt32[] aSeqULong,
544*cdf0e10cSrcweir                                ref long[] aSeqHyper,
545*cdf0e10cSrcweir                                ref UInt64[] aSeqUHyper,
546*cdf0e10cSrcweir                                ref float[] aSeqFloat,
547*cdf0e10cSrcweir                                ref double[] aSeqDouble,
548*cdf0e10cSrcweir                                ref TestEnum[] aSeqTestEnum,
549*cdf0e10cSrcweir                                ref string[] aSeqString,
550*cdf0e10cSrcweir                                ref object[] aSeqXInterface,
551*cdf0e10cSrcweir                                ref Any[] aSeqAny,
552*cdf0e10cSrcweir                                ref int[][] aSeqDim2,
553*cdf0e10cSrcweir                                ref int[][][] aSeqDim3)
554*cdf0e10cSrcweir     {
555*cdf0e10cSrcweir         _arBool = aSeqBoolean;
556*cdf0e10cSrcweir         _arChar = aSeqChar;
557*cdf0e10cSrcweir         _arByte = aSeqByte;
558*cdf0e10cSrcweir         _arShort = aSeqShort;
559*cdf0e10cSrcweir         _arUShort = aSeqUShort;
560*cdf0e10cSrcweir         _arLong = aSeqLong;
561*cdf0e10cSrcweir         _arULong = aSeqULong;
562*cdf0e10cSrcweir         _arHyper  = aSeqHyper;
563*cdf0e10cSrcweir         _arUHyper = aSeqUHyper;
564*cdf0e10cSrcweir         _arFloat = aSeqFloat;
565*cdf0e10cSrcweir         _arDouble = aSeqDouble;
566*cdf0e10cSrcweir         _arEnum = aSeqTestEnum;
567*cdf0e10cSrcweir         _arString = aSeqString;
568*cdf0e10cSrcweir         _arObject = aSeqXInterface;
569*cdf0e10cSrcweir         _arAny = aSeqAny;
570*cdf0e10cSrcweir         _arLong2 = aSeqDim2;
571*cdf0e10cSrcweir         _arLong3 = aSeqDim3;
572*cdf0e10cSrcweir     }
573*cdf0e10cSrcweir 
574*cdf0e10cSrcweir     public void setSequencesOut(out bool[] aSeqBoolean,
575*cdf0e10cSrcweir                                out char[] aSeqChar,
576*cdf0e10cSrcweir                                out byte[] aSeqByte,
577*cdf0e10cSrcweir                                out short[] aSeqShort,
578*cdf0e10cSrcweir                                out UInt16[] aSeqUShort,
579*cdf0e10cSrcweir                                out int[] aSeqLong,
580*cdf0e10cSrcweir                                out UInt32[] aSeqULong,
581*cdf0e10cSrcweir                                out long[] aSeqHyper,
582*cdf0e10cSrcweir                                out UInt64[] aSeqUHyper,
583*cdf0e10cSrcweir                                out float[] aSeqFloat,
584*cdf0e10cSrcweir                                out double[] aSeqDouble,
585*cdf0e10cSrcweir                                out TestEnum[] aSeqTestEnum,
586*cdf0e10cSrcweir                                out string[] aSeqString,
587*cdf0e10cSrcweir                                out object[] aSeqXInterface,
588*cdf0e10cSrcweir                                out Any[] aSeqAny,
589*cdf0e10cSrcweir                                out int[][] aSeqDim2,
590*cdf0e10cSrcweir                                out int[][][] aSeqDim3)
591*cdf0e10cSrcweir     {
592*cdf0e10cSrcweir         aSeqBoolean = _arBool;
593*cdf0e10cSrcweir         aSeqChar = _arChar;
594*cdf0e10cSrcweir         aSeqByte = _arByte;
595*cdf0e10cSrcweir         aSeqShort = _arShort;
596*cdf0e10cSrcweir         aSeqUShort = _arUShort;
597*cdf0e10cSrcweir         aSeqLong = _arLong;
598*cdf0e10cSrcweir         aSeqULong = _arULong;
599*cdf0e10cSrcweir         aSeqHyper = _arHyper;
600*cdf0e10cSrcweir         aSeqUHyper = _arUHyper;
601*cdf0e10cSrcweir         aSeqFloat = _arFloat;
602*cdf0e10cSrcweir         aSeqDouble = _arDouble;
603*cdf0e10cSrcweir         aSeqTestEnum = _arEnum;
604*cdf0e10cSrcweir         aSeqString = _arString;
605*cdf0e10cSrcweir         aSeqXInterface = _arObject;
606*cdf0e10cSrcweir         aSeqAny = _arAny;
607*cdf0e10cSrcweir         aSeqDim2 = _arLong2;
608*cdf0e10cSrcweir         aSeqDim3 = _arLong3;
609*cdf0e10cSrcweir 
610*cdf0e10cSrcweir     }
611*cdf0e10cSrcweir 
612*cdf0e10cSrcweir     /* Attention: Debugging this code (probably in mixed mode) may lead to exceptions
613*cdf0e10cSrcweir      * which do not occur when running normally (Visual Studio 2003)
614*cdf0e10cSrcweir      */
615*cdf0e10cSrcweir     public void testConstructorsService(XComponentContext context)
616*cdf0e10cSrcweir 	{
617*cdf0e10cSrcweir 		Constructors.create1(context,
618*cdf0e10cSrcweir 			true,
619*cdf0e10cSrcweir 			0x80, // -128 in C++,
620*cdf0e10cSrcweir 			Int16.MinValue,
621*cdf0e10cSrcweir 			UInt16.MaxValue,
622*cdf0e10cSrcweir 			Int32.MinValue,
623*cdf0e10cSrcweir 			UInt32.MaxValue,
624*cdf0e10cSrcweir 			Int64.MinValue,
625*cdf0e10cSrcweir 			UInt64.MaxValue,
626*cdf0e10cSrcweir 			0.123f,
627*cdf0e10cSrcweir 			0.456,
628*cdf0e10cSrcweir 			'X',
629*cdf0e10cSrcweir 			"test",
630*cdf0e10cSrcweir 			typeof(Any),
631*cdf0e10cSrcweir 			new Any(true),
632*cdf0e10cSrcweir 			new bool[] { true },
633*cdf0e10cSrcweir 			new byte[] { 0x80}, // in C++ the value is compared with SAL_MIN_INT8 which is -128
634*cdf0e10cSrcweir 			new short[] { Int16.MinValue },
635*cdf0e10cSrcweir 			new UInt16[] { UInt16.MaxValue },
636*cdf0e10cSrcweir 			new Int32[] {Int32.MinValue},
637*cdf0e10cSrcweir 			new UInt32[] { UInt32.MaxValue },
638*cdf0e10cSrcweir 			new long[] { Int64.MinValue },
639*cdf0e10cSrcweir 			new UInt64[] { UInt64.MaxValue },
640*cdf0e10cSrcweir 			new float[] { 0.123f },
641*cdf0e10cSrcweir 			new double[] { 0.456 },
642*cdf0e10cSrcweir 			new char[] { 'X' },
643*cdf0e10cSrcweir 			new string[] { "test" },
644*cdf0e10cSrcweir 			new Type[] { typeof(Any) },
645*cdf0e10cSrcweir 			new Any[] { new Any(true) },
646*cdf0e10cSrcweir 			new bool[][] { new bool[] { true } },
647*cdf0e10cSrcweir 			new Any[][] { new Any[] { new Any(true) } },
648*cdf0e10cSrcweir 			new TestEnum[] { TestEnum.TWO },
649*cdf0e10cSrcweir 			new TestStruct[] { new TestStruct(10) },
650*cdf0e10cSrcweir 			new TestPolyStruct[] { new TestPolyStruct(true) },
651*cdf0e10cSrcweir 			new TestPolyStruct[] { new TestPolyStruct(new Any(true)) },
652*cdf0e10cSrcweir 			new object[] { null },
653*cdf0e10cSrcweir 			TestEnum.TWO,
654*cdf0e10cSrcweir 			new TestStruct(10),
655*cdf0e10cSrcweir 			new TestPolyStruct(true),
656*cdf0e10cSrcweir 			new TestPolyStruct(new Any(true)),
657*cdf0e10cSrcweir 			null
658*cdf0e10cSrcweir 			);
659*cdf0e10cSrcweir 
660*cdf0e10cSrcweir 	Constructors.create2(context,
661*cdf0e10cSrcweir              new Any(true),
662*cdf0e10cSrcweir              new Any((System.Byte) 0x80),
663*cdf0e10cSrcweir              new Any(Int16.MinValue),
664*cdf0e10cSrcweir              new Any(UInt16.MaxValue),
665*cdf0e10cSrcweir              new Any(Int32.MinValue),
666*cdf0e10cSrcweir              new Any(UInt32.MaxValue),
667*cdf0e10cSrcweir              new Any(Int64.MinValue),
668*cdf0e10cSrcweir              new Any(UInt64.MaxValue),
669*cdf0e10cSrcweir              new Any(0.123f),
670*cdf0e10cSrcweir              new Any(0.456),
671*cdf0e10cSrcweir              new Any('X'),
672*cdf0e10cSrcweir              new Any("test"),
673*cdf0e10cSrcweir              new Any(typeof(Any)),
674*cdf0e10cSrcweir              new Any(true),
675*cdf0e10cSrcweir              new Any(typeof(bool[]), new bool[] { true }),
676*cdf0e10cSrcweir              new Any(typeof(byte[]), new byte[] { (System.Byte) 0x80}),
677*cdf0e10cSrcweir              new Any(typeof(short[]), new short[] { Int16.MinValue }),
678*cdf0e10cSrcweir              new Any(typeof(UInt16[]), new UInt16[] { UInt16.MaxValue }),
679*cdf0e10cSrcweir              new Any(typeof(int[]), new int[] { Int32.MinValue }),
680*cdf0e10cSrcweir              new Any(typeof(UInt32[]), new UInt32[] { UInt32.MaxValue }),
681*cdf0e10cSrcweir              new Any(typeof(long[]), new long[] { Int64.MinValue }),
682*cdf0e10cSrcweir              new Any(typeof(UInt64[]), new UInt64[] { UInt64.MaxValue }),
683*cdf0e10cSrcweir              new Any(typeof(float[]), new float[] { 0.123f }),
684*cdf0e10cSrcweir              new Any(typeof(double[]), new double[] { 0.456 }),
685*cdf0e10cSrcweir              new Any(typeof(char[]), new char[] { 'X' }),
686*cdf0e10cSrcweir              new Any(typeof(string[]), new string[] { "test" }),
687*cdf0e10cSrcweir              new Any(typeof(Type[]), new Type[] { typeof(Any) }),
688*cdf0e10cSrcweir              new Any(typeof(Any[]), new Any[] { new Any(true) }),
689*cdf0e10cSrcweir              new Any(typeof(bool[][]), new bool[][] { new bool[] { true } }),
690*cdf0e10cSrcweir              new Any(
691*cdf0e10cSrcweir                  typeof(Any[][]), new Any[][] { new Any[] { new Any(true) } }),
692*cdf0e10cSrcweir              new Any(typeof(TestEnum[]), new TestEnum[] { TestEnum.TWO }),
693*cdf0e10cSrcweir              new Any(
694*cdf0e10cSrcweir                  typeof(TestStruct[]), new TestStruct[] { new TestStruct(10) }),
695*cdf0e10cSrcweir              new Any(
696*cdf0e10cSrcweir                  PolymorphicType.GetType(
697*cdf0e10cSrcweir                      typeof(TestPolyStruct[]),
698*cdf0e10cSrcweir                      "unoidl.test.testtools.bridgetest.TestPolyStruct<System.Boolean>[]"),
699*cdf0e10cSrcweir                  new TestPolyStruct[] { new TestPolyStruct(true) }) ,
700*cdf0e10cSrcweir              new Any(
701*cdf0e10cSrcweir                  PolymorphicType.GetType(
702*cdf0e10cSrcweir                      typeof(TestPolyStruct[]),
703*cdf0e10cSrcweir                      "unoidl.test.testtools.bridgetest.TestPolyStruct<uno.Any>[]"),
704*cdf0e10cSrcweir                  new TestPolyStruct[] { new TestPolyStruct(new Any(true)) }),
705*cdf0e10cSrcweir              new Any(typeof(object[])/*TODO*/, new object[] { null }),
706*cdf0e10cSrcweir              new Any(typeof(TestEnum), TestEnum.TWO),
707*cdf0e10cSrcweir              new Any(typeof(TestStruct), new TestStruct(10)),
708*cdf0e10cSrcweir              new Any(
709*cdf0e10cSrcweir                  PolymorphicType.GetType(
710*cdf0e10cSrcweir                      typeof(TestPolyStruct),
711*cdf0e10cSrcweir                      "unoidl.test.testtools.bridgetest.TestPolyStruct<System.Boolean>"),
712*cdf0e10cSrcweir                  new TestPolyStruct(true)),
713*cdf0e10cSrcweir              new Any(
714*cdf0e10cSrcweir                  PolymorphicType.GetType(
715*cdf0e10cSrcweir                      typeof(TestPolyStruct),
716*cdf0e10cSrcweir                      "unoidl.test.testtools.bridgetest.TestPolyStruct<uno.Any>"),
717*cdf0e10cSrcweir                  new TestPolyStruct(new Any(true))),
718*cdf0e10cSrcweir              new Any(typeof(object), null)
719*cdf0e10cSrcweir 		);
720*cdf0e10cSrcweir 
721*cdf0e10cSrcweir 
722*cdf0e10cSrcweir     XMultiBase1 xMulti = Constructors2.create1(
723*cdf0e10cSrcweir             context,
724*cdf0e10cSrcweir             new TestPolyStruct(typeof(int)),
725*cdf0e10cSrcweir             new TestPolyStruct(new Any(true)),
726*cdf0e10cSrcweir             new TestPolyStruct(true),
727*cdf0e10cSrcweir             new TestPolyStruct((Byte) 0x80),
728*cdf0e10cSrcweir             new TestPolyStruct(Int16.MinValue),
729*cdf0e10cSrcweir             new TestPolyStruct(Int32.MinValue),
730*cdf0e10cSrcweir             new TestPolyStruct(Int64.MinValue),
731*cdf0e10cSrcweir             new TestPolyStruct('X'),
732*cdf0e10cSrcweir             new TestPolyStruct("test"),
733*cdf0e10cSrcweir             new TestPolyStruct(0.123f),
734*cdf0e10cSrcweir             new TestPolyStruct(0.456d),
735*cdf0e10cSrcweir             new TestPolyStruct(new object()),
736*cdf0e10cSrcweir             new TestPolyStruct(new uno.util.WeakComponentBase()),
737*cdf0e10cSrcweir             new TestPolyStruct(TestEnum.TWO),
738*cdf0e10cSrcweir             new TestPolyStruct(new TestPolyStruct2('X', new Any(true))),
739*cdf0e10cSrcweir             new TestPolyStruct(new TestPolyStruct2(new TestPolyStruct2('X', new Any(true)), "test")),
740*cdf0e10cSrcweir             new TestPolyStruct2("test", new TestPolyStruct2('X', new TestPolyStruct(new Any(true)))),
741*cdf0e10cSrcweir             new TestPolyStruct2( new TestPolyStruct2('X', new Any(true)), new TestPolyStruct('X')),
742*cdf0e10cSrcweir             new TestPolyStruct(new Type[] { typeof(int)}),
743*cdf0e10cSrcweir             new TestPolyStruct(new Any[] { new Any(true) }),
744*cdf0e10cSrcweir             new TestPolyStruct(new bool[] {true}),
745*cdf0e10cSrcweir             new TestPolyStruct(new byte[] {0x80}),
746*cdf0e10cSrcweir             new TestPolyStruct(new short[] {Int16.MinValue}),
747*cdf0e10cSrcweir             new TestPolyStruct(new int[] {Int32.MinValue}),
748*cdf0e10cSrcweir             new TestPolyStruct(new long[] {Int64.MinValue}),
749*cdf0e10cSrcweir             new TestPolyStruct(new char[] {'X'}),
750*cdf0e10cSrcweir             new TestPolyStruct(new string[] {"test"}),
751*cdf0e10cSrcweir             new TestPolyStruct(new float[] {0.123f}),
752*cdf0e10cSrcweir             new TestPolyStruct(new double[] {0.456d}),
753*cdf0e10cSrcweir             new TestPolyStruct(new object[] {new object()}),
754*cdf0e10cSrcweir             new TestPolyStruct(new unoidl.com.sun.star.lang.XComponent[] {new uno.util.WeakComponentBase()}),
755*cdf0e10cSrcweir             new TestPolyStruct(new TestEnum[] {TestEnum.TWO}),
756*cdf0e10cSrcweir             new TestPolyStruct(new TestPolyStruct2[] {new TestPolyStruct2('X', new Any[] {new Any(true)})}),
757*cdf0e10cSrcweir             new TestPolyStruct(new TestPolyStruct2[] {
758*cdf0e10cSrcweir                 new TestPolyStruct2(new TestPolyStruct('X'), new Any[] {new Any(true)})}),
759*cdf0e10cSrcweir             new TestPolyStruct(new int[][] { new int[] {Int32.MinValue} }),
760*cdf0e10cSrcweir             new TestPolyStruct[]{ new TestPolyStruct(Int32.MinValue)},
761*cdf0e10cSrcweir             new TestPolyStruct[]{new TestPolyStruct(new TestPolyStruct2('X', new Any(true)))},
762*cdf0e10cSrcweir             new TestPolyStruct[]{new TestPolyStruct(new TestPolyStruct2(new TestPolyStruct2('X', new Any(true)), "test"))},
763*cdf0e10cSrcweir             new TestPolyStruct2[]{new TestPolyStruct2("test", new TestPolyStruct2('X', new TestPolyStruct(new Any(true))))},
764*cdf0e10cSrcweir             new TestPolyStruct2[]{new TestPolyStruct2(new TestPolyStruct2('X', new Any(true)),new TestPolyStruct('X'))},
765*cdf0e10cSrcweir             new TestPolyStruct[][]{new TestPolyStruct[]{new TestPolyStruct('X')}},
766*cdf0e10cSrcweir             new TestPolyStruct[][]{new TestPolyStruct[]{new TestPolyStruct(new TestPolyStruct2('X', new Any(true)))}},
767*cdf0e10cSrcweir             new TestPolyStruct[][]{new TestPolyStruct[] {new TestPolyStruct(new TestPolyStruct2(new TestPolyStruct2('X',new Any(true)), "test"))}},
768*cdf0e10cSrcweir             new TestPolyStruct2[][]{new TestPolyStruct2[]{new TestPolyStruct2("test", new TestPolyStruct2('X',new TestPolyStruct(new Any(true))))}},
769*cdf0e10cSrcweir             new TestPolyStruct2[][]{new TestPolyStruct2[]{new TestPolyStruct2(new TestPolyStruct2('X',new Any(true)),new TestPolyStruct('X'))}}
770*cdf0e10cSrcweir             );
771*cdf0e10cSrcweir 
772*cdf0e10cSrcweir     //test the returned interface
773*cdf0e10cSrcweir     xMulti.fn11(1);
774*cdf0e10cSrcweir 
775*cdf0e10cSrcweir 
776*cdf0e10cSrcweir     }
777*cdf0e10cSrcweir 
778*cdf0e10cSrcweir     public XCurrentContextChecker getCurrentContextChecker()
779*cdf0e10cSrcweir     {
780*cdf0e10cSrcweir         return null; //TODO: not yet tested in CLI UNO
781*cdf0e10cSrcweir     }
782*cdf0e10cSrcweir 
783*cdf0e10cSrcweir     public TestPolyStruct transportPolyBoolean(/*[in]*/TestPolyStruct arg)
784*cdf0e10cSrcweir     {
785*cdf0e10cSrcweir         return arg;
786*cdf0e10cSrcweir     }
787*cdf0e10cSrcweir 
788*cdf0e10cSrcweir     public  void  transportPolyHyper(/*[in][out]*/ ref TestPolyStruct arg)
789*cdf0e10cSrcweir     {
790*cdf0e10cSrcweir     }
791*cdf0e10cSrcweir 
792*cdf0e10cSrcweir     public void  transportPolySequence(TestPolyStruct arg1,
793*cdf0e10cSrcweir                                        out TestPolyStruct arg2)
794*cdf0e10cSrcweir     {
795*cdf0e10cSrcweir         arg2 = arg1;
796*cdf0e10cSrcweir     }
797*cdf0e10cSrcweir 
798*cdf0e10cSrcweir     public TestPolyStruct getNullPolyBadEnum()
799*cdf0e10cSrcweir     {
800*cdf0e10cSrcweir         return new TestPolyStruct(unoidl.test.testtools.bridgetest.TestBadEnum.M);
801*cdf0e10cSrcweir     }
802*cdf0e10cSrcweir 
803*cdf0e10cSrcweir     public TestPolyStruct getNullPolyLong()
804*cdf0e10cSrcweir     {
805*cdf0e10cSrcweir         return new TestPolyStruct();
806*cdf0e10cSrcweir     }
807*cdf0e10cSrcweir 
808*cdf0e10cSrcweir     public TestPolyStruct getNullPolyString()
809*cdf0e10cSrcweir     {
810*cdf0e10cSrcweir         return new TestPolyStruct();
811*cdf0e10cSrcweir     }
812*cdf0e10cSrcweir 
813*cdf0e10cSrcweir     public TestPolyStruct getNullPolyType()
814*cdf0e10cSrcweir     {
815*cdf0e10cSrcweir         return new TestPolyStruct();
816*cdf0e10cSrcweir     }
817*cdf0e10cSrcweir 
818*cdf0e10cSrcweir     public TestPolyStruct getNullPolyAny()
819*cdf0e10cSrcweir     {
820*cdf0e10cSrcweir         return new TestPolyStruct();
821*cdf0e10cSrcweir     }
822*cdf0e10cSrcweir 
823*cdf0e10cSrcweir     public TestPolyStruct getNullPolySequence()
824*cdf0e10cSrcweir     {
825*cdf0e10cSrcweir         return new TestPolyStruct();
826*cdf0e10cSrcweir     }
827*cdf0e10cSrcweir 
828*cdf0e10cSrcweir     public TestPolyStruct getNullPolyEnum()
829*cdf0e10cSrcweir     {
830*cdf0e10cSrcweir         return new TestPolyStruct();
831*cdf0e10cSrcweir     }
832*cdf0e10cSrcweir 
833*cdf0e10cSrcweir     public TestPolyStruct getNullPolyStruct()
834*cdf0e10cSrcweir     {
835*cdf0e10cSrcweir         return new TestPolyStruct();
836*cdf0e10cSrcweir     }
837*cdf0e10cSrcweir 
838*cdf0e10cSrcweir     public TestPolyStruct getNullPolyInterface()
839*cdf0e10cSrcweir     {
840*cdf0e10cSrcweir         return new TestPolyStruct();
841*cdf0e10cSrcweir     }
842*cdf0e10cSrcweir 
843*cdf0e10cSrcweir     public XMulti getMulti()
844*cdf0e10cSrcweir     {
845*cdf0e10cSrcweir         return new testtools.bridgetest.cli_cs.Multi();
846*cdf0e10cSrcweir     }
847*cdf0e10cSrcweir 
848*cdf0e10cSrcweir     private static void checkEqual(int value, int argument) {
849*cdf0e10cSrcweir         if (argument != value) {
850*cdf0e10cSrcweir             throw new CheckFailed(value + " != " + argument);
851*cdf0e10cSrcweir         }
852*cdf0e10cSrcweir     }
853*cdf0e10cSrcweir 
854*cdf0e10cSrcweir     private static void checkEqual(double value, double argument) {
855*cdf0e10cSrcweir         if (argument != value) {
856*cdf0e10cSrcweir             throw new CheckFailed(value + " != " + argument);
857*cdf0e10cSrcweir         }
858*cdf0e10cSrcweir     }
859*cdf0e10cSrcweir 
860*cdf0e10cSrcweir     private static void checkEqual(string value, string argument) {
861*cdf0e10cSrcweir         if (argument != value) {
862*cdf0e10cSrcweir             throw new CheckFailed(value + " != " + argument);
863*cdf0e10cSrcweir         }
864*cdf0e10cSrcweir     }
865*cdf0e10cSrcweir 
866*cdf0e10cSrcweir     public string testMulti(XMulti multi)
867*cdf0e10cSrcweir     {
868*cdf0e10cSrcweir         try {
869*cdf0e10cSrcweir             checkEqual(0.0, multi.att1);
870*cdf0e10cSrcweir             multi.att1 = 0.1;
871*cdf0e10cSrcweir             checkEqual(0.1, multi.att1);
872*cdf0e10cSrcweir             checkEqual(11 * 1, multi.fn11(1));
873*cdf0e10cSrcweir             checkEqual("12" + "abc", multi.fn12("abc"));
874*cdf0e10cSrcweir             checkEqual(21 * 2, multi.fn21(2));
875*cdf0e10cSrcweir             checkEqual("22" + "de", multi.fn22("de"));
876*cdf0e10cSrcweir             checkEqual(0.0, multi.att3);
877*cdf0e10cSrcweir             multi.att3 = 0.3;
878*cdf0e10cSrcweir             checkEqual(0.3, multi.att3);
879*cdf0e10cSrcweir             checkEqual(31 * 3, multi.fn31(3));
880*cdf0e10cSrcweir             checkEqual("32" + "f", multi.fn32("f"));
881*cdf0e10cSrcweir             checkEqual(33, multi.fn33());
882*cdf0e10cSrcweir             checkEqual(41 * 4, multi.fn41(4));
883*cdf0e10cSrcweir             checkEqual(61 * 6, multi.fn61(6));
884*cdf0e10cSrcweir             checkEqual("62" + "", multi.fn62(""));
885*cdf0e10cSrcweir             checkEqual(71 * 7, multi.fn71(7));
886*cdf0e10cSrcweir             checkEqual("72" + "g", multi.fn72("g"));
887*cdf0e10cSrcweir             checkEqual(73, multi.fn73());
888*cdf0e10cSrcweir         } catch (CheckFailed f) {
889*cdf0e10cSrcweir             return f.Message;
890*cdf0e10cSrcweir         }
891*cdf0e10cSrcweir         return "";
892*cdf0e10cSrcweir     }
893*cdf0e10cSrcweir 
894*cdf0e10cSrcweir     public int RaiseAttr1
895*cdf0e10cSrcweir     {
896*cdf0e10cSrcweir         get { throw new RuntimeException(); }
897*cdf0e10cSrcweir         set { throw new IllegalArgumentException(); }
898*cdf0e10cSrcweir     }
899*cdf0e10cSrcweir 
900*cdf0e10cSrcweir     public int RaiseAttr2
901*cdf0e10cSrcweir     {
902*cdf0e10cSrcweir         get { throw new IllegalArgumentException(); }
903*cdf0e10cSrcweir         set { throw new IllegalArgumentException(); }
904*cdf0e10cSrcweir     }
905*cdf0e10cSrcweir 
906*cdf0e10cSrcweir 
907*cdf0e10cSrcweir }
908*cdf0e10cSrcweir 
909*cdf0e10cSrcweir }
910