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:
Dave Beazley 2003-02-18 21:25:31 +00:00
parent c775a83888
commit df9d00e60d
5 changed files with 70 additions and 0 deletions

View File

@ -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 \

View 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

View 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

View 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"; }
}
}

View 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>;
}