From: Rico Tzschichholz Date: Sat, 23 Oct 2021 16:27:29 +0000 (+0200) Subject: tests: Add "throws error code" tests to increase coverage X-Git-Tag: 0.52.7~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b83759d81327dfac83198f8ebd2aa8942594b9f;p=thirdparty%2Fvala.git tests: Add "throws error code" tests to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 77f144ca2..2951db733 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -624,6 +624,7 @@ TESTS = \ errors/catch-in-finally.vala \ errors/catch-no-error-type.test \ errors/default-gtype.vala \ + errors/delegate-throws-error-code.vala \ errors/delegate-throws-no-error-type.test \ errors/errors.vala \ errors/errorcode.vala \ @@ -633,6 +634,7 @@ TESTS = \ errors/invalid-type-check.test \ errors/loops.vala \ errors/method-throws.vala \ + errors/method-throws-error-code.vala \ errors/method-throws-no-error-type.test \ errors/unhandled.vala \ errors/bug567181.vala \ diff --git a/tests/errors/delegate-throws-error-code.vala b/tests/errors/delegate-throws-error-code.vala new file mode 100644 index 000000000..c06ed15e1 --- /dev/null +++ b/tests/errors/delegate-throws-error-code.vala @@ -0,0 +1,11 @@ +errordomain FooError { + FOO, + BAR; +} + +delegate void FooFunc () throws FooError.BAR; + +void main () { + FooFunc foo = () => {}; + foo (); +} diff --git a/tests/errors/method-throws-error-code.vala b/tests/errors/method-throws-error-code.vala new file mode 100644 index 000000000..dbe2d92b8 --- /dev/null +++ b/tests/errors/method-throws-error-code.vala @@ -0,0 +1,11 @@ +errordomain FooError { + FOO, + BAR; +} + +void foo () throws FooError.BAR { +} + +void main () { + foo (); +}