aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2010-09-17 20:13:58 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:05:59 -0300
commit74c9bf7e64d12a946c9b96d9674926323622f1f1 (patch)
tree77e340ecdfbf90062fe40b2d97a8727b3073176e /tests
parent3ce6cdd1b6868ae8494c0a89bef4db85988758b4 (diff)
Fix OverloadData::isSingleArgument
Now returning true *only* when exactly all overloads accept exactly 1 argument. Fixes compilation of QAudioInput and QAudioOutput from QtMultimedia. Both have start() and start(QIODevice*) overloads, and the previous code was generating 'arg' instead of 'pyargs'. Reviewer: Renato Araújo <renato.filho@openbossa.org> Luciano Wolf <luciano.wolf@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/libsample/overload.h3
-rw-r--r--tests/samplebinding/typesystem_sample.xml5
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/libsample/overload.h b/tests/libsample/overload.h
index 739c40656..36b30f2be 100644
--- a/tests/libsample/overload.h
+++ b/tests/libsample/overload.h
@@ -57,6 +57,9 @@ public:
inline int intOverloads(const Point& p, double d) { return 1; }
inline int intOverloads(int i, int i2) { return 2; }
inline int intOverloads(int i, int removedArg, double d) { return 3; }
+
+ void singleOverload(Point* x) {}
+ Point* singleOverload() {return new Point();}
};
#endif // OVERLOAD_H
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml
index 40b70ab40..4f98dff49 100644
--- a/tests/samplebinding/typesystem_sample.xml
+++ b/tests/samplebinding/typesystem_sample.xml
@@ -978,6 +978,11 @@
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%CPPSELF.%FUNCTION_NAME(%1, 2, %3));
</inject-code>
</modify-function>
+ <modify-function signature="singleOverload(Point*)">
+ <modify-argument index="1">
+ <define-ownership owner="c++"/>
+ </modify-argument>
+ </modify-function>
</value-type>
<object-type name="Collector" stream="yes"/>