Update unit tests

This commit is contained in:
Katy Coe
2019-11-02 16:46:22 +01:00
parent 965b72806d
commit bde81b5aa4
12 changed files with 201 additions and 235357 deletions

View File

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

View File

@@ -0,0 +1,48 @@
// Image 0: mscorlib.dll - 0
// Image 1: GenericTypes.dll - 1810
// Namespace: Il2CppTests.TestSources
public class Base<T, U> // TypeDefIndex: 1811
{
// Constructors
public Base();
}
// Namespace: Il2CppTests.TestSources
public class Derived<V> : Base<string, V> // TypeDefIndex: 1812
{
// Fields
public G<Derived<V>> F; // 0x00
// Nested types
public class Nested<V> // TypeDefIndex: 1813
{
// Constructors
public Nested();
}
// Constructors
public Derived();
}
// Namespace: Il2CppTests.TestSources
public class G<T> // TypeDefIndex: 1814
{
// Constructors
public G();
}
// Namespace: Il2CppTests.TestSources
internal class Test // TypeDefIndex: 1815
{
// Constructors
public Test(); // 0x00000001800E2000
// Methods
public void GenericTypesTest(); // 0x00000001803E0E50
}

View File

@@ -0,0 +1,48 @@
// Image 0: mscorlib.dll - 0
// Image 1: GenericTypes.dll - 1810
// Namespace: Il2CppTests.TestSources
public class Base<T, U> // TypeDefIndex: 1811
{
// Constructors
public Base();
}
// Namespace: Il2CppTests.TestSources
public class Derived<V> : Base<string, V> // TypeDefIndex: 1812
{
// Fields
public G<Derived<V>> F; // 0x00
// Nested types
public class Nested<V> // TypeDefIndex: 1813
{
// Constructors
public Nested();
}
// Constructors
public Derived();
}
// Namespace: Il2CppTests.TestSources
public class G<T> // TypeDefIndex: 1814
{
// Constructors
public G();
}
// Namespace: Il2CppTests.TestSources
internal class Test // TypeDefIndex: 1815
{
// Constructors
public Test(); // 0x100BF000
// Methods
public void GenericTypesTest(); // 0x1034DA60
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,48 @@
// Image 0: mscorlib.dll - 0
// Image 1: GenericTypes.dll - 1810
// Namespace: Il2CppTests.TestSources
public class Base<T, U> // TypeDefIndex: 1811
{
// Constructors
public Base();
}
// Namespace: Il2CppTests.TestSources
public class Derived<V> : Base<string, V> // TypeDefIndex: 1812
{
// Fields
public G<Derived<V>> F; // 0x00
// Nested types
public class Nested<V> // TypeDefIndex: 1813
{
// Constructors
public Nested();
}
// Constructors
public Derived();
}
// Namespace: Il2CppTests.TestSources
public class G<T> // TypeDefIndex: 1814
{
// Constructors
public G();
}
// Namespace: Il2CppTests.TestSources
internal class Test // TypeDefIndex: 1815
{
// Constructors
public Test(); // 0x00561704
// Methods
public void GenericTypesTest(); // 0x00561548
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,48 @@
/*
Copyright 2017-2019 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
All rights reserved.
*/
using System;
namespace Il2CppTests.TestSources
{
public class Base<T, U> { }
public class Derived<V> : Base<string, V>
{
public G<Derived<V>> F;
public class Nested { }
}
public class G<T> { }
internal class Test
{
public void GenericTypesTest() {
// Get the generic type definition for Derived, and the base
// type for Derived.
//
Type tDerived = typeof(Derived<>);
Type tDerivedBase = tDerived.BaseType;
// Declare an array of Derived<int>, and get its type.
//
Derived<int>[] d = new Derived<int>[0];
Type tDerivedArray = d.GetType();
// Get a generic type parameter, the type of a field, and a
// type that is nested in Derived. Notice that in order to
// get the nested type it is necessary to either (1) specify
// the generic type definition Derived<>, as shown here,
// or (2) specify a type parameter for Derived.
//
Type tT = typeof(Base<,>).GetGenericArguments()[0];
Type tF = tDerived.GetField("F").FieldType;
Type tNested = typeof(Derived<>.Nested);
}
}
}

View File

@@ -1,15 +0,0 @@
/*
Copyright 2017-2019 Katy Coe - http://www.hearthcode.org - http://www.djkaty.com
All rights reserved.
*/
namespace Il2CppTests.TestSources
{
// Generic class
internal class GenericClass<T>
{
// Generic method using generic type parameter of class
public void GenericMethodWithClassGenericTypeParameter(T v) { }
}
}