Ejemplo n.º 1
0
    static void RunTest5(string report)
    {
        Console.WriteLine(report);

        C_INTArray_Seq retval1 = S_INTArray_Ret();

        Assert.IsTrue(Equals(InitArray <int>(ARRAY_SIZE), retval1.arr));

        C_UINTArray_Seq retval2 = S_UINTArray_Ret();

        Assert.IsTrue(Equals(InitArray <uint>(ARRAY_SIZE), retval2.arr));

        C_SHORTArray_Seq retval3 = S_SHORTArray_Ret();

        Assert.IsTrue(Equals(InitArray <short>(ARRAY_SIZE), retval3.arr));

        C_WORDArray_Seq retval4 = S_WORDArray_Ret();

        Assert.IsTrue(Equals(InitArray <ushort>(ARRAY_SIZE), retval4.arr));

        C_LONG64Array_Seq retval5 = S_LONG64Array_Ret();

        Assert.IsTrue(Equals(InitArray <long>(ARRAY_SIZE), retval5.arr));

        C_ULONG64Array_Seq retval6 = S_ULONG64Array_Ret();

        Assert.IsTrue(Equals(InitArray <ulong>(ARRAY_SIZE), retval6.arr));

        C_DOUBLEArray_Seq retval7 = S_DOUBLEArray_Ret();

        Assert.IsTrue(Equals(InitArray <double>(ARRAY_SIZE), retval7.arr));

        C_FLOATArray_Seq retval8 = S_FLOATArray_Ret();

        Assert.IsTrue(Equals(InitArray <float>(ARRAY_SIZE), retval8.arr));

        C_BYTEArray_Seq retval9 = S_BYTEArray_Ret();

        Assert.IsTrue(Equals(InitArray <byte>(ARRAY_SIZE), retval9.arr));

        C_CHARArray_Seq retval10 = S_CHARArray_Ret();

        Assert.IsTrue(Equals(InitArray <char>(ARRAY_SIZE), retval10.arr));

        C_LPSTRArray_Seq retval11 = S_LPSTRArray_Ret();

        Assert.IsTrue(Equals(InitArray <string>(ARRAY_SIZE), retval11.arr));

        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
        {
            C_BSTRArray_Seq retval12 = S_BSTRArray_Ret();
            Assert.IsTrue(Equals(InitArray <string>(ARRAY_SIZE), retval12.arr));
        }

        C_StructArray_Seq retval13 = S_StructArray_Ret();

        Assert.IsTrue(TestStructEquals(InitStructArray(ARRAY_SIZE), retval13.arr));
    }
Ejemplo n.º 2
0
    static void RunTest2(string report)
    {
        Console.WriteLine(report);

        C_INTArray_Seq c1 = new C_INTArray_Seq();

        c1.arr = InitArray <int>(ARRAY_SIZE);
        Assert.IsTrue(TakeIntArraySeqClassByVal(c1, c1.arr.Length));

        C_UINTArray_Seq c2 = new C_UINTArray_Seq();

        c2.arr = InitArray <uint>(ARRAY_SIZE);
        Assert.IsTrue(TakeUIntArraySeqClassByVal(c2, c2.arr.Length));

        C_SHORTArray_Seq c3 = new C_SHORTArray_Seq();

        c3.arr = InitArray <short>(ARRAY_SIZE);
        Assert.IsTrue(TakeShortArraySeqClassByVal(c3, c3.arr.Length));

        C_WORDArray_Seq c4 = new C_WORDArray_Seq();

        c4.arr = InitArray <ushort>(ARRAY_SIZE);
        Assert.IsTrue(TakeWordArraySeqClassByVal(c4, c4.arr.Length));

        C_LONG64Array_Seq c5 = new C_LONG64Array_Seq();

        c5.arr = InitArray <long>(ARRAY_SIZE);
        Assert.IsTrue(TakeLong64ArraySeqClassByVal(c5, c5.arr.Length));

        C_ULONG64Array_Seq c6 = new C_ULONG64Array_Seq();

        c6.arr = InitArray <ulong>(ARRAY_SIZE);
        Assert.IsTrue(TakeULong64ArraySeqClassByVal(c6, c6.arr.Length));

        C_DOUBLEArray_Seq c7 = new C_DOUBLEArray_Seq();

        c7.arr = InitArray <double>(ARRAY_SIZE);
        Assert.IsTrue(TakeDoubleArraySeqClassByVal(c7, c7.arr.Length));

        C_FLOATArray_Seq c8 = new C_FLOATArray_Seq();

        c8.arr = InitArray <float>(ARRAY_SIZE);
        Assert.IsTrue(TakeFloatArraySeqClassByVal(c8, c8.arr.Length));

        C_BYTEArray_Seq c9 = new C_BYTEArray_Seq();

        c9.arr = InitArray <byte>(ARRAY_SIZE);
        Assert.IsTrue(TakeByteArraySeqClassByVal(c9, c9.arr.Length));

        C_CHARArray_Seq c10 = new C_CHARArray_Seq();

        c10.arr = InitArray <char>(ARRAY_SIZE);
        Assert.IsTrue(TakeCharArraySeqClassByVal(c10, c10.arr.Length));

        C_LPSTRArray_Seq c11 = new C_LPSTRArray_Seq();

        c11.arr = InitArray <string>(ARRAY_SIZE);
        Assert.IsTrue(TakeLPSTRArraySeqClassByVal(c11, c11.arr.Length));

        C_LPCSTRArray_Seq c12 = new C_LPCSTRArray_Seq();

        c12.arr = InitArray <string>(ARRAY_SIZE);
        Assert.IsTrue(TakeLPCSTRArraySeqClassByVal(c12, c12.arr.Length));

        if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
        {
            C_BSTRArray_Seq c13 = new C_BSTRArray_Seq();
            c13.arr = InitArray <string>(ARRAY_SIZE);
            Assert.IsTrue(TakeBSTRArraySeqClassByVal(c13, c13.arr.Length));
        }

        C_StructArray_Seq c14 = new C_StructArray_Seq();

        c14.arr = InitStructArray(ARRAY_SIZE);
        Assert.IsTrue(TakeStructArraySeqClassByVal(c14, c14.arr.Length));
    }
