8000 added int overload resolution test by https://github.com/slide · pythonnet/pythonnet@1e32d8c · GitHub
[go: up one dir, main page]

Skip to content

Commit 1e32d8c

Browse files
committed
added int overload resolution test by https://github.com/slide
1 parent e42ec3b commit 1e32d8c

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

src/testing/conversiontest.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,17 @@ public override string ToString()
7878
return value;
7979
}
8080
}
81+
82+
public class MethodResolutionInt
83+
{
84+
public IEnumerable<byte> MethodA(ulong address, int size)
85+
{
86+
return new byte[10];
87+
}
88+
89+
public int MethodA(string dummy, ulong address, int size)
90+
{
91+
return 0;
92+
}
93+
}
8194
}

tests/test_conversion.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest
55

66
import System
7-
from Python.Test import ConversionTest, UnicodeString
7+
from Python.Test import ConversionTest, MethodResolutionInt, UnicodeString
88
from Python.Runtime import PyObjectConversions
99
from Python.Runtime.Codecs import RawProxyEncoder
1010

@@ -681,3 +681,15 @@ def CanEncode(self, clr_type):
681681
l = ob.ListField
682682
l.Add(42)
683683
assert ob.ListField.Count == 1
684+
685+
def test_int_param_resolution_required():
686+
"""Test resolution of `int` parameters when resolution is needed"""
687+
688+
mri = MethodResolutionInt()
689+
data = list(mri.MethodA(0x1000, 10))
690+
assert len(data) == 10
691+
assert data[0] == 0
692+
693+
data = list(mri.MethodA(0x100000000, 10))
694+
assert len(data) == 10
695+
assert data[0] == 0

0 commit comments

Comments
 (0)
0