[vala/0.36] tests: Simplify "errors/errors" test a bit



commit 7982dc8f9badb63f1c5f1bd53200efc2837ad774
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 c1d44979b..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 ();
-
-               stdout.printf (" 11\n");
+void main () {
+       stdout.printf ("Exception Test: 1");
 
-               test_generic_catch ();
+       var bar = new Bar ();
+       bar.run ();
 
-               return 0;
-       }
-}
+       stdout.printf (" 11\n");
 
-void main () {
-       Maman.Bar.main ();
+       Bar.test_generic_catch ();
+       Bar.test_try_without_error ();
 }
-


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]