8000 method overloading - more fun · Issue #190 · pythonnet/pythonnet · GitHub
[go: up one dir, main page]

Skip to content

method overloading - more fun #190

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
den-run-ai opened this issue Mar 17, 2016 · 1 comment
Closed

method overloading - more fun #190

den-run-ai opened this issue Mar 17, 2016 · 1 comment

Comments

@den-run-ai
Copy link
Contributor

Right now we have if (_methods.Length > 1) as the first line of defense for overloading problems. The reason for this are about 30 failing tests if this condition is removed.

Looks like this is an easy fix to these tests, but using proper types in the code. e.g.

clr.setPreload(0) should be changed to clr.setPreload(False)

full list here:

{ pythonnet_st } patch-8 » c:/python/python27/python.exe src/tests/runtests.py
Attempting to load Python.Runtime using standard binding rules...
Attempting to load Python.Runtime from: 'C:\python\python27\lib\site-packages\Python.Runtime.dll'...
..................E.....................................................E.EE........E.E..........E.EEE...E.EEE...........................................E..E..E..E......................E........EE...............................................EEE..E...........E...E...EEE.............................................................
======================================================================
ERROR: testPreloadVar (test_module.ModuleTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_module.py", line 59, in testPreloadVar
    clr.setPreload(0)
TypeError: No method matches given arguments

======================================================================
ERROR: testExplicitOverloadSelection (test_method.MethodTests)
Check explicit overload selection using [] syntax.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_method.py", line 525, in testExplicitOverloadSelection
    value = MethodTest.Overloaded.__overloads__[System.Byte](255)
TypeError: No method matches given arguments

======================================================================
ERROR: testExplicitSelectionWithOutModifier (test_method.MethodTests)
Check explicit overload selection with out modifiers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_method.py", line 477, in testExplicitSelectionWithOutModifier
    "hi", "there"
TypeError: No method matches given arguments

======================================================================
ERROR: testExplicitSelectionWithRefModifier (test_method.MethodTests)
Check explicit overload selection with ref modifiers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_method.py", line 497, in testExplicitSelectionWithRefModifier
    "hi", "there"
TypeError: No method matches given arguments

======================================================================
ERROR: testObjectOutParams (test_method.MethodTests)
Test use of object out-parameters.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_method.py", line 370, in testObjectOutParams
    result = MethodTest.TestObjectOutParams("hi", MethodTest())
TypeError: No method matches given arguments

======================================================================
ERROR: testObjectRefParams (test_method.MethodTests)
Test use of object byref parameters.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_method.py", line 385, in testObjectRefParams
    result = MethodTest.TestObjectRefParams("hi", MethodTest())
TypeError: No method matches given arguments

======================================================================
ERROR: testStringOutParams (test_method.MethodTests)
Test use of string out-parameters.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_method.py", line 310, in testStringOutParams
    result = MethodTest.TestStringOutParams("hi", "there")
TypeError: No method matches given arguments

======================================================================
ERROR: testStringRefParams (test_method.MethodTests)
Test use of string byref parameters.
-------------------------------------<
10000
/span>---------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_method.py", line 325, in testStringRefParams
    result = MethodTest.TestStringRefParams("hi", "there")
TypeError: No method matches given arguments

======================================================================
ERROR: testStructOutParams (test_method.MethodTests)
Test use of struct out-parameters.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_method.py", line 400, in testStructOutParams
    result = MethodTest.TestStructOutParams("hi",System.Guid.NewGuid())
TypeError: No method matches given arguments

======================================================================
ERROR: testStructRefParams (test_method.MethodTests)
Test use of struct byref parameters.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_method.py", line 415, in testStructRefParams
    result = MethodTest.TestStructRefParams("hi",System.Guid.NewGuid())
TypeError: No method matches given arguments

======================================================================
ERROR: testValueOutParams (test_method.MethodTests)
Test use of value type out-parameters.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_method.py", line 340, in testValueOutParams
    result = MethodTest.TestValueOutParams("hi", 1)
TypeError: No method matches given arguments

======================================================================
ERROR: testValueRefParams (test_method.MethodTests)
Test use of value type byref parameters.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_method.py", line 355, in testValueRefParams
    result = MethodTest.TestValueRefParams("hi", 1)
TypeError: No method matches given arguments

======================================================================
ERROR: testVoidSingleOutParam (test_method.MethodTests)
Test void method with single out-parameter.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_method.py", line 430, in testVoidSingleOutParam
    result = MethodTest.TestVoidSingleOutParam(9)
TypeError: No method matches given arguments

======================================================================
ERROR: testVoidSingleRefParam (test_method.MethodTests)
Test void method with single ref-parameter.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_method.py", line 442, in testVoidSingleRefParam
    result = MethodTest.TestVoidSingleRefParam(9)
TypeError: No method matches given arguments

======================================================================
ERROR: testGenericMethodTypeHandling (test_generic.GenericTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_generic.py", line 319, in testGenericMethodTypeHandling
    self._testGenericMethodByType(System.Byte, 255)
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_generic.py", line 213, in _testGenericMethodByType
    result = stype.Overloaded[ptype](value)
TypeError: No method matches given arguments

======================================================================
ERROR: testGenericTypeBinding (test_generic.GenericTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_generic.py", line 180, in testGenericTypeBinding
    self._testGenericWrapperByType(System.Byte, 255)
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_generic.py", line 161, in _testGenericWrapperByType
    inst = GenericWrapper[ptype](value)
TypeError: no constructor matches given arguments

======================================================================
ERROR: testMethodOverloadSelectionWithGenericTypes (test_generic.GenericTests)
Check method overload selection using generic types.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_generic.py", line 476, in testMethodOverloadSelectionWithGenericTypes
    input = vtype(255)
TypeError: no constructor matches given arguments

======================================================================
ERROR: testOverloadSelectionWithArraysOfGenericTypes (test_generic.GenericTests)
Check overload selection using arrays of generic types.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_generic.py", line 615, in testOverloadSelectionWithArraysOfGenericTypes
    input = vtype([gtype(255), gtype(255)])
TypeError: no constructor matches given arguments

======================================================================
ERROR: testBasicSubclass (test_class.ClassTests)
Test basic subclass of a managed class.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_class.py", line 95, in testBasicSubclass
    table.set_Item('one', 'one')
TypeError: No method matches given arguments

======================================================================
ERROR: testOverrideGetItem (test_class.ClassTests)
Test managed subclass overriding __getitem__.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_class.py", line 196, in testOverrideGetItem
    table['one'] = 'one'
TypeError: No method matches given arguments

======================================================================
ERROR: testOverrideSetItem (test_class.ClassTests)
Test managed subclass overriding __setitem__.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_class.py", line 217, in testOverrideSetItem
    table['one'] = 'one'
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_class.py", line 214, in __setitem__
    Hashtable.__setitem__(self, key, value)
TypeError: No method matches given arguments

======================================================================
ERROR: testBooleanIndexer (test_indexer.IndexerTests)
Test boolean indexers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_indexer.py", line 95, in testBooleanIndexer
    self.assertTrue(object[1] == None)
TypeError: No method matches given arguments

======================================================================
ERROR: testByteIndexer (test_indexer.IndexerTests)
Test byte indexers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_indexer.py", line 116, in testByteIndexer
    self.assertTrue(object[max] == None)
TypeError: No method matches given arguments

======================================================================
ERROR: testCharIndexer (test_indexer.IndexerTests)
Test char indexers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_indexer.py", line 170, in testCharIndexer
    self.assertTrue(object[max] == None)
TypeError: No method matches given arguments

======================================================================
ERROR: testEnumIndexer (test_indexer.IndexerTests)
Test enum indexers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_indexer.py", line 474, in testEnumIndexer
    self.assertTrue(object[key] == None)
TypeError: No method matches given arguments

======================================================================
ERROR: testObjectIndexer (test_indexer.IndexerTests)
Test object indexers.
----------------------------------------------------------------------Load clr import hook
Python.Test.SubclassConstructorTest

Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_indexer.py", line 506, in testObjectIndexer
    self.assertTrue(object["spam"] == None)
TypeError: No method matches given arguments

======================================================================
ERROR: testSByteIndexer (test_indexer.IndexerTests)
Test sbyte indexers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_indexer.py", line 143, in testSByteIndexer
    self.assertTrue(object[max] == None)
TypeError: No method matches given arguments

======================================================================
ERROR: testUInt16Indexer (test_indexer.IndexerTests)
Test UInt16 indexers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_indexer.py", line 278, in testUInt16Indexer
    self.assertTrue(object[max] == None)
TypeError: No method matches given arguments

======================================================================
ERROR: testUInt32Indexer (test_indexer.IndexerTests)
Test UInt32 indexers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_indexer.py", line 305, in testUInt32Indexer
    self.assertTrue(object[max] == None)
TypeError: No method matches given arguments

======================================================================
ERROR: testUInt64Indexer (test_indexer.IndexerTests)
Test UInt64 indexers.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python\pythonnet\pythonnet_st\src\tests\test_indexer.py", line 332, in testUInt64Indexer
    self.assertTrue(object[max] == None)
TypeError: No method matches given arguments

----------------------------------------------------------------------
Ran 332 tests in 2.478s

FAILED (errors=30)
Traceback (most recent call last):
  File "src/tests/runtests.py", line 70, in <module>
    main(1)
  File "src/tests/runtests.py", line 67, in main
    raise Exception("Tests failed")
Exception: Tests failed
@filmor
Copy link
Member
filmor commented Jun 9, 2020

I don't think this is relevant anymore.

@filmor filmor closed this as completed Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0