From: Rico Tzschichholz Date: Tue, 27 Nov 2018 13:18:36 +0000 (+0100) Subject: tests: Simplify "errors/errors" test a bit X-Git-Tag: 0.42.4~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f774948642783b2a9ace817a9e33ae9d4e0f193;p=thirdparty%2Fvala.git tests: Simplify "errors/errors" test a bit --- 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 (); -} -