Esempio n. 1
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));
    }
    static bool RunTest2(string report)
    {
        C_INTArray_Seq c1 = new C_INTArray_Seq();

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

        C_UINTArray_Seq c2 = new C_UINTArray_Seq();

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

        C_SHORTArray_Seq c3 = new C_SHORTArray_Seq();

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

        C_WORDArray_Seq c4 = new C_WORDArray_Seq();

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

        C_LONG64Array_Seq c5 = new C_LONG64Array_Seq();

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

        C_ULONG64Array_Seq c6 = new C_ULONG64Array_Seq();

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

        C_DOUBLEArray_Seq c7 = new C_DOUBLEArray_Seq();

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

        C_FLOATArray_Seq c8 = new C_FLOATArray_Seq();

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

        C_BYTEArray_Seq c9 = new C_BYTEArray_Seq();

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

        C_CHARArray_Seq c10 = new C_CHARArray_Seq();

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

        C_LPSTRArray_Seq c11 = new C_LPSTRArray_Seq();

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

        C_LPCSTRArray_Seq c12 = new C_LPCSTRArray_Seq();

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

#if NONWINDOWS_BUG
        C_StructArray_Seq c14 = new C_StructArray_Seq();
        c14.arr = InitStructArray(ARRAY_SIZE);
        TestHelper.Assert(TakeStructArraySeqClassByVal(c14, c14.arr.Length));
#endif
        return(true);
    }
Esempio n. 3
0
 static extern bool TakeLPCSTRArraySeqClassByVal([In] C_LPCSTRArray_Seq s, int size);
Esempio 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");
    }