new tests
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4343 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
c775a83888
commit
df9d00e60d
5 changed files with 70 additions and 0 deletions
|
|
@ -172,6 +172,8 @@ CPP_TEST_CASES += \
|
||||||
template_enum_ns_inherit \
|
template_enum_ns_inherit \
|
||||||
template_enum_typedef \
|
template_enum_typedef \
|
||||||
template_explicit \
|
template_explicit \
|
||||||
|
template_extend1 \
|
||||||
|
template_extend2 \
|
||||||
template_forward \
|
template_forward \
|
||||||
template_inherit \
|
template_inherit \
|
||||||
template_inherit_abstract \
|
template_inherit_abstract \
|
||||||
|
|
|
||||||
10
Examples/test-suite/python/template_extend1_runme.py
Normal file
10
Examples/test-suite/python/template_extend1_runme.py
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import template_extend1
|
||||||
|
|
||||||
|
a = template_extend1.lBaz()
|
||||||
|
b = template_extend1.dBaz()
|
||||||
|
|
||||||
|
if a.foo() != "lBaz::foo":
|
||||||
|
raise RuntimeError
|
||||||
|
|
||||||
|
if b.foo() != "dBaz::foo":
|
||||||
|
raise RuntimeError
|
||||||
10
Examples/test-suite/python/template_extend2_runme.py
Normal file
10
Examples/test-suite/python/template_extend2_runme.py
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
import template_extend2
|
||||||
|
|
||||||
|
a = template_extend2.lBaz()
|
||||||
|
b = template_extend2.dBaz()
|
||||||
|
|
||||||
|
if a.foo() != "lBaz::foo":
|
||||||
|
raise RuntimeError
|
||||||
|
|
||||||
|
if b.foo() != "dBaz::foo":
|
||||||
|
raise RuntimeError
|
||||||
23
Examples/test-suite/template_extend1.i
Normal file
23
Examples/test-suite/template_extend1.i
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
// One of Luigi's evil tests
|
||||||
|
|
||||||
|
%module template_extend1
|
||||||
|
|
||||||
|
%{
|
||||||
|
namespace Quux {
|
||||||
|
template <class T> class Baz {};
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
|
namespace Quux {
|
||||||
|
template <class T> class Baz {};
|
||||||
|
|
||||||
|
%template (lBaz) Baz<long>;
|
||||||
|
%extend Baz<long> {
|
||||||
|
char *foo(void) { return (char *) "lBaz::foo"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
%template (dBaz) Baz<double>;
|
||||||
|
%extend Baz<double> {
|
||||||
|
char *foo(void) { return (char *) "dBaz::foo"; }
|
||||||
|
}
|
||||||
|
}
|
||||||
25
Examples/test-suite/template_extend2.i
Normal file
25
Examples/test-suite/template_extend2.i
Normal file
|
|
@ -0,0 +1,25 @@
|
||||||
|
// Another evil Luigi test
|
||||||
|
%module template_extend2
|
||||||
|
|
||||||
|
%{
|
||||||
|
namespace Quux {
|
||||||
|
template <class T> class Baz {};
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
|
namespace Quux {
|
||||||
|
template <class T> class Baz {};
|
||||||
|
|
||||||
|
%extend Baz<long> {
|
||||||
|
char *foo(void) { return (char *) "lBaz::foo"; }
|
||||||
|
}
|
||||||
|
%template (lBaz) Baz<long>;
|
||||||
|
|
||||||
|
%extend Baz<double> {
|
||||||
|
char *foo(void) { return (char *) "dBaz::foo"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
%template (dBaz) Baz<double>;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue