summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJuerg Billeter <j@bitron.ch>2007-12-12 16:39:59 +0000
committerJürg Billeter <juergbi@src.gnome.org>2007-12-12 16:39:59 +0000
commitcc744d6c3eacb7ac38254e4e48d0b175f97f028b (patch)
tree5a9ac3e2e5143bd4265557b427eb08b1626ca9f2 /tests
parenta501e632c11b48f004c36fc88d2cd4aef8e12ce2 (diff)
downloadvala-cc744d6c3eacb7ac38254e4e48d0b175f97f028b.tar.gz
fix invalid C code for virtual interface method implementations
2007-12-12 Juerg Billeter <j@bitron.ch> * gobject/valaccodegeneratormethod.vala: fix invalid C code for virtual interface method implementations * tests/interfaces.exp, tests/interfaces.vala: test virtual interface method implementations svn path=/trunk/; revision=763
Diffstat (limited to 'tests')
-rw-r--r--tests/interfaces.exp2
-rw-r--r--tests/interfaces.vala23
2 files changed, 23 insertions, 2 deletions
diff --git a/tests/interfaces.exp b/tests/interfaces.exp
index 837ce79aa..388004fe9 100644
--- a/tests/interfaces.exp
+++ b/tests/interfaces.exp
@@ -1 +1 @@
-Interface Test: 1 2 3
+Interface Test: 1 2 3 4 5 6 7
diff --git a/tests/interfaces.vala b/tests/interfaces.vala
index d269ad659..7eb652e3f 100644
--- a/tests/interfaces.vala
+++ b/tests/interfaces.vala
@@ -2,6 +2,8 @@ using GLib;
interface Maman.Ibaz : Object {
public abstract void do_action ();
+
+ public abstract void do_virtual_action ();
}
class Maman.Baz : Object, Ibaz {
@@ -9,13 +11,32 @@ class Maman.Baz : Object, Ibaz {
stdout.printf (" 2");
}
+ public virtual void do_virtual_action () {
+ stdout.printf (" 4");
+ }
+}
+
+class Maman.SubBaz : Baz {
+ public override void do_virtual_action () {
+ stdout.printf (" 6");
+ }
+
static int main (string[] args) {
stdout.printf ("Interface Test: 1");
Ibaz ibaz = new Baz ();
ibaz.do_action ();
- stdout.printf (" 3\n");
+ stdout.printf (" 3");
+
+ ibaz.do_virtual_action ();
+
+ stdout.printf (" 5");
+
+ Ibaz subbaz = new SubBaz ();
+ subbaz.do_virtual_action ();
+
+ stdout.printf (" 7\n");
return 0;
}