aboutsummaryrefslogtreecommitdiff
path: root/test cases/vala
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-08-14 21:48:51 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2018-08-15 22:28:42 +0300
commitb400cbe058df10bc37e628305c72c574177062e2 (patch)
tree9213e76af99f646b6ff19d26357ac3d6284bb2f9 /test cases/vala
parentd57498a4fde13a04d56e7fc26199df2b10cbdf60 (diff)
downloadmeson-b400cbe058df10bc37e628305c72c574177062e2.zip
meson-b400cbe058df10bc37e628305c72c574177062e2.tar.gz
meson-b400cbe058df10bc37e628305c72c574177062e2.tar.bz2
Kill tabs dead! For good!
Diffstat (limited to 'test cases/vala')
-rw-r--r--test cases/vala/10 mixed sources/vala/bar.vala2
-rw-r--r--test cases/vala/5 target glib/GLib.Thread.vala72
-rw-r--r--test cases/vala/9 gir/foo.vala8
3 files changed, 41 insertions, 41 deletions
diff --git a/test cases/vala/10 mixed sources/vala/bar.vala b/test cases/vala/10 mixed sources/vala/bar.vala
index 10dce1e..0772f3e 100644
--- a/test cases/vala/10 mixed sources/vala/bar.vala
+++ b/test cases/vala/10 mixed sources/vala/bar.vala
@@ -1,5 +1,5 @@
extern int test ();
public int main (string[] args) {
- return test ();
+ return test ();
}
diff --git a/test cases/vala/5 target glib/GLib.Thread.vala b/test cases/vala/5 target glib/GLib.Thread.vala
index a1a0414..7018821 100644
--- a/test cases/vala/5 target glib/GLib.Thread.vala
+++ b/test cases/vala/5 target glib/GLib.Thread.vala
@@ -1,43 +1,43 @@
extern int get_ret_code ();
public class MyThread : Object {
- public int x_times { get; private set; }
-
- public MyThread (int times) {
- this.x_times = times;
- }
-
- public int run () {
- for (int i = 0; i < this.x_times; i++) {
- stdout.printf ("ping! %d/%d\n", i + 1, this.x_times);
- Thread.usleep (10000);
- }
-
- // return & exit have the same effect
- Thread.exit (get_ret_code ());
- return 43;
- }
+ public int x_times { get; private set; }
+
+ public MyThread (int times) {
+ this.x_times = times;
+ }
+
+ public int run () {
+ for (int i = 0; i < this.x_times; i++) {
+ stdout.printf ("ping! %d/%d\n", i + 1, this.x_times);
+ Thread.usleep (10000);
+ }
+
+ // return & exit have the same effect
+ Thread.exit (get_ret_code ());
+ return 43;
+ }
}
public static int main (string[] args) {
- // Check whether threads are supported:
- if (Thread.supported () == false) {
- stderr.printf ("Threads are not supported!\n");
- return -1;
- }
-
- try {
- // Start a thread:
- MyThread my_thread = new MyThread (10);
- Thread<int> thread = new Thread<int>.try ("My fst. thread", my_thread.run);
-
- // Wait until thread finishes:
- int result = thread.join ();
- // Output: `Thread stopped! Return value: 42`
- stdout.printf ("Thread stopped! Return value: %d\n", result);
- } catch (Error e) {
- stdout.printf ("Error: %s\n", e.message);
- }
-
- return 0;
+ // Check whether threads are supported:
+ if (Thread.supported () == false) {
+ stderr.printf ("Threads are not supported!\n");
+ return -1;
+ }
+
+ try {
+ // Start a thread:
+ MyThread my_thread = new MyThread (10);
+ Thread<int> thread = new Thread<int>.try ("My fst. thread", my_thread.run);
+
+ // Wait until thread finishes:
+ int result = thread.join ();
+ // Output: `Thread stopped! Return value: 42`
+ stdout.printf ("Thread stopped! Return value: %d\n", result);
+ } catch (Error e) {
+ stdout.printf ("Error: %s\n", e.message);
+ }
+
+ return 0;
}
diff --git a/test cases/vala/9 gir/foo.vala b/test cases/vala/9 gir/foo.vala
index 00c4812..bb6da10 100644
--- a/test cases/vala/9 gir/foo.vala
+++ b/test cases/vala/9 gir/foo.vala
@@ -1,7 +1,7 @@
namespace Foo
{
- public int bar ()
- {
- return 0;
- }
+ public int bar ()
+ {
+ return 0;
+ }
}