aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-10-26 14:37:25 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-11-09 13:34:21 +0100
commita799ba5aa725a51b3e81cb81d23c5cf62f5caf27 (patch)
treeafdb143ece474a1ae88fa21e38d2f639e31a747c
parente11409242a25d09e5f0dac104a007278b037d11d (diff)
shiboken6: Stabilize TestResolveType::testFixDefaultArguments()
Exclude the destructor when searching for the functions and add a check. Amends f863ce7cc68a4def0fe9929c7f50e4e101fd8a1e, Task-number: PYSIDE-1691 Change-Id: I2f3c679d75d36147a1d1fc10660442f1245acffd Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit f16c89d808dbdb819c452ddf581574a9862fe1a8) Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp b/sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp
index 4a8ad79c9..c88dd7a53 100644
--- a/sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp
+++ b/sources/shiboken6/ApiExtractor/tests/testresolvetype.cpp
@@ -126,14 +126,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;
}