in main/testtools/source/bridgetest/cli/cli_cs_bridgetest.cs [622:860]
static bool performSequenceTest(XBridgeTest xBT)
{
bool bRet = true;
XBridgeTest2 xBT2 = xBT as XBridgeTest2;
if ( xBT2 == null)
return false;
// perform sequence tests (XBridgeTest2)
// create the sequence which are compared with the results
bool[] arBool = {true, false, true};
char[] arChar = {'A','B','C'};
byte[] arByte = { 1, 2, 0xff};
short[] arShort = {Int16.MinValue, 1, Int16.MaxValue};
UInt16[] arUShort = {UInt16.MinValue , 1, UInt16.MaxValue};
int[] arLong = {Int32.MinValue, 1, Int32.MaxValue};
UInt32[] arULong = {UInt32.MinValue, 1, UInt32.MaxValue};
long[] arHyper = {Int64.MinValue, 1, Int64.MaxValue};
UInt64[] arUHyper = {UInt64.MinValue, 1, UInt64.MaxValue};
float[] arFloat = {1.1f, 2.2f, 3.3f};
double[] arDouble = {1.11, 2.22, 3.33};
string[] arString = {"String 1", "String 2", "String 3"};
Any[] arAny = {new Any(true), new Any(11111), new Any(3.14)};
Object[] arObject = {new WeakBase(), new WeakBase(), new WeakBase()};
TestEnum[] arEnum = {TestEnum.ONE, TestEnum.TWO, TestEnum.CHECK};
TestElement[] arStruct = {new TestElement(), new TestElement(),
new TestElement()};
assign( arStruct[0], true, '@', 17, 0x1234, 0xfedc, 0x12345678, 0xfedcba98,
0x123456789abcdef0, 0xfedcba9876543210, 17.0815f, 3.1415926359,
TestEnum.LOLA, Constants.STRING_TEST_CONSTANT, arObject[0],
new Any( typeof(Object), arObject[0]) );
assign( arStruct[1], true, 'A', 17, 0x1234, 0xfedc, 0x12345678, 0xfedcba98,
0x123456789abcdef0, 0xfedcba9876543210, 17.0815f, 3.1415926359,
TestEnum.TWO, Constants.STRING_TEST_CONSTANT, arObject[1],
new Any( typeof(Object), arObject[1]) );
assign( arStruct[2], true, 'B', 17, 0x1234, 0xfedc, 0x12345678, 0xfedcba98,
0x123456789abcdef0, 0xfedcba9876543210, 17.0815f, 3.1415926359,
TestEnum.CHECK, Constants.STRING_TEST_CONSTANT, arObject[2],
new Any( typeof(Object), arObject[2] ) );
int[][][] arLong3 = new int[][][]{
new int[][]{new int[]{1,2,3},new int[]{4,5,6}, new int[]{7,8,9} },
new int [][]{new int[]{1,2,3},new int[]{4,5,6}, new int[]{7,8,9}},
new int[][]{new int[]{1,2,3},new int[]{4,5,6}, new int[]{7,8,9}}};
{
int[][] seqSeqRet = xBT2.setDim2(arLong3[0]);
bRet = check( compareData(seqSeqRet, arLong3[0]), "sequence test") && bRet;
int[][][] seqSeqRet2 = xBT2.setDim3(arLong3);
bRet = check( compareData(seqSeqRet2, arLong3), "sequence test") && bRet;
Any[] seqAnyRet = xBT2.setSequenceAny(arAny);
bRet = check( compareData(seqAnyRet, arAny), "sequence test") && bRet;
bool[] seqBoolRet = xBT2.setSequenceBool(arBool);
bRet = check( compareData(seqBoolRet, arBool), "sequence test") && bRet;
byte[] seqByteRet = xBT2.setSequenceByte(arByte);
bRet = check( compareData(seqByteRet, arByte), "sequence test") && bRet;
char[] seqCharRet = xBT2.setSequenceChar(arChar);
bRet = check( compareData(seqCharRet, arChar), "sequence test") && bRet;
short[] seqShortRet = xBT2.setSequenceShort(arShort);
bRet = check( compareData(seqShortRet, arShort), "sequence test") && bRet;
int[] seqLongRet = xBT2.setSequenceLong(arLong);
bRet = check( compareData(seqLongRet, arLong), "sequence test") && bRet;
long[] seqHyperRet = xBT2.setSequenceHyper(arHyper);
bRet = check( compareData(seqHyperRet,arHyper), "sequence test") && bRet;
float[] seqFloatRet = xBT2.setSequenceFloat(arFloat);
bRet = check( compareData(seqFloatRet, arFloat), "sequence test") && bRet;
double[] seqDoubleRet = xBT2.setSequenceDouble(arDouble);
bRet = check( compareData(seqDoubleRet, arDouble), "sequence test") && bRet;
TestEnum[] seqEnumRet = xBT2.setSequenceEnum(arEnum);
bRet = check( compareData(seqEnumRet, arEnum), "sequence test") && bRet;
UInt16[] seqUShortRet = xBT2.setSequenceUShort(arUShort);
bRet = check( compareData(seqUShortRet, arUShort), "sequence test") && bRet;
UInt32[] seqULongRet = xBT2.setSequenceULong(arULong);
bRet = check( compareData(seqULongRet, arULong), "sequence test") && bRet;
UInt64[] seqUHyperRet = xBT2.setSequenceUHyper(arUHyper);
bRet = check( compareData(seqUHyperRet, arUHyper), "sequence test") && bRet;
Object[] seqObjectRet = xBT2.setSequenceXInterface(arObject);
bRet = check( compareData(seqObjectRet, arObject), "sequence test") && bRet;
string[] seqStringRet = xBT2.setSequenceString(arString);
bRet = check( compareData(seqStringRet, arString), "sequence test") && bRet;
TestElement[] seqStructRet = xBT2.setSequenceStruct(arStruct);
bRet = check( compareData(seqStructRet, arStruct), "sequence test") && bRet;
}
{
bool[] arBoolTemp = (bool[]) arBool.Clone();
char[] arCharTemp = (char[]) arChar.Clone();
byte[] arByteTemp = (byte[]) arByte.Clone();
short[] arShortTemp = (short[]) arShort.Clone();
UInt16[] arUShortTemp = (UInt16[]) arUShort.Clone();
int[] arLongTemp = (int[]) arLong.Clone();
UInt32[] arULongTemp = (UInt32[]) arULong.Clone();
long[] arHyperTemp = (long[]) arHyper.Clone();
UInt64[] arUHyperTemp = (UInt64[]) arUHyper.Clone();
float[] arFloatTemp = (float[]) arFloat.Clone();
double[] arDoubleTemp = (double[]) arDouble.Clone();
TestEnum[] arEnumTemp = (TestEnum[]) arEnum.Clone();
string[] arStringTemp = (string[]) arString.Clone();
Object[] arObjectTemp = (Object[]) arObject.Clone();
Any[] arAnyTemp = (Any[]) arAny.Clone();
// make sure this are has the same contents as arLong3[0]
int[][] arLong2Temp = new int[][]{new int[]{1,2,3},new int[]{4,5,6}, new int[]{7,8,9} };
// make sure this are has the same contents as arLong3
int[][][] arLong3Temp = new int[][][]{
new int[][]{new int[]{1,2,3},new int[]{4,5,6}, new int[]{7,8,9} },
new int [][]{new int[]{1,2,3},new int[]{4,5,6}, new int[]{7,8,9}},
new int[][]{new int[]{1,2,3},new int[]{4,5,6}, new int[]{7,8,9}}};
xBT2.setSequencesInOut(ref arBoolTemp, ref arCharTemp, ref arByteTemp,
ref arShortTemp, ref arUShortTemp, ref arLongTemp,
ref arULongTemp,ref arHyperTemp, ref arUHyperTemp,
ref arFloatTemp,ref arDoubleTemp, ref arEnumTemp,
ref arStringTemp, ref arObjectTemp,
ref arAnyTemp, ref arLong2Temp, ref arLong3Temp);
bRet = check(
compareData(arBoolTemp, arBool) &&
compareData(arCharTemp , arChar) &&
compareData(arByteTemp , arByte) &&
compareData(arShortTemp , arShort) &&
compareData(arUShortTemp , arUShort) &&
compareData(arLongTemp , arLong) &&
compareData(arULongTemp , arULong) &&
compareData(arHyperTemp , arHyper) &&
compareData(arUHyperTemp , arUHyper) &&
compareData(arFloatTemp , arFloat) &&
compareData(arDoubleTemp , arDouble) &&
compareData(arEnumTemp , arEnum) &&
compareData(arStringTemp , arString) &&
compareData(arObjectTemp , arObject) &&
compareData(arAnyTemp , arAny) &&
compareData(arLong2Temp , arLong3[0]) &&
compareData(arLong3Temp , arLong3), "sequence test") && bRet;
bool[] arBoolOut;
char[] arCharOut;
byte[] arByteOut;
short[] arShortOut;
UInt16[] arUShortOut;
int[] arLongOut;
UInt32[] arULongOut;
long[] arHyperOut;
UInt64[] arUHyperOut;
float[] arFloatOut;
double[] arDoubleOut;
TestEnum[] arEnumOut;
string[] arStringOut;
Object[] arObjectOut;
Any[] arAnyOut;
int[][] arLong2Out;
int[][][] arLong3Out;
xBT2.setSequencesOut(out arBoolOut, out arCharOut, out arByteOut,
out arShortOut, out arUShortOut, out arLongOut,
out arULongOut, out arHyperOut, out arUHyperOut,
out arFloatOut, out arDoubleOut, out arEnumOut,
out arStringOut, out arObjectOut, out arAnyOut,
out arLong2Out, out arLong3Out);
bRet = check(
compareData(arBoolOut, arBool) &&
compareData(arCharOut, arChar) &&
compareData(arByteOut, arByte) &&
compareData(arShortOut, arShort) &&
compareData(arUShortOut, arUShort) &&
compareData(arLongOut, arLong) &&
compareData(arULongOut, arULong) &&
compareData(arHyperOut, arHyper) &&
compareData(arUHyperOut, arUHyper) &&
compareData(arFloatOut, arFloat) &&
compareData(arDoubleOut, arDouble) &&
compareData(arEnumOut, arEnum) &&
compareData(arStringOut, arString) &&
compareData(arObjectOut, arObject) &&
compareData(arAnyOut, arAny) &&
compareData(arLong2Out, arLong3[0]) &&
compareData(arLong3Out, arLong3), "sequence test") && bRet;
}
{
//test with empty sequences
int[][] _arLong2 = new int[0][];
int[][] seqSeqRet = xBT2.setDim2(_arLong2);
bRet = check( compareData(seqSeqRet, _arLong2), "sequence test") && bRet;
int[][][] _arLong3 = new int[0][][];
int[][][] seqSeqRet2 = xBT2.setDim3(_arLong3);
bRet = check( compareData(seqSeqRet2, _arLong3), "sequence test") && bRet;
Any[] _arAny = new Any[0];
Any[] seqAnyRet = xBT2.setSequenceAny(_arAny);
bRet = check( compareData(seqAnyRet, _arAny), "sequence test") && bRet;
bool[] _arBool = new bool[0];
bool[] seqBoolRet = xBT2.setSequenceBool(_arBool);
bRet = check( compareData(seqBoolRet, _arBool), "sequence test") && bRet;
byte[] _arByte = new byte[0];
byte[] seqByteRet = xBT2.setSequenceByte(_arByte);
bRet = check( compareData(seqByteRet, _arByte), "sequence test") && bRet;
char[] _arChar = new char[0];
char[] seqCharRet = xBT2.setSequenceChar(_arChar);
bRet = check( compareData(seqCharRet, _arChar), "sequence test") && bRet;
short[] _arShort = new short[0];
short[] seqShortRet = xBT2.setSequenceShort(_arShort);
bRet = check( compareData(seqShortRet, _arShort), "sequence test") && bRet;
int[] _arLong = new int[0];
int[] seqLongRet = xBT2.setSequenceLong(_arLong);
bRet = check( compareData(seqLongRet, _arLong), "sequence test") && bRet;
long[] _arHyper = new long[0];
long[] seqHyperRet = xBT2.setSequenceHyper(_arHyper);
bRet = check( compareData(seqHyperRet, _arHyper), "sequence test") && bRet;
float[] _arFloat = new float[0];
float[] seqFloatRet = xBT2.setSequenceFloat(_arFloat);
bRet = check( compareData(seqFloatRet, _arFloat), "sequence test") && bRet;
double[] _arDouble = new double[0];
double[] seqDoubleRet = xBT2.setSequenceDouble(_arDouble);
bRet = check( compareData(seqDoubleRet, _arDouble), "sequence test") && bRet;
TestEnum[] _arEnum = new TestEnum[0];
TestEnum[] seqEnumRet = xBT2.setSequenceEnum(_arEnum);
bRet = check( compareData(seqEnumRet, _arEnum), "sequence test") && bRet;
UInt16[] _arUShort = new UInt16[0];
UInt16[] seqUShortRet = xBT2.setSequenceUShort(_arUShort);
bRet = check( compareData(seqUShortRet, _arUShort), "sequence test") && bRet;
UInt32[] _arULong = new UInt32[0];
UInt32[] seqULongRet = xBT2.setSequenceULong(_arULong);
bRet = check( compareData(seqULongRet, _arULong), "sequence test") && bRet;
UInt64[] _arUHyper = new UInt64[0];
UInt64[] seqUHyperRet = xBT2.setSequenceUHyper(_arUHyper);
bRet = check( compareData(seqUHyperRet, _arUHyper), "sequence test") && bRet;
Object[] _arObject = new Object[0];
Object[] seqObjectRet = xBT2.setSequenceXInterface(_arObject);
bRet = check( compareData(seqObjectRet, _arObject), "sequence test") && bRet;
string[] _arString = new string[0];
string[] seqStringRet = xBT2.setSequenceString(_arString);
bRet = check( compareData(seqStringRet, _arString), "sequence test") && bRet;
TestElement[] _arStruct = new TestElement[0];
TestElement[] seqStructRet = xBT2.setSequenceStruct(_arStruct);
bRet = check( compareData(seqStructRet, _arStruct), "sequence test") && bRet;
}
return bRet;
}