Skip to content

Commit

Permalink
Fixing some tests to match the new libClang output for array types
Browse files Browse the repository at this point in the history
  • Loading branch information
tannergooding committed Apr 3, 2022
1 parent 6220678 commit 64042a7
Show file tree
Hide file tree
Showing 24 changed files with 118 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace ClangSharp.Test
public static unsafe partial class Methods
{
[DllImport(""ClangSharpPInvokeGenerator"", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void MyFunction([NativeTypeName(""const float [4]"")] float* color);
public static extern void MyFunction([NativeTypeName(""const float[4]"")] float* color);
}
}
";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public partial struct MyStruct
public partial struct MyOtherStruct
{{
[NativeTypeName(""MyStruct [3]"")]
[NativeTypeName(""MyStruct[3]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -379,7 +379,7 @@ public partial struct MyStruct
public partial struct MyOtherStruct
{{
[NativeTypeName(""MyStruct [2][1][3][4]"")]
[NativeTypeName(""MyStruct[2][1][3][4]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -512,7 +512,7 @@ public partial struct MyStruct
public partial struct MyOtherStruct
{{
[NativeTypeName(""MyStruct [3]"")]
[NativeTypeName(""MyStruct[3]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -590,7 +590,7 @@ protected override Task FixedSizedBufferPrimitiveTestImpl(string nativeType, str
{{
public unsafe partial struct MyStruct
{{
[NativeTypeName(""{nativeType} [3]"")]
[NativeTypeName(""{nativeType}[3]"")]
public fixed {expectedManagedType} c[3];
}}
}}
Expand All @@ -611,7 +611,7 @@ protected override Task FixedSizedBufferPrimitiveMultidimensionalTestImpl(string
{{
public unsafe partial struct MyStruct
{{
[NativeTypeName(""{nativeType} [2][1][3][4]"")]
[NativeTypeName(""{nativeType}[2][1][3][4]"")]
public fixed {expectedManagedType} c[2 * 1 * 3 * 4];
}}
}}
Expand Down Expand Up @@ -968,10 +968,10 @@ public unsafe partial struct _Anonymous_e__Struct
public MyUnion u;
[NativeTypeName(""{nativeType} [4]"")]
[NativeTypeName(""{nativeType}[4]"")]
public fixed {expectedManagedType} buffer1[4];
[NativeTypeName(""MyUnion [4]"")]
[NativeTypeName(""MyUnion[4]"")]
public _buffer2_e__FixedBuffer buffer2;
public partial struct _w_e__Struct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ public partial struct MyUnion
public partial struct MyOtherUnion
{{
[FieldOffset(0)]
[NativeTypeName(""MyUnion [3]"")]
[NativeTypeName(""MyUnion[3]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -420,7 +420,7 @@ public partial struct MyUnion
public partial struct MyOtherUnion
{{
[FieldOffset(0)]
[NativeTypeName(""MyUnion [2][1][3][4]"")]
[NativeTypeName(""MyUnion[2][1][3][4]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -565,7 +565,7 @@ public partial struct MyUnion
public partial struct MyOtherUnion
{{
[FieldOffset(0)]
[NativeTypeName(""MyUnion [3]"")]
[NativeTypeName(""MyUnion[3]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -651,7 +651,7 @@ namespace ClangSharp.Test
public unsafe partial struct MyUnion
{{
[FieldOffset(0)]
[NativeTypeName(""{nativeType} [3]"")]
[NativeTypeName(""{nativeType}[3]"")]
public fixed {expectedManagedType} c[3];
}}
}}
Expand All @@ -676,7 +676,7 @@ namespace ClangSharp.Test
public unsafe partial struct MyUnion
{{
[FieldOffset(0)]
[NativeTypeName(""{nativeType} [2][1][3][4]"")]
[NativeTypeName(""{nativeType}[2][1][3][4]"")]
public fixed {expectedManagedType} c[2 * 1 * 3 * 4];
}}
}}
Expand Down Expand Up @@ -857,7 +857,7 @@ public unsafe partial struct _Anonymous_e__Union
public MyStruct s;
[FieldOffset(0)]
[NativeTypeName(""{nativeType} [4]"")]
[NativeTypeName(""{nativeType}[4]"")]
public fixed {expectedManagedType} buffer[4];
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ namespace ClangSharp.Test
{{
public static partial class Methods
{{
[NativeTypeName(""const char [5]"")]
[NativeTypeName(""const char[5]"")]
public static ReadOnlySpan<byte> MyConst1 => new byte[] {{ 0x54, 0x65, 0x73, 0x74, 0x00 }};
}}
}}
Expand Down Expand Up @@ -278,7 +278,7 @@ protected override Task MultidimensionlArrayTestImpl()
{{
public static partial class Methods
{{
[NativeTypeName(""const int [2][2]"")]
[NativeTypeName(""const int[2][2]"")]
public static readonly int[][] MyArray = new int[2][]
{{
new int[2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace ClangSharp.Test
public static unsafe partial class Methods
{
[DllImport(""ClangSharpPInvokeGenerator"", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void MyFunction([NativeTypeName(""const float [4]"")] float* color);
public static extern void MyFunction([NativeTypeName(""const float[4]"")] float* color);
}
}
";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ public partial struct MyStruct
public partial struct MyOtherStruct
{{
[NativeTypeName(""MyStruct [3]"")]
[NativeTypeName(""MyStruct[3]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -383,7 +383,7 @@ public partial struct MyStruct
public partial struct MyOtherStruct
{{
[NativeTypeName(""MyStruct [2][1][3][4]"")]
[NativeTypeName(""MyStruct[2][1][3][4]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -516,7 +516,7 @@ public partial struct MyStruct
public partial struct MyOtherStruct
{{
[NativeTypeName(""MyStruct [3]"")]
[NativeTypeName(""MyStruct[3]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -594,7 +594,7 @@ protected override Task FixedSizedBufferPrimitiveTestImpl(string nativeType, str
{{
public unsafe partial struct MyStruct
{{
[NativeTypeName(""{nativeType} [3]"")]
[NativeTypeName(""{nativeType}[3]"")]
public fixed {expectedManagedType} c[3];
}}
}}
Expand All @@ -615,7 +615,7 @@ protected override Task FixedSizedBufferPrimitiveMultidimensionalTestImpl(string
{{
public unsafe partial struct MyStruct
{{
[NativeTypeName(""{nativeType} [2][1][3][4]"")]
[NativeTypeName(""{nativeType}[2][1][3][4]"")]
public fixed {expectedManagedType} c[2 * 1 * 3 * 4];
}}
}}
Expand Down Expand Up @@ -972,10 +972,10 @@ public unsafe partial struct _Anonymous_e__Struct
public MyUnion u;
[NativeTypeName(""{nativeType} [4]"")]
[NativeTypeName(""{nativeType}[4]"")]
public fixed {expectedManagedType} buffer1[4];
[NativeTypeName(""MyUnion [4]"")]
[NativeTypeName(""MyUnion[4]"")]
public _buffer2_e__FixedBuffer buffer2;
public partial struct _w_e__Struct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ public partial struct MyUnion
public partial struct MyOtherUnion
{{
[FieldOffset(0)]
[NativeTypeName(""MyUnion [3]"")]
[NativeTypeName(""MyUnion[3]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -427,7 +427,7 @@ public partial struct MyUnion
public partial struct MyOtherUnion
{{
[FieldOffset(0)]
[NativeTypeName(""MyUnion [2][1][3][4]"")]
[NativeTypeName(""MyUnion[2][1][3][4]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -572,7 +572,7 @@ public partial struct MyUnion
public partial struct MyOtherUnion
{{
[FieldOffset(0)]
[NativeTypeName(""MyUnion [3]"")]
[NativeTypeName(""MyUnion[3]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -658,7 +658,7 @@ namespace ClangSharp.Test
public unsafe partial struct MyUnion
{{
[FieldOffset(0)]
[NativeTypeName(""{nativeType} [3]"")]
[NativeTypeName(""{nativeType}[3]"")]
public fixed {expectedManagedType} c[3];
}}
}}
Expand All @@ -683,7 +683,7 @@ namespace ClangSharp.Test
public unsafe partial struct MyUnion
{{
[FieldOffset(0)]
[NativeTypeName(""{nativeType} [2][1][3][4]"")]
[NativeTypeName(""{nativeType}[2][1][3][4]"")]
public fixed {expectedManagedType} c[2 * 1 * 3 * 4];
}}
}}
Expand Down Expand Up @@ -864,7 +864,7 @@ public unsafe partial struct _Anonymous_e__Union
public MyStruct s;
[FieldOffset(0)]
[NativeTypeName(""{nativeType} [4]"")]
[NativeTypeName(""{nativeType}[4]"")]
public fixed {expectedManagedType} buffer[4];
}}
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ protected override Task WideStringLiteralConstTestImpl()
{{
public static partial class Methods
{{
[NativeTypeName(""const wchar_t [5]"")]
[NativeTypeName(""const wchar_t[5]"")]
public const string MyConst1 = ""Test"";
}}
}}
Expand All @@ -178,7 +178,7 @@ namespace ClangSharp.Test
{{
public static partial class Methods
{{
[NativeTypeName(""const char [5]"")]
[NativeTypeName(""const char[5]"")]
public static ReadOnlySpan<byte> MyConst1 => new byte[] {{ 0x54, 0x65, 0x73, 0x74, 0x00 }};
}}
}}
Expand Down Expand Up @@ -287,7 +287,7 @@ protected override Task MultidimensionlArrayTestImpl()
{{
public static partial class Methods
{{
[NativeTypeName(""const int [2][2]"")]
[NativeTypeName(""const int[2][2]"")]
public static readonly int[][] MyArray = new int[2][]
{{
new int[2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace ClangSharp.Test
public static unsafe partial class Methods
{
[DllImport(""ClangSharpPInvokeGenerator"", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
public static extern void MyFunction([NativeTypeName(""const float [4]"")] float* color);
public static extern void MyFunction([NativeTypeName(""const float[4]"")] float* color);
}
}
";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public partial struct MyStruct
public partial struct MyOtherStruct
{{
[NativeTypeName(""MyStruct [3]"")]
[NativeTypeName(""MyStruct[3]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -384,7 +384,7 @@ public partial struct MyStruct
public partial struct MyOtherStruct
{{
[NativeTypeName(""MyStruct [2][1][3][4]"")]
[NativeTypeName(""MyStruct[2][1][3][4]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -521,7 +521,7 @@ public partial struct MyStruct
public partial struct MyOtherStruct
{{
[NativeTypeName(""MyStruct [3]"")]
[NativeTypeName(""MyStruct[3]"")]
public _c_e__FixedBuffer c;
public partial struct _c_e__FixedBuffer
Expand Down Expand Up @@ -598,7 +598,7 @@ protected override Task FixedSizedBufferPrimitiveTestImpl(string nativeType, str
{{
public unsafe partial struct MyStruct
{{
[NativeTypeName(""{nativeType} [3]"")]
[NativeTypeName(""{nativeType}[3]"")]
public fixed {expectedManagedType} c[3];
}}
}}
Expand All @@ -619,7 +619,7 @@ protected override Task FixedSizedBufferPrimitiveMultidimensionalTestImpl(string
{{
public unsafe partial struct MyStruct
{{
[NativeTypeName(""{nativeType} [2][1][3][4]"")]
[NativeTypeName(""{nativeType}[2][1][3][4]"")]
public fixed {expectedManagedType} c[2 * 1 * 3 * 4];
}}
}}
Expand Down Expand Up @@ -953,10 +953,10 @@ public unsafe partial struct _Anonymous_e__Struct
public MyUnion u;
[NativeTypeName(""{nativeType} [4]"")]
[NativeTypeName(""{nativeType}[4]"")]
public fixed {expectedManagedType} buffer1[4];
[NativeTypeName(""MyUnion [4]"")]
[NativeTypeName(""MyUnion[4]"")]
public _buffer2_e__FixedBuffer buffer2;
public partial struct _w_e__Struct
Expand Down
Loading

0 comments on commit 64042a7

Please sign in to comment.