/* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
using System; using System.Diagnostics; using System.Threading; using System.Runtime.CompilerServices; using uno; using uno.util; using unoidl.com.sun.star.uno; using unoidl.com.sun.star.lang; using unoidl.test.testtools.bridgetest;
namespace cs_testobj
{
class CheckFailed: System.Exception { public CheckFailed(string message): base(message) {}
}
/* Attention: Debugging this code (probably in mixed mode) may lead to exceptions * which do not occur when running normally (Visual Studio 2003)
*/ publicvoid testConstructorsService(XComponentContext context)
{
Constructors.create1(context, true,
0x80, // -128 in C++,
Int16.MinValue,
UInt16.MaxValue,
Int32.MinValue,
UInt32.MaxValue,
Int64.MinValue,
UInt64.MaxValue,
0.123f,
0.456, 'X', "test", typeof(Any), new Any(true), newbool[] { true }, newbyte[] { 0x80}, // in C++ the value is compared with SAL_MIN_INT8 which is -128 newshort[] { Int16.MinValue }, new UInt16[] { UInt16.MaxValue }, new Int32[] {Int32.MinValue}, new UInt32[] { UInt32.MaxValue }, newlong[] { Int64.MinValue }, new UInt64[] { UInt64.MaxValue }, newfloat[] { 0.123f }, newdouble[] { 0.456 }, newchar[] { 'X' }, newstring[] { "test" }, new Type[] { typeof(Any) }, new Any[] { new Any(true) }, newbool[][] { newbool[] { true } }, new Any[][] { new Any[] { new Any(true) } }, new TestEnum[] { TestEnum.TWO }, new TestStruct[] { new TestStruct(10) }, new TestPolyStruct[] { new TestPolyStruct(true) }, new TestPolyStruct[] { new TestPolyStruct(new Any(true)) }, newobject[] { null },
TestEnum.TWO, new TestStruct(10), new TestPolyStruct(true), new TestPolyStruct(new Any(true)), null
);
Constructors.create2(context, new Any(true), new Any((System.Byte) 0x80), new Any(Int16.MinValue), new Any(UInt16.MaxValue), new Any(Int32.MinValue), new Any(UInt32.MaxValue), new Any(Int64.MinValue), new Any(UInt64.MaxValue), new Any(0.123f), new Any(0.456), new Any('X'), new Any("test"), new Any(typeof(Any)), new Any(true), new Any(typeof(bool[]), newbool[] { true }), new Any(typeof(byte[]), newbyte[] { (System.Byte) 0x80}), new Any(typeof(short[]), newshort[] { Int16.MinValue }), new Any(typeof(UInt16[]), new UInt16[] { UInt16.MaxValue }), new Any(typeof(int[]), newint[] { Int32.MinValue }), new Any(typeof(UInt32[]), new UInt32[] { UInt32.MaxValue }), new Any(typeof(long[]), newlong[] { Int64.MinValue }), new Any(typeof(UInt64[]), new UInt64[] { UInt64.MaxValue }), new Any(typeof(float[]), newfloat[] { 0.123f }), new Any(typeof(double[]), newdouble[] { 0.456 }), new Any(typeof(char[]), newchar[] { 'X' }), new Any(typeof(string[]), newstring[] { "test" }), new Any(typeof(Type[]), new Type[] { typeof(Any) }), new Any(typeof(Any[]), new Any[] { new Any(true) }), new Any(typeof(bool[][]), newbool[][] { newbool[] { true } }), new Any( typeof(Any[][]), new Any[][] { new Any[] { new Any(true) } }), new Any(typeof(TestEnum[]), new TestEnum[] { TestEnum.TWO }), new Any( typeof(TestStruct[]), new TestStruct[] { new TestStruct(10) }), new Any(
PolymorphicType.GetType( typeof(TestPolyStruct[]), "unoidl.test.testtools.bridgetest.TestPolyStruct[]"), new TestPolyStruct[] { new TestPolyStruct(true) }) , new Any(
PolymorphicType.GetType( typeof(TestPolyStruct[]), "unoidl.test.testtools.bridgetest.TestPolyStruct[]"), new TestPolyStruct[] { new TestPolyStruct(new Any(true)) }), new Any(typeof(object[])/*TODO*/, new object[] { null }), new Any(typeof(TestEnum), TestEnum.TWO), new Any(typeof(TestStruct), new TestStruct(10)), new Any(
PolymorphicType.GetType( typeof(TestPolyStruct), "unoidl.test.testtools.bridgetest.TestPolyStruct"), new TestPolyStruct(true)), new Any(
PolymorphicType.GetType( typeof(TestPolyStruct), "unoidl.test.testtools.bridgetest.TestPolyStruct"), new TestPolyStruct(new Any(true))), new Any(typeof(object), null)
);
XMultiBase1 xMulti = Constructors2.create1(
context, new TestPolyStruct(typeof(int)), new TestPolyStruct(new Any(true)), new TestPolyStruct(true), new TestPolyStruct((Byte) 0x80), new TestPolyStruct(Int16.MinValue), new TestPolyStruct(Int32.MinValue), new TestPolyStruct(Int64.MinValue), new TestPolyStruct('X'), new TestPolyStruct("test"), new TestPolyStruct(0.123f), new TestPolyStruct(0.456d), new TestPolyStruct(newobject()), new TestPolyStruct(new uno.util.WeakComponentBase()), new TestPolyStruct(TestEnum.TWO), new TestPolyStruct(new TestPolyStruct2('X', new Any(true))), new TestPolyStruct(new TestPolyStruct2(new TestPolyStruct2('X', new Any(true)), "test")), new TestPolyStruct2("test", new TestPolyStruct2('X', new TestPolyStruct(new Any(true)))), new TestPolyStruct2( new TestPolyStruct2('X', new Any(true)), new TestPolyStruct('X')), new TestPolyStruct(new Type[] { typeof(int)}), new TestPolyStruct(new Any[] { new Any(true) }), new TestPolyStruct(newbool[] {true}), new TestPolyStruct(newbyte[] {0x80}), new TestPolyStruct(newshort[] {Int16.MinValue}), new TestPolyStruct(newint[] {Int32.MinValue}), new TestPolyStruct(newlong[] {Int64.MinValue}), new TestPolyStruct(newchar[] {'X'}), new TestPolyStruct(newstring[] {"test"}), new TestPolyStruct(newfloat[] {0.123f}), new TestPolyStruct(newdouble[] {0.456d}), new TestPolyStruct(newobject[] {newobject()}), new TestPolyStruct(new unoidl.com.sun.star.lang.XComponent[] {new uno.util.WeakComponentBase()}), new TestPolyStruct(new TestEnum[] {TestEnum.TWO}), new TestPolyStruct(new TestPolyStruct2[] {new TestPolyStruct2('X', new Any[] {new Any(true)})}), new TestPolyStruct(new TestPolyStruct2[] { new TestPolyStruct2(new TestPolyStruct('X'), new Any[] {new Any(true)})}), new TestPolyStruct(newint[][] { newint[] {Int32.MinValue} }), new TestPolyStruct[]{ new TestPolyStruct(Int32.MinValue)}, new TestPolyStruct[]{new TestPolyStruct(new TestPolyStruct2('X', new Any(true)))}, new TestPolyStruct[]{new TestPolyStruct(new TestPolyStruct2(new TestPolyStruct2('X', new Any(true)), "test"))}, new TestPolyStruct2[]{new TestPolyStruct2("test", new TestPolyStruct2('X', new TestPolyStruct(new Any(true))))}, new TestPolyStruct2[]{new TestPolyStruct2(new TestPolyStruct2('X', new Any(true)),newTestPolyStruct('X'))}, new TestPolyStruct[][]{new TestPolyStruct[]{new TestPolyStruct('X')}}, new TestPolyStruct[][]{new TestPolyStruct[]{new TestPolyStruct(new TestPolyStruct2('X', new Any(true)))}}, new TestPolyStruct[][]{new TestPolyStruct[] {new TestPolyStruct(new TestPolyStruct2(new TestPolyStruct2('X',new Any(true)), "test"))}}, new TestPolyStruct2[][]{new TestPolyStruct2[]{new TestPolyStruct2("test", new TestPolyStruct2('X',new TestPolyStruct(new Any(true))))}}, new TestPolyStruct2[][]{new TestPolyStruct2[]{new TestPolyStruct2(new TestPolyStruct2('X',new Any(true)),new TestPolyStruct('X'))}}
);
//test the returned interface
xMulti.fn11(1);
}
public XCurrentContextChecker getCurrentContextChecker()
{ returnnull; //TODO: not yet tested in CLI UNO
}
public TestPolyStruct transportPolyBoolean(/*[in]*/TestPolyStruct arg)
{ return arg;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.