summaryrefslogtreecommitdiff
path: root/tests/asynchronous
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2017-03-06 08:51:51 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2017-03-06 14:21:08 +0100
commit4796cc50eee4b70b674e8c0d045f79f2d6c26f98 (patch)
tree2c01c0fb32b2e5165e08da236ba93a2267e63362 /tests/asynchronous
parent0ed992c54c0180cd9ef523023680f844a7cfd06e (diff)
downloadvala-4796cc50eee4b70b674e8c0d045f79f2d6c26f98.tar.gz
tests: Add "finish_instance = false" test-case
Also references IOSteam.splice_async() as compilation check. https://bugzilla.gnome.org/show_bug.cgi?id=710103
Diffstat (limited to 'tests/asynchronous')
-rw-r--r--tests/asynchronous/bug710103.vala43
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/asynchronous/bug710103.vala b/tests/asynchronous/bug710103.vala
new file mode 100644
index 000000000..b6395e351
--- /dev/null
+++ b/tests/asynchronous/bug710103.vala
@@ -0,0 +1,43 @@
+void iostream () {
+ IOStream? is0 = null;
+ IOStream? is1 = null;
+ is0.splice_async.begin (is1, IOStreamSpliceFlags.NONE, Priority.DEFAULT, null, (obj, res) => {
+ try {
+ is0.splice_async.end (res);
+ } catch (Error e) {
+ }
+ });
+}
+
+class Foo : Object {
+ public int manam;
+
+ [CCode (finish_instance = false)]
+ public async void bar () {
+ manam = 23;
+ }
+
+ [CCode (finish_instance = false)]
+ public async Foo.@async () {
+ manam = 42;
+ }
+
+ public static async Foo create_foo_async () {
+ var foo = yield new Foo.@async ();
+ return foo;
+ }
+}
+
+void main () {
+ var loop = new MainLoop ();
+ Foo.create_foo_async.begin ((obj,res) => {
+ var foo = Foo.create_foo_async.end (res);
+ assert (foo.manam == 42);
+ foo.bar.begin ((obj, res) => {
+ foo.bar.end (res);
+ assert (foo.manam == 23);
+ loop.quit ();
+ });
+ });
+ loop.run ();
+}