]> 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>
Sun, 3 Jan 2021 12:13:01 +0000 (13:13 +0100)
tests/Makefile.am
tests/objects/constructor-inner-error.vala [new file with mode: 0644]

index 5c72dff8850ee7134f36fa26313fe7bf9cc017bb..0945c7ed4ec5ddb796be4bcd5624f91e227e3195 100644 (file)
@@ -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 (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 ();
+}