Tests: Add default field and parameter value tests to CSharp1

This commit is contained in:
Katy Coe
2021-01-10 12:56:31 +01:00
parent 1cf0fc8c54
commit f3c95adde6

View File

@@ -6,6 +6,7 @@
*/
using System;
using System.Runtime.InteropServices;
/* C# 1.0 feature test */
namespace Il2CppTests.TestSources
@@ -14,6 +15,9 @@ namespace Il2CppTests.TestSources
{
public SimpleStruct ss;
public int i;
public const int fieldWithDefaultValue = 3;
public const LayoutKind fieldWithDefaultEnumValue = LayoutKind.Sequential;
public const SimpleClass fieldWithDefaultReferenceValue = null;
public static SimpleStruct StaticFunc(SimpleStruct ss) {
Console.WriteLine(ss);
@@ -29,6 +33,10 @@ namespace Il2CppTests.TestSources
return val + 42;
}
public void funcWithDefaultValue(int a, int b = 2) { }
public void funcWithDefaultEnumValue(int a, LayoutKind b = LayoutKind.Explicit) { }
public void funcWithDefaultReferenceValue(int a, SimpleClass b = null) { }
public delegate SimpleStruct SimpleDelegate(SimpleStruct ss);
public event SimpleDelegate SimpleEvent;
public int SimpleProperty {