Tests: Add ArraysAndPointers and CustomAttributeData; update all expected results

This commit is contained in:
Katy Coe
2019-11-05 19:11:07 +01:00
parent 8571d6d6f3
commit 9d4d8da42b
12 changed files with 295 additions and 4 deletions

View File

@@ -27,15 +27,29 @@
</ItemGroup>
<ItemGroup>
<Compile Remove="TestSources\ArraysAndPointers.cs" />
<Compile Remove="TestSources\CustomAttributeData.cs" />
<Compile Remove="TestSources\GenericTypes.cs" />
<Compile Remove="TestSources\Methods.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="TestExpectedResults\ArraysAndPointers.cs" />
<Content Include="TestExpectedResults\CustomAttributeData.cs" />
<Content Include="TestExpectedResults\GameAssembly-ArraysAndPointers-x64.cs" />
<Content Include="TestExpectedResults\GameAssembly-ArraysAndPointers-x86.cs" />
<Content Include="TestExpectedResults\GameAssembly-CustomAttributeData-x64.cs" />
<Content Include="TestExpectedResults\GameAssembly-CustomAttributeData-x86.cs" />
<Content Include="TestExpectedResults\GameAssembly-GenericTypes-x64.cs" />
<Content Include="TestExpectedResults\GameAssembly-GenericTypes-x86.cs" />
<Content Include="TestExpectedResults\GenericTypes.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="TestExpectedResults\GameAssembly-Methods-x64.cs" />
<Content Include="TestExpectedResults\GameAssembly-Methods-x86.cs" />
<Content Include="TestExpectedResults\Methods.cs" />
<Content Include="TestSources\ArraysAndPointers.cs" />
<Content Include="TestSources\CustomAttributeData.cs" />
<Content Include="TestSources\GenericTypes.cs" />
<Content Include="TestSources\Methods.cs" />

View File

@@ -0,0 +1,34 @@
// Image 0: mscorlib.dll - 0
// Image 1: ArraysAndPointers.dll - 1810
// Namespace: Il2CppTests.TestSources
internal class Test // TypeDefIndex: 1811
{
// Fields
private int[] foo; // 0x08
private int[] bar; // 0x0C
private float[][] arrayOfArrays; // 0x10
private float[,] twoDimensionalArray; // 0x14
private float[,,] threeDimensionalArray; // 0x18
private int*[] arrayOfPointer; // 0x1C
private int** pointerToPointer; // 0x20
private float*[][,,][] confusedElephant; // 0x24
// Nested types
private struct fixedSizeArrayStruct // TypeDefIndex: 1812
{
// Fields
private fixed /* 0x000A6CAC */ int fixedSizeArray[0]; // 0x08
// Nested types
}
// Constructors
public Test(); // 0x00562BA0
// Methods
public int[] FooMethod(int[][] bar); // 0x00562AC8
public int[,] BarMethod(int[,,] baz); // 0x00562B28
}

View File

@@ -0,0 +1,47 @@
// Image 0: mscorlib.dll - 0
// Image 1: CustomAttributeData.dll - 1810
// Namespace: Il2CppTests.TestSources
public enum ExampleKind // TypeDefIndex: 1811
{
FirstKind = 0,
SecondKind = 1,
ThirdKind = 2,
FourthKind = 3
}
// Namespace: Il2CppTests.TestSources
[AttributeUsage] // 0x000A5070
public class ExampleAttribute : Attribute // TypeDefIndex: 1812
{
// Fields
private ExampleKind kindValue; // 0x08
private string noteValue; // 0x0C
private string[] arrayStrings; // 0x10
private int[] arrayNumbers; // 0x14
// Properties
public ExampleKind Kind { get; } // 0x005612FC
public string[] Strings { get; } // 0x00561304
public string Note { get; set; } // 0x0056130C 0x00561314
public int[] Numbers { get; set; } // 0x0056131C 0x00561324
// Constructors
public ExampleAttribute(ExampleKind initKind, string[] initStrings); // 0x00561288
public ExampleAttribute(ExampleKind initKind); // 0x005612B0
public ExampleAttribute(); // 0x005612D8
}
// Namespace: Il2CppTests.TestSources
[Example] // 0x000A5084
public class Test // TypeDefIndex: 1813
{
// Constructors
public Test(); // 0x00561330
// Methods
[Example] // 0x000A5208
public void TestMethod([Example] /* 0x000A525C */ object arg); // 0x0056132C
}

