From eafd417f0d7e526517d4da7bb13f2b312bb2aae1 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 20 Oct 2004 21:18:27 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6458 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- .../perl5/template_default_arg_runme.pl | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/Examples/test-suite/perl5/template_default_arg_runme.pl b/Examples/test-suite/perl5/template_default_arg_runme.pl index 528e35e88..17a02249c 100644 --- a/Examples/test-suite/perl5/template_default_arg_runme.pl +++ b/Examples/test-suite/perl5/template_default_arg_runme.pl @@ -113,3 +113,59 @@ use template_default_arg; die "ott test 13 failed"; } } + +# Above test in namespaces +{ + # plain function: int nsott(Foo) + if (template_default_arg::nsott(new template_default_arg::Foo_int()) != 130) { + die "nsott test 1 failed"; + } + + # %template(nsott) nsott; + if (template_default_arg::nsott() != 110) { + die "nsott test 2 failed"; + } + if (template_default_arg::nsott(1) != 110) { + die "nsott test 3 failed"; + } + if (template_default_arg::nsott(1, 1) != 110) { + die "nsott test 4 failed"; + } + + if (template_default_arg::nsott("hi") != 120) { + die "nsott test 5 failed"; + } + if (template_default_arg::nsott("hi", 1) != 120) { + die "nsott test 6 failed"; + } + if (template_default_arg::nsott("hi", 1, 1) != 120) { + die "nsott test 7 failed"; + } + + # %template(nsott) nsott; + if (template_default_arg::nsottstring(new template_default_arg::Hello_int(), "hi") != 140) { + die "nsott test 8 failed"; + } + + if (template_default_arg::nsottstring(new template_default_arg::Hello_int()) != 140) { + die "nsott test 9 failed"; + } + + # %template(nsott) nsott; + if (template_default_arg::nsottint(new template_default_arg::Hello_int(), 1) != 150) { + die "nsott test 10 failed"; + } + + if (template_default_arg::nsottint(new template_default_arg::Hello_int()) != 150) { + die "nsott test 11 failed"; + } + + # %template(nsott) nsott; + if (template_default_arg::nsott(new template_default_arg::Hello_int(), 1.0) != 160) { + die "nsott test 12 failed"; + } + + if (template_default_arg::nsott(new template_default_arg::Hello_int()) != 160) { + die "nsott test 13 failed"; + } +}