From 489eb2e72311980669439f2f836bf509ae663761 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Sat, 14 Nov 2020 21:31:03 +0100 Subject: [PATCH] tests: Add "constructor with inner error" test to increase coverage --- tests/Makefile.am | 1 + tests/objects/constructor-inner-error.vala | 24 ++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 tests/objects/constructor-inner-error.vala diff --git a/tests/Makefile.am b/tests/Makefile.am index 5c72dff88..0945c7ed4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -338,6 +338,7 @@ TESTS = \ objects/class-vfunc-base-access.vala \ objects/classes.vala \ objects/compact-class-destructor.vala \ + objects/constructor-inner-error.vala \ objects/constructor-variadic.test \ objects/constructor-wrong-name.test \ objects/constructors.vala \ diff --git a/tests/objects/constructor-inner-error.vala b/tests/objects/constructor-inner-error.vala new file mode 100644 index 000000000..896ffe976 --- /dev/null +++ b/tests/objects/constructor-inner-error.vala @@ -0,0 +1,24 @@ +void bar () throws Error { +} + +class Foo : Object { + public Foo () throws Error { + bar (); + } + + construct { + bar (); + } + + class construct { + bar (); + } + + static construct { + bar (); + } +} + +void main () { + var foo = new Foo (); +} -- 2.47.2