Test for patch #1116431 Fix non member functions inadvertently being called instead of member functions.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7499 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
60754cbcbe
commit
db84d961e3
3 changed files with 29 additions and 0 deletions
|
|
@ -147,6 +147,7 @@ CPP_TEST_CASES += \
|
|||
grouping \
|
||||
ignore_parameter \
|
||||
import_nomodule \
|
||||
inherit \
|
||||
inherit_missing \
|
||||
inherit_same_name \
|
||||
inherit_void_arg \
|
||||
|
|
|
|||
19
Examples/test-suite/inherit.i
Normal file
19
Examples/test-suite/inherit.i
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// Test that was failing for Perl - the non-member Foo was being called when the member version was intended
|
||||
%module inherit
|
||||
|
||||
%inline %{
|
||||
|
||||
const char* Foo(void) {
|
||||
return "Non-member Foo";
|
||||
}
|
||||
|
||||
class CBase {
|
||||
public:
|
||||
const char* Foo(void) {
|
||||
return "CBase::Foo";
|
||||
}
|
||||
};
|
||||
|
||||
class CDerived : public CBase {};
|
||||
|
||||
%}
|
||||
9
Examples/test-suite/perl5/inherit_runme.pl
Normal file
9
Examples/test-suite/perl5/inherit_runme.pl
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
use inherit;
|
||||
|
||||
$der = new inherit::CDerived();
|
||||
$str = $der->Foo();
|
||||
|
||||
if ($str != "CBase::Foo") {
|
||||
die "test failed";
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue