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
Next Next commit
add test that reproduces the stackoverflowexception.
  • Loading branch information
matthid committed Aug 25, 2016
commit 38654719530cef3f53729a7488a4467b1f540656
11 changes: 11 additions & 0 deletions src/testing/subclasstest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ public virtual void OnTestEvent(int value)
}
}

public abstract class RecursiveInheritance
{
public class SubClass : RecursiveInheritance
{
public void SomeMethod()
{

}
}
}

public class TestFunctions
{
public static string test_foo(IInterfaceTest x)
Expand Down
2 changes: 2 additions & 0 deletions src/tests/test_suite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

from .test_import import test_suite as import_tests
from .test_callback import test_suite as callback_tests
from .test_recursiveTypes import test_suite as recursiveTypes_tests

def test_suite():
suite = unittest.TestSuite()
suite.addTests((import_tests(),))
suite.addTests((callback_tests(),))
suite.addTests((recursiveTypes_tests(),))
return suite
20 changes: 20 additions & 0 deletions src/tests/test_suite/test_recursiveTypes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import unittest, sys
import clr

this_module = sys.modules[__name__]
clr.AddReference("Python.Test")
class RecursiveTypesTests(unittest.TestCase):
"""Test if interop with recursive type inheritance works."""

def testRecursiveTypeCreation(self):
"""Test that a recursive types don't crash with a StackOverflowException"""
import Python.Test as Test
from Python.Test import RecursiveInheritance
test_instance = RecursiveInheritance.SubClass()
test_instance.SomeMethod()
pass


def test_suite():
return unittest.makeSuite(RecursiveTypesTests)