[vala/staging] tests: Simplify "errors/errors" test a bit
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging] tests: Simplify "errors/errors" test a bit
- Date: Tue, 27 Nov 2018 13:28:22 +0000 (UTC)
commit fe05325a58398ed5be1dc15c73267fedd5bff8f6
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Tue Nov 27 14:18:36 2018 +0100
tests: Simplify "errors/errors" test a bit
tests/errors/errors.vala | 30 ++++++++++++------------------
1 file changed, 12 insertions(+), 18 deletions(-)
---
diff --git a/tests/errors/errors.vala b/tests/errors/errors.vala
index fb29c7c7c..0029bff6c 100644
--- a/tests/errors/errors.vala
+++ b/tests/errors/errors.vala
@@ -1,11 +1,11 @@
using GLib;
-errordomain Maman.BarError {
+errordomain BarError {
FOO,
BAR
}
-class Maman.Bar : Object {
+class Bar : Object {
public void foo () throws BarError {
stdout.printf (" 6");
@@ -54,7 +54,7 @@ class Maman.Bar : Object {
stdout.printf (" 10");
}
- static void test_generic_catch () {
+ public static void test_generic_catch () {
try {
throw new BarError.FOO ("error message");
} catch (Error e) {
@@ -66,28 +66,22 @@ class Maman.Bar : Object {
assert_not_reached ();
}
- static void test_try_without_error () {
+ public static void test_try_without_error () {
try {
} catch (Error e) {
assert_not_reached ();
}
}
+}
- public static int main () {
- stdout.printf ("Exception Test: 1");
-
- var bar = new Bar ();
- bar.run ();
+void main () {
+ stdout.printf ("Exception Test: 1");
- stdout.printf (" 11\n");
+ var bar = new Bar ();
+ bar.run ();
- test_generic_catch ();
+ stdout.printf (" 11\n");
- return 0;
- }
+ Bar.test_generic_catch ();
+ Bar.test_try_without_error ();
}
-
-void main () {
- Maman.Bar.main ();
-}
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]