calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / testtools / source / bridgetest / cli / cli_cs_testobj.cs
blob8d209ec44f015adcca46cd00bad400997add5c7b
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 using System;
20 using System.Diagnostics;
21 using System.Threading;
22 using System.Runtime.CompilerServices;
23 using uno;
24 using uno.util;
25 using unoidl.com.sun.star.uno;
26 using unoidl.com.sun.star.lang;
27 using unoidl.test.testtools.bridgetest;
29 namespace cs_testobj
32 class CheckFailed: System.Exception {
33 public CheckFailed(string message): base(message) {}
36 public class BridgeTestObject : WeakBase, XRecursiveCall, XBridgeTest2
38 private XComponentContext m_xContext;
40 public BridgeTestObject( XComponentContext xContext )
42 m_xContext = xContext;
44 public BridgeTestObject()
48 private bool _bool;
49 private char _char;
50 private byte _byte;
51 private short _short;
52 private ushort _ushort;
53 private int _long;
54 private uint _ulong;
55 private long _hyper;
56 private ulong _uhyper;
57 private float _float;
58 private double _double;
59 private String _string;
60 private byte _byte2;
61 private short _short2;
62 private Object _xInterface;
63 private Any _any;
64 private TestEnum _testEnum = TestEnum.TEST;
65 private TestElement[] _testElements = new TestElement[0];
66 private TestDataElements _testDataElements = new TestDataElements();
67 private int _nLastCallId = 0;
68 private bool _bFirstCall = true;
69 private bool _bSequenceOfCallTestPassed = true;
71 private bool[] _arBool;
72 private char[] _arChar;
73 private byte[] _arByte;
74 private short[]_arShort;
75 private int[] _arLong;
76 private long[] _arHyper;
77 private UInt16[] _arUShort;
78 private UInt32[] _arULong;
79 private UInt64[] _arUHyper;
80 private string[] _arString;
81 private float[] _arFloat;
82 private double[] _arDouble;
83 private TestEnum[] _arEnum;
84 private Object[] _arObject;
85 private int[][] _arLong2;
86 private int[][][] _arLong3;
87 private Any[] _arAny;
89 // private int _raiseAttr1;
92 public void setValues(
93 bool bBool,
94 char cChar,
95 byte nByte,
96 short nShort,
97 ushort nUShort,
98 int nLong,
99 uint nULong,
100 long nHyper,
101 ulong nUHyper,
102 float fFloat,
103 double fDouble,
104 TestEnum testEnum,
105 String str,
106 byte nByte2,
107 short nShort2,
108 Object xInterface,
109 Any any,
110 TestElement [] testElements,
111 TestDataElements testDataElements )
113 Debug.WriteLine( "##### " + GetType().FullName + ".setValues:" + any );
115 _bool = bBool;
116 _char = cChar;
117 _byte = nByte;
118 _short = nShort;
119 _ushort = nUShort;
120 _long = nLong;
121 _ulong = nULong;
122 _hyper = nHyper;
123 _uhyper = nUHyper;
124 _float = fFloat;
125 _double = fDouble;
126 _testEnum = testEnum;
127 _string = str;
128 _byte2 = nByte2;
129 _short2 = nShort2;
130 _xInterface = xInterface;
131 _any = any;
132 _testElements = testElements;
133 _testDataElements = testDataElements;
136 public TestDataElements setValues2(
137 /*INOUT*/ref bool io_bool,
138 /*INOUT*/ref char io_char,
139 /*INOUT*/ref byte io_byte,
140 /*INOUT*/ref short io_short,
141 /*INOUT*/ref ushort io_ushort,
142 /*INOUT*/ref int io_long,
143 /*INOUT*/ref uint io_ulong,
144 /*INOUT*/ref long io_hyper,
145 /*INOUT*/ref ulong io_uhyper,
146 /*INOUT*/ref float io_float,
147 /*INOUT*/ref double io_double,
148 /*INOUT*/ref TestEnum io_testEnum,
149 /*INOUT*/ref String io_string,
150 /*INOUT*/ref byte io_byte2,
151 /*INOUT*/ref short io_short2,
152 /*INOUT*/ref Object io_xInterface,
153 /*INOUT*/ref Any io_any,
154 /*INOUT*/ref TestElement[] io_testElements,
155 /*INOUT*/ref TestDataElements io_testDataElements )
157 Debug.WriteLine( "##### " + GetType().FullName + ".setValues2:" + io_any );
159 _bool = io_bool;
160 _char = io_char;
161 _byte = io_byte;
162 _short = io_short;
163 _ushort = io_ushort;
164 _long = io_long;
165 _ulong = io_ulong;
166 _hyper = io_hyper;
167 _uhyper = io_uhyper;
168 _float = io_float;
169 _double = io_double;
170 _testEnum = io_testEnum;
171 _string = io_string;
172 _byte2 = io_byte2;
173 _short2 = io_short2;
174 _xInterface = io_xInterface;
175 _any = io_any;
176 _testElements = (TestElement[]) io_testElements.Clone();
177 _testDataElements = io_testDataElements;
179 TestElement temp = io_testElements[ 0 ];
180 io_testElements[ 0 ] = io_testElements[ 1 ];
181 io_testElements[ 1 ] = temp;
183 return _testDataElements;
186 public TestDataElements getValues(
187 /*OUT*/out bool o_bool,
188 /*OUT*/out char o_char,
189 /*OUT*/out byte o_byte,
190 /*OUT*/out short o_short,
191 /*OUT*/out ushort o_ushort,
192 /*OUT*/out int o_long,
193 /*OUT*/out uint o_ulong,
194 /*OUT*/out long o_hyper,
195 /*OUT*/out ulong o_uhyper,
196 /*OUT*/out float o_float,
197 /*OUT*/out double o_double,
198 /*OUT*/out TestEnum o_testEnum,
199 /*OUT*/out String o_string,
200 /*OUT*/out byte o_byte2,
201 /*OUT*/out short o_short2,
202 /*OUT*/out Object o_xInterface,
203 /*OUT*/out Any o_any,
204 /*OUT*/out TestElement[] o_testElements,
205 /*OUT*/out TestDataElements o_testDataElements )
207 Debug.WriteLine( "##### " + GetType().FullName + ".getValues" );
209 o_bool = _bool;
210 o_char = _char;
211 o_byte = _byte;
212 o_short = _short;
213 o_ushort = _ushort;
214 o_long = _long;
215 o_ulong = _ulong;
216 o_hyper = _hyper;
217 o_uhyper = _uhyper;
218 o_float = _float;
219 o_double = _double;
220 o_testEnum = _testEnum;
221 o_string = _string;
222 o_byte2 = _byte2;
223 o_short2 = _short2;
224 o_xInterface = _xInterface;
225 o_any = _any;
226 o_testElements = _testElements;
227 o_testDataElements = _testDataElements;
229 return _testDataElements;
232 public SmallStruct echoSmallStruct(/*[in]*/SmallStruct arg)
234 return arg;
237 public MediumStruct echoMediumStruct(/*[in]*/MediumStruct arg)
239 return arg;
242 public BigStruct echoBigStruct(/*[in]*/BigStruct arg)
244 return arg;
247 public TwoFloats echoTwoFloats(/*[in]*/TwoFloats arg)
249 return arg;
252 public FourFloats echoFourFloats(/*[in]*/FourFloats arg)
254 return arg;
257 public MixedFloatAndInteger echoMixedFloatAndInteger(/*[in]*/MixedFloatAndInteger arg)
259 return arg;
262 public DoubleHyper echoDoubleHyper(Mix s) { return s; }
264 public HyperDouble echoHyperDouble(Mix s) { return s; }
266 public FloatFloatLongByte echoFloatFloatLongByte(Mix s) { return s; }
268 public ThreeByteStruct echoThreeByteStruct(/*[in]*/ThreeByteStruct arg)
270 return arg;
273 public int testPPCAlignment( long l1, long l2, int i1, long l3, int i2 )
275 return i2;
278 public int testPPC64Alignment( double d1, double d2, double d3, int i1 )
280 return i1;
283 public double testTenDoubles( double d1, double d2, double d3, double d4, double d5, double d6, double d7, double d8, double d9, double d10 )
285 return d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10;
288 // Attributes
289 public bool Bool
291 get { return _bool; }
292 set { _bool = value; }
294 public byte Byte
296 get { return _byte; }
297 set { _byte = value; }
299 public char Char
301 get { return _char; }
302 set { _char = value; }
304 public short Short
306 get { return _short; }
307 set { _short = value; }
309 public ushort UShort
311 get { return _ushort; }
312 set { _ushort = value; }
314 public int Long
316 get { return _long; }
317 set { _long = value; }
319 public uint ULong
321 get { return _ulong; }
322 set { _ulong = value; }
324 public long Hyper
326 get { return _hyper; }
327 set { _hyper = value; }
329 public ulong UHyper
331 get { return _uhyper; }
332 set { _uhyper = value; }
334 public float Float
336 get { return _float; }
337 set { _float = value; }
339 public double Double
341 get { return _double; }
342 set { _double = value; }
344 public TestEnum Enum
346 get { return _testEnum; }
347 set { _testEnum = value; }
349 public String String
351 get { return _string; }
352 set { _string = value; }
354 public byte Byte2
356 get { return _byte2; }
357 set { _byte2 = value; }
359 public short Short2
361 get { return _short2; }
362 set { _short2 = value; }
364 public Object Interface
366 get { return _xInterface; }
367 set { _xInterface = value; }
369 public uno.Any Any
371 get {
373 Debug.WriteLine( "##### " + GetType().FullName + ".Any" );
374 return _any;
376 set {
377 Debug.WriteLine( "##### " + GetType().FullName + ".Any:" + value );
378 _any = value;
381 public TestElement [] Sequence
383 get { return _testElements; }
384 set { _testElements = value; }
386 public TestDataElements Struct
388 get { return _testDataElements; }
389 set { _testDataElements = value; }
391 public Any transportAny(Any value)
393 return value;
395 public void call(int nCallId , int nWaitMUSEC)
397 Thread.Sleep(nWaitMUSEC / 10000);
399 if(_bFirstCall)
400 _bFirstCall = false;
402 else
403 _bSequenceOfCallTestPassed = _bSequenceOfCallTestPassed && (nCallId > _nLastCallId);
405 _nLastCallId = nCallId;
407 public void callOneway( int nCallId , int nWaitMUSEC )
409 Thread.Sleep(nWaitMUSEC / 10000);
411 _bSequenceOfCallTestPassed = _bSequenceOfCallTestPassed && (nCallId > _nLastCallId);
412 _nLastCallId = nCallId;
414 public bool sequenceOfCallTestPassed()
416 return _bSequenceOfCallTestPassed;
418 [MethodImpl( MethodImplOptions.Synchronized )]
419 public void callRecursivly( XRecursiveCall xCall, int nToCall )
421 lock (this)
423 if(nToCall != 0)
425 nToCall --;
426 xCall.callRecursivly(this , nToCall);
430 [MethodImpl( MethodImplOptions.Synchronized )]
431 public void startRecursiveCall( XRecursiveCall xCall, int nToCall )
433 lock (this)
435 if(nToCall != 0)
437 nToCall --;
438 xCall.callRecursivly( this , nToCall );
443 // XBridgeTest
444 public TestDataElements raiseException(
445 short nArgumentPos, String rMsg, Object xContext )
447 throw new IllegalArgumentException(rMsg, xContext, nArgumentPos);
449 public void raiseRuntimeExceptionOneway( String rMsg, Object xContext )
451 throw new RuntimeException(rMsg, xContext);
454 private void dothrow( System.Exception e )
456 throw e;
458 public int RuntimeException
460 get {
463 dothrow( new RuntimeException(_string, _xInterface) );
464 return 0; // dummy
466 catch (System.Exception exc)
468 throw exc;
471 set { throw new RuntimeException(_string, _xInterface); }
474 // XBridgeTest2
475 public int[][] setDim2(int[][] val)
477 _arLong2 = val;
478 return val;
481 public int[][][] setDim3(int[][][] val)
483 _arLong3 = val;
484 return val;
487 public Any[] setSequenceAny(Any[] val)
489 _arAny = val;
490 return val;
493 public bool[] setSequenceBool(bool[] val)
495 _arBool = val;
496 return val;
499 public byte[] setSequenceByte(byte[] val)
501 _arByte = val;
502 return val;
505 public char[] setSequenceChar(char[] val)
507 _arChar = val;
508 return val;
511 public short[] setSequenceShort(short[] val)
513 _arShort = val;
514 return val;
517 public int[] setSequenceLong(int[] val)
519 _arLong = val;
520 return val;
523 public long[] setSequenceHyper(long[] val)
525 _arHyper = val;
526 return val;
529 public float[] setSequenceFloat(float[] val)
531 _arFloat = val;
532 return val;
535 public double[] setSequenceDouble(double[] val)
537 _arDouble = val;
538 return val;
541 public TestEnum[] setSequenceEnum(TestEnum[] val)
543 _arEnum = val;
544 return val;
547 public UInt16[] setSequenceUShort(UInt16[] val)
549 _arUShort = val;
550 return val;
553 public UInt32[] setSequenceULong(UInt32[] val)
555 _arULong = val;
556 return val;
559 public UInt64[] setSequenceUHyper(UInt64[] val)
561 _arUHyper = val;
562 return val;
565 public Object[] setSequenceXInterface(Object[] val)
567 _arObject = val;
568 return val;
571 public string[] setSequenceString(string[] val)
573 _arString = val;
574 return val;
577 public TestElement[] setSequenceStruct(TestElement[] val)
579 _testElements = val;
580 return val;
583 public void setSequencesInOut(ref bool[] aSeqBoolean,
584 ref char[] aSeqChar,
585 ref byte[] aSeqByte,
586 ref short[] aSeqShort,
587 ref UInt16[] aSeqUShort,
588 ref int[] aSeqLong,
589 ref UInt32[] aSeqULong,
590 ref long[] aSeqHyper,
591 ref UInt64[] aSeqUHyper,
592 ref float[] aSeqFloat,
593 ref double[] aSeqDouble,
594 ref TestEnum[] aSeqTestEnum,
595 ref string[] aSeqString,
596 ref object[] aSeqXInterface,
597 ref Any[] aSeqAny,
598 ref int[][] aSeqDim2,
599 ref int[][][] aSeqDim3)
601 _arBool = aSeqBoolean;
602 _arChar = aSeqChar;
603 _arByte = aSeqByte;
604 _arShort = aSeqShort;
605 _arUShort = aSeqUShort;
606 _arLong = aSeqLong;
607 _arULong = aSeqULong;
608 _arHyper = aSeqHyper;
609 _arUHyper = aSeqUHyper;
610 _arFloat = aSeqFloat;
611 _arDouble = aSeqDouble;
612 _arEnum = aSeqTestEnum;
613 _arString = aSeqString;
614 _arObject = aSeqXInterface;
615 _arAny = aSeqAny;
616 _arLong2 = aSeqDim2;
617 _arLong3 = aSeqDim3;
620 public void setSequencesOut(out bool[] aSeqBoolean,
621 out char[] aSeqChar,
622 out byte[] aSeqByte,
623 out short[] aSeqShort,
624 out UInt16[] aSeqUShort,
625 out int[] aSeqLong,
626 out UInt32[] aSeqULong,
627 out long[] aSeqHyper,
628 out UInt64[] aSeqUHyper,
629 out float[] aSeqFloat,
630 out double[] aSeqDouble,
631 out TestEnum[] aSeqTestEnum,
632 out string[] aSeqString,
633 out object[] aSeqXInterface,
634 out Any[] aSeqAny,
635 out int[][] aSeqDim2,
636 out int[][][] aSeqDim3)
638 aSeqBoolean = _arBool;
639 aSeqChar = _arChar;
640 aSeqByte = _arByte;
641 aSeqShort = _arShort;
642 aSeqUShort = _arUShort;
643 aSeqLong = _arLong;
644 aSeqULong = _arULong;
645 aSeqHyper = _arHyper;
646 aSeqUHyper = _arUHyper;
647 aSeqFloat = _arFloat;
648 aSeqDouble = _arDouble;
649 aSeqTestEnum = _arEnum;
650 aSeqString = _arString;
651 aSeqXInterface = _arObject;
652 aSeqAny = _arAny;
653 aSeqDim2 = _arLong2;
654 aSeqDim3 = _arLong3;
658 /* Attention: Debugging this code (probably in mixed mode) may lead to exceptions
659 * which do not occur when running normally (Visual Studio 2003)
661 public void testConstructorsService(XComponentContext context)
663 Constructors.create1(context,
664 true,
665 0x80, // -128 in C++,
666 Int16.MinValue,
667 UInt16.MaxValue,
668 Int32.MinValue,
669 UInt32.MaxValue,
670 Int64.MinValue,
671 UInt64.MaxValue,
672 0.123f,
673 0.456,
674 'X',
675 "test",
676 typeof(Any),
677 new Any(true),
678 new bool[] { true },
679 new byte[] { 0x80}, // in C++ the value is compared with SAL_MIN_INT8 which is -128
680 new short[] { Int16.MinValue },
681 new UInt16[] { UInt16.MaxValue },
682 new Int32[] {Int32.MinValue},
683 new UInt32[] { UInt32.MaxValue },
684 new long[] { Int64.MinValue },
685 new UInt64[] { UInt64.MaxValue },
686 new float[] { 0.123f },
687 new double[] { 0.456 },
688 new char[] { 'X' },
689 new string[] { "test" },
690 new Type[] { typeof(Any) },
691 new Any[] { new Any(true) },
692 new bool[][] { new bool[] { true } },
693 new Any[][] { new Any[] { new Any(true) } },
694 new TestEnum[] { TestEnum.TWO },
695 new TestStruct[] { new TestStruct(10) },
696 new TestPolyStruct[] { new TestPolyStruct(true) },
697 new TestPolyStruct[] { new TestPolyStruct(new Any(true)) },
698 new object[] { null },
699 TestEnum.TWO,
700 new TestStruct(10),
701 new TestPolyStruct(true),
702 new TestPolyStruct(new Any(true)),
703 null
706 Constructors.create2(context,
707 new Any(true),
708 new Any((System.Byte) 0x80),
709 new Any(Int16.MinValue),
710 new Any(UInt16.MaxValue),
711 new Any(Int32.MinValue),
712 new Any(UInt32.MaxValue),
713 new Any(Int64.MinValue),
714 new Any(UInt64.MaxValue),
715 new Any(0.123f),
716 new Any(0.456),
717 new Any('X'),
718 new Any("test"),
719 new Any(typeof(Any)),
720 new Any(true),
721 new Any(typeof(bool[]), new bool[] { true }),
722 new Any(typeof(byte[]), new byte[] { (System.Byte) 0x80}),
723 new Any(typeof(short[]), new short[] { Int16.MinValue }),
724 new Any(typeof(UInt16[]), new UInt16[] { UInt16.MaxValue }),
725 new Any(typeof(int[]), new int[] { Int32.MinValue }),
726 new Any(typeof(UInt32[]), new UInt32[] { UInt32.MaxValue }),
727 new Any(typeof(long[]), new long[] { Int64.MinValue }),
728 new Any(typeof(UInt64[]), new UInt64[] { UInt64.MaxValue }),
729 new Any(typeof(float[]), new float[] { 0.123f }),
730 new Any(typeof(double[]), new double[] { 0.456 }),
731 new Any(typeof(char[]), new char[] { 'X' }),
732 new Any(typeof(string[]), new string[] { "test" }),
733 new Any(typeof(Type[]), new Type[] { typeof(Any) }),
734 new Any(typeof(Any[]), new Any[] { new Any(true) }),
735 new Any(typeof(bool[][]), new bool[][] { new bool[] { true } }),
736 new Any(
737 typeof(Any[][]), new Any[][] { new Any[] { new Any(true) } }),
738 new Any(typeof(TestEnum[]), new TestEnum[] { TestEnum.TWO }),
739 new Any(
740 typeof(TestStruct[]), new TestStruct[] { new TestStruct(10) }),
741 new Any(
742 PolymorphicType.GetType(
743 typeof(TestPolyStruct[]),
744 "unoidl.test.testtools.bridgetest.TestPolyStruct<System.Boolean>[]"),
745 new TestPolyStruct[] { new TestPolyStruct(true) }) ,
746 new Any(
747 PolymorphicType.GetType(
748 typeof(TestPolyStruct[]),
749 "unoidl.test.testtools.bridgetest.TestPolyStruct<uno.Any>[]"),
750 new TestPolyStruct[] { new TestPolyStruct(new Any(true)) }),
751 new Any(typeof(object[])/*TODO*/, new object[] { null }),
752 new Any(typeof(TestEnum), TestEnum.TWO),
753 new Any(typeof(TestStruct), new TestStruct(10)),
754 new Any(
755 PolymorphicType.GetType(
756 typeof(TestPolyStruct),
757 "unoidl.test.testtools.bridgetest.TestPolyStruct<System.Boolean>"),
758 new TestPolyStruct(true)),
759 new Any(
760 PolymorphicType.GetType(
761 typeof(TestPolyStruct),
762 "unoidl.test.testtools.bridgetest.TestPolyStruct<uno.Any>"),
763 new TestPolyStruct(new Any(true))),
764 new Any(typeof(object), null)
768 XMultiBase1 xMulti = Constructors2.create1(
769 context,
770 new TestPolyStruct(typeof(int)),
771 new TestPolyStruct(new Any(true)),
772 new TestPolyStruct(true),
773 new TestPolyStruct((Byte) 0x80),
774 new TestPolyStruct(Int16.MinValue),
775 new TestPolyStruct(Int32.MinValue),
776 new TestPolyStruct(Int64.MinValue),
777 new TestPolyStruct('X'),
778 new TestPolyStruct("test"),
779 new TestPolyStruct(0.123f),
780 new TestPolyStruct(0.456d),
781 new TestPolyStruct(new object()),
782 new TestPolyStruct(new uno.util.WeakComponentBase()),
783 new TestPolyStruct(TestEnum.TWO),
784 new TestPolyStruct(new TestPolyStruct2('X', new Any(true))),
785 new TestPolyStruct(new TestPolyStruct2(new TestPolyStruct2('X', new Any(true)), "test")),
786 new TestPolyStruct2("test", new TestPolyStruct2('X', new TestPolyStruct(new Any(true)))),
787 new TestPolyStruct2( new TestPolyStruct2('X', new Any(true)), new TestPolyStruct('X')),
788 new TestPolyStruct(new Type[] { typeof(int)}),
789 new TestPolyStruct(new Any[] { new Any(true) }),
790 new TestPolyStruct(new bool[] {true}),
791 new TestPolyStruct(new byte[] {0x80}),
792 new TestPolyStruct(new short[] {Int16.MinValue}),
793 new TestPolyStruct(new int[] {Int32.MinValue}),
794 new TestPolyStruct(new long[] {Int64.MinValue}),
795 new TestPolyStruct(new char[] {'X'}),
796 new TestPolyStruct(new string[] {"test"}),
797 new TestPolyStruct(new float[] {0.123f}),
798 new TestPolyStruct(new double[] {0.456d}),
799 new TestPolyStruct(new object[] {new object()}),
800 new TestPolyStruct(new unoidl.com.sun.star.lang.XComponent[] {new uno.util.WeakComponentBase()}),
801 new TestPolyStruct(new TestEnum[] {TestEnum.TWO}),
802 new TestPolyStruct(new TestPolyStruct2[] {new TestPolyStruct2('X', new Any[] {new Any(true)})}),
803 new TestPolyStruct(new TestPolyStruct2[] {
804 new TestPolyStruct2(new TestPolyStruct('X'), new Any[] {new Any(true)})}),
805 new TestPolyStruct(new int[][] { new int[] {Int32.MinValue} }),
806 new TestPolyStruct[]{ new TestPolyStruct(Int32.MinValue)},
807 new TestPolyStruct[]{new TestPolyStruct(new TestPolyStruct2('X', new Any(true)))},
808 new TestPolyStruct[]{new TestPolyStruct(new TestPolyStruct2(new TestPolyStruct2('X', new Any(true)), "test"))},
809 new TestPolyStruct2[]{new TestPolyStruct2("test", new TestPolyStruct2('X', new TestPolyStruct(new Any(true))))},
810 new TestPolyStruct2[]{new TestPolyStruct2(new TestPolyStruct2('X', new Any(true)),new TestPolyStruct('X'))},
811 new TestPolyStruct[][]{new TestPolyStruct[]{new TestPolyStruct('X')}},
812 new TestPolyStruct[][]{new TestPolyStruct[]{new TestPolyStruct(new TestPolyStruct2('X', new Any(true)))}},
813 new TestPolyStruct[][]{new TestPolyStruct[] {new TestPolyStruct(new TestPolyStruct2(new TestPolyStruct2('X',new Any(true)), "test"))}},
814 new TestPolyStruct2[][]{new TestPolyStruct2[]{new TestPolyStruct2("test", new TestPolyStruct2('X',new TestPolyStruct(new Any(true))))}},
815 new TestPolyStruct2[][]{new TestPolyStruct2[]{new TestPolyStruct2(new TestPolyStruct2('X',new Any(true)),new TestPolyStruct('X'))}}
818 //test the returned interface
819 xMulti.fn11(1);
824 public XCurrentContextChecker getCurrentContextChecker()
826 return null; //TODO: not yet tested in CLI UNO
829 public TestPolyStruct transportPolyBoolean(/*[in]*/TestPolyStruct arg)
831 return arg;
834 public void transportPolyHyper(/*[in][out]*/ ref TestPolyStruct arg)
838 public void transportPolySequence(TestPolyStruct arg1,
839 out TestPolyStruct arg2)
841 arg2 = arg1;
844 public TestPolyStruct getNullPolyBadEnum()
846 return new TestPolyStruct(unoidl.test.testtools.bridgetest.TestBadEnum.M);
849 public TestPolyStruct getNullPolyLong()
851 return new TestPolyStruct();
854 public TestPolyStruct getNullPolyString()
856 return new TestPolyStruct();
859 public TestPolyStruct getNullPolyType()
861 return new TestPolyStruct();
864 public TestPolyStruct getNullPolyAny()
866 return new TestPolyStruct();
869 public TestPolyStruct getNullPolySequence()
871 return new TestPolyStruct();
874 public TestPolyStruct getNullPolyEnum()
876 return new TestPolyStruct();
879 public TestPolyStruct getNullPolyStruct()
881 return new TestPolyStruct();
884 public TestPolyStruct getNullPolyInterface()
886 return new TestPolyStruct();
889 public XMulti getMulti()
891 return new testtools.bridgetest.cli_cs.Multi();
894 private static void checkEqual(int value, int argument) {
895 if (argument != value) {
896 throw new CheckFailed(value + " != " + argument);
900 private static void checkEqual(double value, double argument) {
901 if (argument != value) {
902 throw new CheckFailed(value + " != " + argument);
906 private static void checkEqual(string value, string argument) {
907 if (argument != value) {
908 throw new CheckFailed(value + " != " + argument);
912 public string testMulti(XMulti multi)
914 try {
915 checkEqual(0.0, multi.att1);
916 multi.att1 = 0.1;
917 checkEqual(0.1, multi.att1);
918 checkEqual(11 * 1, multi.fn11(1));
919 checkEqual("12" + "abc", multi.fn12("abc"));
920 checkEqual(21 * 2, multi.fn21(2));
921 checkEqual("22" + "de", multi.fn22("de"));
922 checkEqual(0.0, multi.att3);
923 multi.att3 = 0.3;
924 checkEqual(0.3, multi.att3);
925 checkEqual(31 * 3, multi.fn31(3));
926 checkEqual("32" + "f", multi.fn32("f"));
927 checkEqual(33, multi.fn33());
928 checkEqual(41 * 4, multi.fn41(4));
929 checkEqual(61 * 6, multi.fn61(6));
930 checkEqual("62" + "", multi.fn62(""));
931 checkEqual(71 * 7, multi.fn71(7));
932 checkEqual("72" + "g", multi.fn72("g"));
933 checkEqual(73, multi.fn73());
934 } catch (CheckFailed f) {
935 return f.Message;
937 return "";
940 public int RaiseAttr1
942 get { throw new RuntimeException(); }
943 set { throw new IllegalArgumentException(); }
946 public int RaiseAttr2
948 get { throw new IllegalArgumentException(); }
949 set { throw new IllegalArgumentException(); }