View File

@@ -0,0 +1,34 @@
// Image 0: mscorlib.dll - 0
// Image 1: ArraysAndPointers.dll - 1810
// Namespace: Il2CppTests.TestSources
internal class Test // TypeDefIndex: 1811
{
// Fields
private int[] foo; // 0x10
private int[] bar; // 0x20
private float[][] arrayOfArrays; // 0x30
private float[,] twoDimensionalArray; // 0x40
private float[,,] threeDimensionalArray; // 0x10
private int*[] arrayOfPointer; // 0x29
private int** pointerToPointer; // 0x8047EC30
private float*[][,,][] confusedElephant; // 0x00
// Nested types
private struct fixedSizeArrayStruct // TypeDefIndex: 1812
{
// Fields
private fixed /* 0x000000018000CC70 */ int fixedSizeArray[0]; // 0x10
// Nested types
}
// Constructors
public Test(); // 0x00000001803E0EE0
// Methods
public int[] FooMethod(int[][] bar); // 0x00000001803E0EA0
public int[,] BarMethod(int[,,] baz); // 0x00000001803E0E50
}

View File

@@ -0,0 +1,34 @@
// Image 0: mscorlib.dll - 0
// Image 1: ArraysAndPointers.dll - 1810
// Namespace: Il2CppTests.TestSources
internal class Test // TypeDefIndex: 1811
{
// Fields
private int[] foo; // 0x08
private int[] bar; // 0x0C
private float[][] arrayOfArrays; // 0x10
private float[,] twoDimensionalArray; // 0x14
private float[,,] threeDimensionalArray; // 0x18
private int*[] arrayOfPointer; // 0x1C
private int** pointerToPointer; // 0x20
private float*[][,,][] confusedElephant; // 0x24
// Nested types
private struct fixedSizeArrayStruct // TypeDefIndex: 1812
{
// Fields
private fixed /* 0x1000DE40 */ int fixedSizeArray[0]; // 0x08
// Nested types
}
// Constructors
public Test(); // 0x1034DAE0
// Methods
public int[] FooMethod(int[][] bar); // 0x1034DAB0
public int[,] BarMethod(int[,,] baz); // 0x1034DA60
}

View File

@@ -0,0 +1,47 @@
// Image 0: mscorlib.dll - 0
// Image 1: CustomAttributeData.dll - 1810
// Namespace: Il2CppTests.TestSources
public enum ExampleKind // TypeDefIndex: 1811
{
FirstKind = 0,
SecondKind = 1,
ThirdKind = 2,
FourthKind = 3
}
// Namespace: Il2CppTests.TestSources
[AttributeUsage] // 0x000000018000C5B0
public class ExampleAttribute : Attribute // TypeDefIndex: 1812
{
// Fields
private ExampleKind kindValue; // 0x10
private string noteValue; // 0x20
private string[] arrayStrings; // 0x29
private int[] arrayNumbers; // 0x8047D628
// Properties
public ExampleKind Kind { get; } // 0x00000001800ECD10
public string[] Strings { get; } // 0x00000001800EAEB0
public string Note { get; set; } // 0x00000001803E0EE0 0x00000001800EAEE0
public int[] Numbers { get; set; } // 0x00000001803E0EF0 0x000000018015B760
// Constructors
public ExampleAttribute(ExampleKind initKind, string[] initStrings); // 0x00000001803E0E70
public ExampleAttribute(ExampleKind initKind); // 0x00000001803E0EB0
public ExampleAttribute(); // 0x00000001803E0E50
}
// Namespace: Il2CppTests.TestSources
[Example] // 0x000000018000C5D0
public class Test // TypeDefIndex: 1813
{
// Constructors
public Test(); // 0x00000001800E2000
// Methods
[Example] // 0x000000018000C710
public void TestMethod([Example] /* 0x000000018000C750 */ object arg); // 0x00000001800EA7B0
}

