summaryrefslogtreecommitdiff
path: root/Examples/test-suite/csharp/director_protected_runme.cs
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2011-02-01 07:02:50 +0000
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2011-02-01 07:02:50 +0000
commit4a73d986ddc26fd8eab62219090a4bc4bb55a453 (patch)
tree333e90b86b7fd207b782ea54adfdf425177c37ac /Examples/test-suite/csharp/director_protected_runme.cs
parent96609f350e9d895f4c8f844b0b7cacfd8ca95feb (diff)
downloadswig-4a73d986ddc26fd8eab62219090a4bc4bb55a453.tar.gz
Any 'using' statements in the protected section of a class were previously ignored with dirprot mode, certainly with Java and C#. Also directors - a call to a method being defined in the base class, not overridden in a subcalss, but again overridden in a class derived from the first subclass was not being dispatched correcly to the most derived class - affecting non-scripting languages. Fix for C# is based on recent fix for D.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12419 626c5289-ae23-0410-ae9c-e8d60b6d4f22
Diffstat (limited to 'Examples/test-suite/csharp/director_protected_runme.cs')
-rw-r--r--Examples/test-suite/csharp/director_protected_runme.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/Examples/test-suite/csharp/director_protected_runme.cs b/Examples/test-suite/csharp/director_protected_runme.cs
index ee4697b0e..b44c3b7e9 100644
--- a/Examples/test-suite/csharp/director_protected_runme.cs
+++ b/Examples/test-suite/csharp/director_protected_runme.cs
@@ -16,6 +16,7 @@ public class runme
Foo f = b.create();
FooBar fb = new FooBar();
FooBar2 fb2 = new FooBar2();
+ FooBar3 fb3 = new FooBar3();
String s;
s = fb.used();
@@ -37,6 +38,21 @@ public class runme
s = fb.pong();
if ( s != ("Bar::pong();Foo::pong();FooBar::ping();"))
throw new Exception("bad FooBar::pong");
+
+// if (fb3.cheer() != "FooBar3::cheer();")
+// throw new Exception("bad fb3::cheer");
+
+ if (fb2.callping() != "FooBar2::ping();")
+ throw new Exception("bad fb2.callping");
+
+ if (fb2.callcheer() != "FooBar2::pang();Bar::pong();Foo::pong();FooBar2::ping();")
+ throw new Exception("bad fb2.callcheer");
+
+ if (fb3.callping() != "Bar::ping();")
+ throw new Exception("bad fb3.callping");
+
+ if (fb3.callcheer() != "FooBar3::cheer();")
+ throw new Exception("bad fb3.callcheer");
}
}
@@ -69,4 +85,16 @@ class FooBar2 : Bar
}
}
+class FooBar3 : Bar
+{
+ public FooBar3() : base()
+ {
+ }
+
+ protected override String cheer()
+ {
+ return "FooBar3::cheer();";
+ }
+}
+
}