mirror of https://github.com/swig/swig
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
|
@ -172,6 +172,8 @@ CPP_TEST_CASES += \
|
|||
template_enum_ns_inherit \
|
||||
template_enum_typedef \
|
||||
template_explicit \
|
||||
template_extend1 \
|
||||
template_extend2 \
|
||||
template_forward \
|
||||
template_inherit \
|
||||
template_inherit_abstract \
|
||||
|
|
|
@ -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
|
|
@ -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
|
|
@ -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"; }
|
||||
}
|
||||
}
|
|
@ -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…
Reference in New Issue