runtime tests for templated functions in a namespace added (overloading and default arg tests)

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6456 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-10-20 21:07:53 +00:00
commit dbb0c18d3e
2 changed files with 72 additions and 0 deletions

View file

@ -107,7 +107,49 @@ public class template_default_arg_runme {
if (template_default_arg.ott(new Hello_int()) != 60)
throw new RuntimeException("ott test 13 failed");
}
// Above test in namespaces
{
// plain function: int nsott(Foo<int>)
if (template_default_arg.nsott(new Foo_int()) != 130)
throw new RuntimeException("nsott test 1 failed");
// %template(nsott) nsott<int, int>;
if (template_default_arg.nsott() != 110)
throw new RuntimeException("nsott test 2 failed");
if (template_default_arg.nsott(1) != 110)
throw new RuntimeException("nsott test 3 failed");
if (template_default_arg.nsott(1, 1) != 110)
throw new RuntimeException("nsott test 4 failed");
if (template_default_arg.nsott("hi") != 120)
throw new RuntimeException("nsott test 5 failed");
if (template_default_arg.nsott("hi", 1) != 120)
throw new RuntimeException("nsott test 6 failed");
if (template_default_arg.nsott("hi", 1, 1) != 120)
throw new RuntimeException("nsott test 7 failed");
// %template(nsott) nsott<const char *>;
if (template_default_arg.nsottstring(new Hello_int(), "hi") != 140)
throw new RuntimeException("nsott test 8 failed");
if (template_default_arg.nsottstring(new Hello_int()) != 140)
throw new RuntimeException("nsott test 9 failed");
// %template(nsott) nsott<int>;
if (template_default_arg.nsottint(new Hello_int(), 1) != 150)
throw new RuntimeException("nsott test 10 failed");
if (template_default_arg.nsottint(new Hello_int()) != 150)
throw new RuntimeException("nsott test 11 failed");
// %template(nsott) nsott<double>;
if (template_default_arg.nsott(new Hello_int(), 1.0) != 160)
throw new RuntimeException("nsott test 12 failed");
if (template_default_arg.nsott(new Hello_int()) != 160)
throw new RuntimeException("nsott test 13 failed");
}
}
}