diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-10-26 14:37:25 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-10-28 16:02:19 +0200 |
| commit | f16c89d808dbdb819c452ddf581574a9862fe1a8 (patch) | |
| tree | 97e0a89cb731f6def0fc0a3153cee287383344dc | |
| parent | e8555cc435c0da9d72601447a5ed69a2a0180d47 (diff) | |
shiboken6: Stabilize TestResolveType::testFixDefaultArguments()
Exclude the destructor when searching for the functions
and add a check.
Amends f863ce7cc68a4def0fe9929c7f50e4e101fd8a1e,
Task-number: PYSIDE-1691
Pick-to: 6.2
Change-Id: I2f3c679d75d36147a1d1fc10660442f1245acffd
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
| -rw-r--r-- | sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp b/sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp index 89d050a21..6ef1fbdaf 100644 --- a/sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp +++ b/sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp @@ -123,14 +123,18 @@ public: fixture->classType.decideUsagePattern(); for (const auto &f : fixture->klass->findFunctions(u"Test"_qs)) { - if (f->arguments().size() != 1) - return -3; - const auto type = f->arguments().constFirst().type(); - if (type.name() == u"int") - fixture->intType = type; - else - fixture->stringType = type; + if (f->functionType() == AbstractMetaFunction::ConstructorFunction + && f->arguments().size() == 1) { + const auto type = f->arguments().constFirst().type(); + if (type.name() == u"int") + fixture->intType = type; + else + fixture->stringType = type; + } } + if (fixture->intType.isVoid() || fixture->stringType.isVoid()) + return -3; + return 0; } |
