From f3c95adde6a563f6364874694a236ed0deeb72f2 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Sun, 10 Jan 2021 12:56:31 +0100 Subject: [PATCH] Tests: Add default field and parameter value tests to CSharp1 --- Il2CppTests/TestSources/CSharp1.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Il2CppTests/TestSources/CSharp1.cs b/Il2CppTests/TestSources/CSharp1.cs index 6cf760f..1fd1799 100644 --- a/Il2CppTests/TestSources/CSharp1.cs +++ b/Il2CppTests/TestSources/CSharp1.cs @@ -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 {