gtk+-4.0: Change type of Gdk.Key.* constants to uint
[vala-gnome.git] / tests / objects / bug731547.vala
bloba42ab73b56467bfe7434ed9b6723de4b5f158603
1 public class Foo : Object {
2 [CCode (cname = "baz")]
3 public signal void foo ();
4 [CCode (cname = "baz-bar")]
5 public signal void foo_bar ();
6 [CCode (cname = "baz-virt")]
7 public virtual signal void foo_virt () {
8 callback ();
12 int baz = 0;
14 void callback () {
15 baz++;
18 void main () {
19 var foo = new Foo ();
20 foo.foo.connect (callback);
21 foo.foo_bar.connect (callback);
23 foo.foo ();
24 assert (baz == 1);
25 foo.foo_bar ();
26 assert (baz == 2);
27 foo.foo_virt ();
28 assert (baz == 3);
30 Signal.emit_by_name (foo, "baz");
31 assert (baz == 4);
32 Signal.emit_by_name (foo, "baz-bar");
33 assert (baz == 5);
34 Signal.emit_by_name (foo, "baz-virt");
35 assert (baz == 6);