diff options
author | Matthew Woehlke <matthew.woehlke@kitware.com> | 2013-11-10 17:09:31 -0500 |
---|---|---|
committer | John Ehresman <jpe@wingware.com> | 2014-04-16 00:40:02 +0200 |
commit | 35d006a7bf9b33807c1df93f5f9439ff83cd32c0 (patch) | |
tree | c5a9359e631251dd3d5c6a09a159de08b64c7aa3 /tests/samplebinding | |
parent | 5b39f7fd9e216dd16e32ee5950d8d3d781cf1d17 (diff) |
Fix function rejections (i.e. support overloads)
Add an additional check to AbstractMetaBuilder::traverseFunction to also
perform a quick-and-dirty construction of the function signature, and to
check that against the rejections. Add a unit test for matching full
signatures.
Before, we were only testing the function name; as a result, a rejection
like 'foo()' would never match (because the name does not have ()'s).
This is especially helpful for rejecting specific overloads of functions
while allowing others to be wrapped normally. (The unit test shows a
not-so-far-fetched example why one might want to do this.)
The signature building logic isn't very sophisticated and likely
requires a very exacting match to the signature as it appears in the
wrapped sources, but that's likely not a serious issue, and at any rate
this is much better than not being able to match overloads at all.
Change-Id: Ic686377477aacf54f79c7bd2013e9aea8521a4ea
Reviewed-by: John Ehresman <jpe@wingware.com>
Diffstat (limited to 'tests/samplebinding')
-rw-r--r-- | tests/samplebinding/typesystem_sample.xml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/samplebinding/typesystem_sample.xml b/tests/samplebinding/typesystem_sample.xml index dee028596..5da6ad148 100644 --- a/tests/samplebinding/typesystem_sample.xml +++ b/tests/samplebinding/typesystem_sample.xml @@ -2393,6 +2393,11 @@ <rejection class="ListUser" function-name="sumList(std::list<int>)"/> <rejection class="ListUser" function-name="sumList(std::list<double>)"/> + <!-- test rejections using full signatures; this method is a template and + cannot be wrapped, but is otherwise recognized by shiboken and will + result in a compile error if the rejection is not matched --> + <rejection class="Photon::Base" function-name="isType()"/> + <value-type name="ValueAndVirtual" /> <object-type name="ObjectTypeByValue" /> |