Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
added int overload resolution test by https://github.com/slide
  • Loading branch information
lostmsu committed Aug 25, 2021
commit 1ee17323fea2b374c7f0099bf7d880be46841dd4
13 changes: 13 additions & 0 deletions src/testing/conversiontest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,17 @@ public override string ToString()
return value;
}
}

public class MethodResolutionInt
{
public IEnumerable<byte> MethodA(ulong address, int size)
{
return new byte[10];
}

public int MethodA(string dummy, ulong address, int size)
{
return 0;
}
}
}
14 changes: 13 additions & 1 deletion tests/test_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest

import System
from Python.Test import ConversionTest, UnicodeString
from Python.Test import ConversionTest, MethodResolutionInt, UnicodeString
from Python.Runtime import PyObjectConversions
from Python.Runtime.Codecs import RawProxyEncoder

Expand Down Expand Up @@ -681,3 +681,15 @@ def CanEncode(self, clr_type):
l = ob.ListField
l.Add(42)
assert ob.ListField.Count == 1

def test_int_param_resolution_required():
"""Test resolution of `int` parameters when resolution is needed"""

mri = MethodResolutionInt()
data = list(mri.MethodA(0x1000, 10))
assert len(data) == 10
assert data[0] == 0

data = list(mri.MethodA(0x100000000, 10))
assert len(data) == 10
assert data[0] == 0