Skip to content

Commit

Permalink
Added more test case. #104
Browse files Browse the repository at this point in the history
  • Loading branch information
kekyo committed Oct 20, 2021
1 parent 2259aed commit b159b49
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace IL2C.RuntimeSystems
Expand Down Expand Up @@ -262,6 +263,7 @@ public class InstanceMultipleImplement3DepthType : InstanceMultipleImplement2Dep
[TestCase("223", "InstanceImplement", 123, IncludeTypes = new[] { typeof(InstanceImplementType), typeof(IInterfaceType1) })]
[TestCase("223", "InstanceImplementFromInterface", 123, IncludeTypes = new[] { typeof(InstanceImplementType), typeof(IInterfaceType1) })]
[TestCase("223", "InstanceImplementExplicitlyTypeFromInterface", 123, IncludeTypes = new[] { typeof(InstanceImplementExplicitlyType), typeof(IInterfaceType1) })]
[TestCase("223", "InstanceImplementExplicitlyTypeFromInterfaceByClass", 123, IncludeTypes = new[] { typeof(InstanceImplementExplicitlyType), typeof(IInterfaceType1) })]
[TestCase("223", "InstanceMultipleImplement1", 123, IncludeTypes = new[] { typeof(InstanceMultipleImplementType), typeof(IInterfaceType1), typeof(IInterfaceType2) })]
[TestCase("223", "InstanceMultipleImplementFromInterface1", 123, IncludeTypes = new[] { typeof(InstanceMultipleImplementType), typeof(IInterfaceType1), typeof(IInterfaceType2) })]
[TestCase("323", "InstanceMultipleImplement2", 123L, IncludeTypes = new[] { typeof(InstanceMultipleImplementType), typeof(IInterfaceType1), typeof(IInterfaceType2) })]
Expand Down Expand Up @@ -311,6 +313,9 @@ public static string InstanceImplementExplicitlyTypeFromInterface(int value)
return inst.GetStringFromInt32(value);
}

[MethodImpl(MethodImplOptions.ForwardRef)]
public static extern string InstanceImplementExplicitlyTypeFromInterfaceByClass(int value);

public static string InstanceMultipleImplement1(int value)
{
var inst = new InstanceMultipleImplementType();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.class public IL2C.RuntimeSystems.TypeImplements
{
.method public static string InstanceImplementExplicitlyTypeFromInterfaceByClass(int32 v) cil managed
{
.maxstack 2
newobj instance void IL2C.RuntimeSystems.InstanceImplementExplicitlyType::.ctor()
ldarg.0
callvirt instance string IL2C.RuntimeSystems.IInterfaceType1::GetStringFromInt32(int32)
ret
}
}

0 comments on commit b159b49

Please sign in to comment.