From: Rico Tzschichholz Date: Tue, 22 Feb 2022 12:10:20 +0000 (+0100) Subject: tests: Extend "direct access to error code" test to increase coverage X-Git-Tag: 0.54.8~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f6e96d1231458839d13194f38e33c33ac29dc3d;p=thirdparty%2Fvala.git tests: Extend "direct access to error code" test to increase coverage --- diff --git a/tests/errors/errorcode.c-expected b/tests/errors/errorcode.c-expected index fe2d65cd9..45c7db847 100644 --- a/tests/errors/errorcode.c-expected +++ b/tests/errors/errorcode.c-expected @@ -28,6 +28,7 @@ typedef enum { #define FOO_ERROR foo_error_quark () VALA_EXTERN GQuark foo_error_quark (void); +VALA_EXTERN void bar (gint code); static void _vala_main (void); GQuark @@ -36,6 +37,12 @@ foo_error_quark (void) return g_quark_from_static_string ("foo-error-quark"); } +void +bar (gint code) +{ + _vala_assert (code == 23, "code == 23"); +} + static void _vala_main (void) { @@ -78,6 +85,9 @@ _vala_main (void) code = FOO_ERROR_EVEN_WORSE; _vala_assert (code == 23, "code == 23"); } + { + bar (FOO_ERROR_EVEN_WORSE); + } } int diff --git a/tests/errors/errorcode.vala b/tests/errors/errorcode.vala index 2cb96ec67..b1e6d4ce9 100644 --- a/tests/errors/errorcode.vala +++ b/tests/errors/errorcode.vala @@ -4,6 +4,10 @@ errordomain FooError { EVEN_WORSE = 23 } +void bar (int code) { + assert (code == 23); +} + void main () { { var error = new IOError.NO_SPACE ("foo"); @@ -29,4 +33,7 @@ void main () { var code = FooError.EVEN_WORSE; assert (code == 23); } + { + bar (FooError.EVEN_WORSE); + } }