diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-02-12 11:39:36 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-03-01 16:28:48 +0100 |
commit | 2107b9c16d7be1292c5439a47ed31871906e0b1f (patch) | |
tree | 64447316e8885d4bcf3a45c6657eb7372c60c67c /sources/shiboken6/tests/samplebinding/derived_test.py | |
parent | c6f4d907190dbd66d09db7d4809c06f1b3e48ec2 (diff) |
shiboken6: Add constructors of base classes imported via "using"
Parse "using" declarations in the clang builder using some code
from the base class determination algorithm.
Resolve them to struct UsingMember containing the base class
and the member name in the metabuilder and check whether any
base constructors are imported via "using". Add them
as functions like the default constructor.
Change-Id: I121a70f0591c6d1e6f9daedfb653206c49c07a3f
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken6/tests/samplebinding/derived_test.py')
-rw-r--r-- | sources/shiboken6/tests/samplebinding/derived_test.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sources/shiboken6/tests/samplebinding/derived_test.py b/sources/shiboken6/tests/samplebinding/derived_test.py index 557698110..8bdb051a8 100644 --- a/sources/shiboken6/tests/samplebinding/derived_test.py +++ b/sources/shiboken6/tests/samplebinding/derived_test.py @@ -41,7 +41,7 @@ from shiboken_paths import init_paths init_paths() import sample -from sample import Abstract, Derived, OverloadedFuncEnum +from sample import Abstract, Derived, DerivedUsingCt, OverloadedFuncEnum class Deviant(Derived): def __init__(self): @@ -154,6 +154,12 @@ class DerivedTest(unittest.TestCase): obj = Derived.createObject() self.assertEqual(type(obj), Derived) + def testDerivedUsingCt(self): + '''Test whether a constructor of the base class declared by using works''' + obj = DerivedUsingCt(42) + self.assertEqual(obj.value(), 42) + + if __name__ == '__main__': unittest.main() |