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