示例#1
0
    static void testLPStrBufferStruct()
    {
        LPStrTestStruct_nothrow lpss_nt = GetInvalidStruct_nothrow();

        Assert.IsTrue(LPStrBuffer_In_Struct_String_nothrow(lpss_nt), "[Error] Location tlpsbst1");

        lpss_nt = GetValidStruct_nothrow();
        Assert.IsTrue(LPStrBuffer_In_Struct_String_nothrow(lpss_nt), "[Error] Location tlpsbst2");

        LPStrTestStruct lpss = GetInvalidStruct();

        Assert.IsTrue(LPStrBuffer_In_Struct_String(lpss), "[Error] Location tlpsbst3");
        Assert.IsTrue(LPStrBuffer_In_Struct_String(GetValidStruct()), "[Error] Location tlpsbst4");

        lpss = GetInvalidStruct();
        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst5");

        lpss = GetValidStruct();
        Assert.IsTrue(LPStrBuffer_InByRef_Struct_String(ref lpss), "[Error] Location tlpsbst6");

        lpss = GetInvalidStruct();
        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst7");

        lpss = GetValidStruct();
        Assert.IsTrue(LPStrBuffer_InOutByRef_Struct_String(ref lpss), "[Error] Location tlpsbst8");
    }
示例#2
0
    static void testLPStrBufferStruct()
    {
        LPStrTestStruct_nothrow lpss_nt = GetInvalidStruct_nothrow();

        Assert.True(LPStrBuffer_In_Struct_String_nothrow(lpss_nt));

        lpss_nt = GetValidStruct_nothrow();
        Assert.True(LPStrBuffer_In_Struct_String_nothrow(lpss_nt));

        LPStrTestStruct lpss = GetInvalidStruct();

        Assert.True(LPStrBuffer_In_Struct_String(lpss));
        Assert.True(LPStrBuffer_In_Struct_String(GetValidStruct()));

        lpss = GetInvalidStruct();
        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));

        lpss = GetValidStruct();
        Assert.True(LPStrBuffer_InByRef_Struct_String(ref lpss));

        lpss = GetInvalidStruct();
        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));

        lpss = GetValidStruct();
        Assert.True(LPStrBuffer_InOutByRef_Struct_String(ref lpss));
    }
示例#3
0
    static LPStrTestStruct_nothrow GetValidStruct_nothrow()
    {
        LPStrTestStruct_nothrow validStruct = new LPStrTestStruct_nothrow();

        validStruct.str = GetValidString();

        return(validStruct);
    }
示例#4
0
    static LPStrTestStruct_nothrow GetInvalidStruct_nothrow()
    {
        LPStrTestStruct_nothrow inValidStruct = new LPStrTestStruct_nothrow();

        inValidStruct.str = GetInvalidString();

        return(inValidStruct);
    }
示例#5
0
 public static extern bool LPStrBuffer_In_Struct_String_nothrow([In][MarshalAs(UnmanagedType.Struct)] LPStrTestStruct_nothrow strStruct);