Tests: Add default field and parameter value tests to CSharp1
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
/* C# 1.0 feature test */
|
/* C# 1.0 feature test */
|
||||||
namespace Il2CppTests.TestSources
|
namespace Il2CppTests.TestSources
|
||||||
@@ -14,6 +15,9 @@ namespace Il2CppTests.TestSources
|
|||||||
{
|
{
|
||||||
public SimpleStruct ss;
|
public SimpleStruct ss;
|
||||||
public int i;
|
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) {
|
public static SimpleStruct StaticFunc(SimpleStruct ss) {
|
||||||
Console.WriteLine(ss);
|
Console.WriteLine(ss);
|
||||||
@@ -29,6 +33,10 @@ namespace Il2CppTests.TestSources
|
|||||||
return val + 42;
|
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 delegate SimpleStruct SimpleDelegate(SimpleStruct ss);
|
||||||
public event SimpleDelegate SimpleEvent;
|
public event SimpleDelegate SimpleEvent;
|
||||||
public int SimpleProperty {
|
public int SimpleProperty {
|
||||||
|
|||||||
Reference in New Issue
Block a user