View File

@@ -0,0 +1,47 @@
// Image 0: mscorlib.dll - 0
// Image 1: CustomAttributeData.dll - 1810
// Namespace: Il2CppTests.TestSources
public enum ExampleKind // TypeDefIndex: 1811
{
FirstKind = 0,
SecondKind = 1,
ThirdKind = 2,
FourthKind = 3
}
// Namespace: Il2CppTests.TestSources
[AttributeUsage] // 0x1000D430
public class ExampleAttribute : Attribute // TypeDefIndex: 1812
{
// Fields
private ExampleKind kindValue; // 0x08
private string noteValue; // 0x0C
private string[] arrayStrings; // 0x10
private int[] arrayNumbers; // 0x14
// Properties
public ExampleKind Kind { get; } // 0x100BF0C0
public string[] Strings { get; } // 0x100BFC20
public string Note { get; set; } // 0x100C5B30 0x100C5B50
public int[] Numbers { get; set; } // 0x100EF0C0 0x10127B00
// Constructors
public ExampleAttribute(ExampleKind initKind, string[] initStrings); // 0x1034DA90
public ExampleAttribute(ExampleKind initKind); // 0x1034DAC0
public ExampleAttribute(); // 0x1034DA60
}
// Namespace: Il2CppTests.TestSources
[Example] // 0x1000D450
public class Test // TypeDefIndex: 1813
{
// Constructors
public Test(); // 0x100BF000
// Methods
[Example] // 0x1000D550
public void TestMethod([Example] /* 0x1000D590 */ object arg); // 0x100C5530
}

View File

@@ -16,7 +16,7 @@ public class Derived<V> : Base<string, V> // TypeDefIndex: 1812
public G<Derived<V>> F; // 0x00
// Nested types
public class Nested<V> // TypeDefIndex: 1813
public class Nested // TypeDefIndex: 1813
{
// Constructors
public Nested();

View File

@@ -16,7 +16,7 @@ public class Derived<V> : Base<string, V> // TypeDefIndex: 1812
public G<Derived<V>> F; // 0x00
// Nested types
public class Nested<V> // TypeDefIndex: 1813
public class Nested // TypeDefIndex: 1813
{
// Constructors
public Nested();

View File

@@ -16,7 +16,7 @@ public class Derived<V> : Base<string, V> // TypeDefIndex: 1812
public G<Derived<V>> F; // 0x00
// Nested types
public class Nested<V> // TypeDefIndex: 1813
public class Nested // TypeDefIndex: 1813
{
// Constructors
public Nested();

View File

@@ -53,7 +53,7 @@ namespace Il2CppInspector
//(tDerivedArray, "Derived`1[System.Int32][]", false, false, false, false),
(tT, "T", false, false, true, true),
(tF, "G`1[Derived`1[V]]", true, false, true, false),
(tNested, "Derived`1+Nested[V]", true, true, true, false)
(tNested, "Derived`1[V]+Nested[V]", true, true, true, false)
};
foreach (var check in checks) {

View File

@@ -0,0 +1,34 @@
/*
Copyright 2017-2019 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
All rights reserved.
*/
namespace Il2CppTests.TestSources
{
#pragma warning disable CS0169
internal unsafe class Test
{
private int[] foo;
private int[] bar = new int[10];
private struct fixedSizeArrayStruct
{
private fixed int fixedSizeArray[25];
}
private float[][] arrayOfArrays;
private float[,] twoDimensionalArray;
private float[,,] threeDimensionalArray;
public int[] FooMethod(int[][] bar) => new int[20];
public int[,] BarMethod(int[,,] baz) => new int[5, 6];
private int*[] arrayOfPointer;
private int** pointerToPointer;
private float*[][,,][] confusedElephant;
}
#pragma warning restore CS0169
}