summaryrefslogtreecommitdiff
path: root/tests/objects/signals-error-marshal.vala
blob: b727777e25d185750ee5b337df048d7b2b275b2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
errordomain FooError {
	BAD;
}

struct Bar {
	public int i;
}

class Foo : GLib.Object {
	signal void foo (void* p, Bar bar);
	signal void bar (void* p, Error e);

	public Foo () {
		bar.connect (callback);
		bar (null, new FooError.BAD ("bad"));
	}

	void callback (void* p, Error e) {
		assert (p == null);
		assert (e.code == FooError.BAD);
	}
}

void main() {
	var foo = new Foo ();
}