Ejemplo n.º 3
0
 static extern bool TakeBSTRArraySeqClassByVal([In] C_BSTRArray_Seq s, int size);
Ejemplo n.º 4
0
    static void RunTest2(string report)
    {
        Console.WriteLine(report);
        C_INTArray_Seq c1 = new C_INTArray_Seq();

        c1.arr = InitArray <int>(ARRAY_SIZE);
        Assert.Throws <TypeLoadException>(() => TakeIntArraySeqClassByVal(c1, ARRAY_SIZE), "TakeIntArraySeqClassByVal");

        C_UINTArray_Seq c2 = new C_UINTArray_Seq();

        c2.arr = InitArray <uint>(ARRAY_SIZE);
        Assert.Throws <TypeLoadException>(() => TakeUIntArraySeqClassByVal(c2, ARRAY_SIZE), "TakeUIntArraySeqClassByVal");

        C_SHORTArray_Seq c3 = new C_SHORTArray_Seq();

        c3.arr = InitArray <short>(ARRAY_SIZE);
        Assert.Throws <TypeLoadException>(() => TakeShortArraySeqClassByVal(c3, ARRAY_SIZE), "TakeShortArraySeqClassByVal");

        C_WORDArray_Seq c4 = new C_WORDArray_Seq();

        c4.arr = InitArray <ushort>(ARRAY_SIZE);
        Assert.Throws <TypeLoadException>(() => TakeWordArraySeqClassByVal(c4, ARRAY_SIZE), "TakeWordArraySeqClassByVal");

        C_LONG64Array_Seq c5 = new C_LONG64Array_Seq();

        c5.arr = InitArray <long>(ARRAY_SIZE);
        Assert.Throws <TypeLoadException>(() => TakeLong64ArraySeqClassByVal(c5, ARRAY_SIZE), "TakeLong64ArraySeqClassByVal");

        C_ULONG64Array_Seq c6 = new C_ULONG64Array_Seq();

        c6.arr = InitArray <ulong>(ARRAY_SIZE);
        Assert.Throws <TypeLoadException>(() => TakeULong64ArraySeqClassByVal(c6, ARRAY_SIZE), "TakeULong64ArraySeqClassByVal");

        C_DOUBLEArray_Seq c7 = new C_DOUBLEArray_Seq();

        c7.arr = InitArray <double>(ARRAY_SIZE);
        Assert.Throws <TypeLoadException>(() => TakeDoubleArraySeqClassByVal(c7, ARRAY_SIZE), "TakeDoubleArraySeqClassByVal");

        C_FLOATArray_Seq c8 = new C_FLOATArray_Seq();

        c8.arr = InitArray <float>(ARRAY_SIZE);
        Assert.Throws <TypeLoadException>(() => TakeFloatArraySeqClassByVal(c8, ARRAY_SIZE), "TakeFloatArraySeqClassByVal");

        C_BYTEArray_Seq c9 = new C_BYTEArray_Seq();

        c9.arr = InitArray <byte>(ARRAY_SIZE);
        Assert.Throws <TypeLoadException>(() => TakeByteArraySeqClassByVal(c9, ARRAY_SIZE), "TakeByteArraySeqClassByVal");

        C_CHARArray_Seq c10 = new C_CHARArray_Seq();

        c10.arr = InitArray <char>(ARRAY_SIZE);
        Assert.Throws <TypeLoadException>(() => TakeCharArraySeqClassByVal(c10, ARRAY_SIZE), "TakeCharArraySeqClassByVal");

        C_LPSTRArray_Seq c11 = new C_LPSTRArray_Seq();

        c11.arr = InitArray <string>(ARRAY_SIZE);
        Assert.Throws <TypeLoadException>(() => TakeLPSTRArraySeqClassByVal(c11, ARRAY_SIZE), "TakeLPSTRArraySeqClassByVal");

        C_LPCSTRArray_Seq c12 = new C_LPCSTRArray_Seq();

        c12.arr = InitArray <string>(ARRAY_SIZE);
        Assert.Throws <TypeLoadException>(() => TakeLPCSTRArraySeqClassByVal(c12, ARRAY_SIZE), "TakeLPCSTRArraySeqClassByVal");

        if (OperatingSystem.IsWindows())
        {
            C_BSTRArray_Seq c13 = new C_BSTRArray_Seq();
            c13.arr = InitArray <string>(ARRAY_SIZE);
            Assert.Throws <TypeLoadException>(() => TakeBSTRArraySeqClassByVal(c13, ARRAY_SIZE), "TakeBSTRArraySeqClassByVal");
        }

        C_StructArray_Seq c14 = new C_StructArray_Seq();

        c14.arr = InitStructArray(ARRAY_SIZE);
        Assert.Throws <TypeLoadException>(() => TakeStructArraySeqClassByVal(c14, ARRAY_SIZE), "TakeStructArraySeqClassByVal");
    }