summaryrefslogtreecommitdiff
path: root/tests/objects/gsource.vala
diff options
context:
space:
mode:
authorOle André Vadla Ravnås <oleavr@gmail.com>2021-05-22 23:37:28 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2021-05-22 23:48:02 +0200
commitbf2f5c1ef74f4f242da35f25e28e1669964c8e97 (patch)
treebbeab2b7cb7aa19549c130ddb737b89117398657 /tests/objects/gsource.vala
parentd1cb327977fb614f0064c567ad67b96b8c03f023 (diff)
downloadvala-bf2f5c1ef74f4f242da35f25e28e1669964c8e97.tar.gz
codegen: Fix support for public fields on GLib.Source subclasses
Diffstat (limited to 'tests/objects/gsource.vala')
-rw-r--r--tests/objects/gsource.vala22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/objects/gsource.vala b/tests/objects/gsource.vala
index cb2543979..753d2c4d9 100644
--- a/tests/objects/gsource.vala
+++ b/tests/objects/gsource.vala
@@ -13,6 +13,28 @@ class FooSource : Source {
}
}
+class BarSource : Source {
+ public int custom_timeout;
+
+ public BarSource (int timeout) {
+ custom_timeout = timeout;
+ }
+
+ public override bool prepare (out int timeout) {
+ timeout = custom_timeout;
+ return false;
+ }
+
+ public override bool check () {
+ return false;
+ }
+
+ public override bool dispatch (SourceFunc? callback) {
+ return false;
+ }
+}
+
void main () {
var foo = new FooSource ();
+ var bar = new BarSource (1000);
}