]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Simplify "errors/errors" test a bit
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 27 Nov 2018 13:18:36 +0000 (14:18 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 27 Nov 2018 13:26:37 +0000 (14:26 +0100)
tests/errors/errors.vala

index fb29c7c7c2977c0e6f78ce8c54210aaf16255611..0029bff6cd13acbd9871d11d65a7db23de76839e 100644 (file)
@@ -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 ();
-}
-