]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "constructor with inner error" test to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 14 Nov 2020 20:31:03 +0000 (21:31 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 14 Nov 2020 20:31:03 +0000 (21:31 +0100)
tests/Makefile.am
tests/objects/constructor-inner-error.vala [new file with mode: 0644]

index 2b3061793a4105b5c5e705c9262875da29a3fc85..5564de03f667adb0698e80a5c9de0a245f1dd4fb 100644 (file)
@@ -408,6 +408,7 @@ TESTS = \
        objects/compact-class-refcount.vala \
        objects/compact-class-custom-ref.vala \
        objects/constructor-abstract-public.test \
+       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 (file)
index 0000000..896ffe9
--- /dev/null
@@ -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 ();
+}