コード例 #1
0
 public IdlArrayContainer EchoIdlArrayContainer(IdlArrayContainer arrayContainer) {
     return arrayContainer;            
 }
コード例 #2
0
        public void TestIdlArrayInsideStruct() {
            IdlArrayContainer container = new IdlArrayContainer();
            container.OneDimIntArray5 = new int[] { 1, 2, 3, 4, 5 };
            container.TwoDimIntArray2x2 = new int[,] { { 1, 2 }, { 3, 4 } };
            IdlArrayContainer result = m_testService.EchoIdlArrayContainer(container);
            Assertion.AssertEquals(container.OneDimIntArray5.Length, result.OneDimIntArray5.Length);
            Assertion.AssertEquals(container.TwoDimIntArray2x2.GetLength(0), result.TwoDimIntArray2x2.GetLength(0));
            Assertion.AssertEquals(container.TwoDimIntArray2x2.GetLength(1), result.TwoDimIntArray2x2.GetLength(1));

            for (int i = 0; i < container.OneDimIntArray5.Length; i++) {
                Assertion.AssertEquals(container.OneDimIntArray5[i], result.OneDimIntArray5[i]);
            }

            for (int i = 0; i < container.TwoDimIntArray2x2.GetLength(0); i++) {
                for (int j = 0; j < container.TwoDimIntArray2x2.GetLength(1); j++) {
                    Assertion.AssertEquals(container.TwoDimIntArray2x2[i,j], result.TwoDimIntArray2x2[i,j]);
                }                
            }            
        }
コード例 #3
0
        public void TestIdlArraysAsAny() {
            IdlArrayContainer container = new IdlArrayContainer();
            container.OneDimIntArray5 = new int[] { 1, 2, 3, 4, 5 };
            container.TwoDimIntArray2x2 = new int[,] { { 1, 2 }, { 3, 4 } };
            IdlArrayContainer result = 
                (IdlArrayContainer)m_testService.EchoAnything(container);
            Assertion.AssertEquals(container.OneDimIntArray5.Length, result.OneDimIntArray5.Length);
            Assertion.AssertEquals(container.TwoDimIntArray2x2.GetLength(0), result.TwoDimIntArray2x2.GetLength(0));
            Assertion.AssertEquals(container.TwoDimIntArray2x2.GetLength(1), result.TwoDimIntArray2x2.GetLength(1));

            for (int i = 0; i < container.OneDimIntArray5.Length; i++) {
                Assertion.AssertEquals(container.OneDimIntArray5[i], result.OneDimIntArray5[i]);
            }

            for (int i = 0; i < container.TwoDimIntArray2x2.GetLength(0); i++) {
                for (int j = 0; j < container.TwoDimIntArray2x2.GetLength(1); j++) {
                    Assertion.AssertEquals(container.TwoDimIntArray2x2[i,j], result.TwoDimIntArray2x2[i,j]);
                }                
            }

            // test with any container
            int[] arg1Dim = new int[] { 1, 2, 3, 4, 5 };
            int[] result1Dim = (int[])m_testService.RetrieveIdlIntArrayAsAny(arg1Dim);
            for (int i = 0; i < arg1Dim.Length; i++) {
                Assertion.AssertEquals(arg1Dim[i], result1Dim[i]);
            }
            

            int[,] arg2Dim = new int[,] { { 1,2 }, {3, 4} };
            int[,] result2Dim = (int[,])m_testService.RetrieveIdlInt2DimArray2x2AsAny(arg2Dim);
            for (int i = 0; i < arg2Dim.GetLength(0); i++) {
                for (int j = 0; j < arg2Dim.GetLength(1); j++) {
                    Assertion.AssertEquals(arg2Dim[i,j], result2Dim[i,j]);
                }                
            }            

            int[,,] arg3Dim = new int[2,2,3];
            arg3Dim[0,0,0] = 1;
            arg3Dim[0,0,1] = 2;
            arg3Dim[0,0,2] = 3;
            arg3Dim[0,1,0] = 4;
            arg3Dim[0,1,1] = 5;
            arg3Dim[0,1,2] = 6;
            arg3Dim[1,0,0] = 7;
            arg3Dim[1,0,1] = 8;
            arg3Dim[1,0,2] = 9;
            arg3Dim[1,1,0] = 10;
            arg3Dim[1,1,1] = 11;
            arg3Dim[1,1,2] = 12;
            int[,,] result3Dim = (int[,,])m_testService.RetrieveIdlInt3DimArray2x2x3AsAny(arg3Dim);
            Assertion.AssertEquals(arg3Dim.GetLength(0), result3Dim.GetLength(0));
            Assertion.AssertEquals(arg3Dim.GetLength(1), result3Dim.GetLength(1));
            Assertion.AssertEquals(arg3Dim.GetLength(2), result3Dim.GetLength(2));
            for (int i = 0; i < arg3Dim.GetLength(0); i++) {
                for (int j = 0; j < arg3Dim.GetLength(1); j++) {
                    for (int k = 0; k < arg3Dim.GetLength(2); k++) {
                        Assertion.AssertEquals(arg3Dim[i,j,k], result3Dim[i,j,k]);
                    }
                }                
            }            
        }
コード例 #4
0
 public IdlArrayContainer EchoIdlArrayContainer(IdlArrayContainer arrayContainer)
 {
     return(arrayContainer);
 }