[vala/staging: 9/10] tests: Add "constructor with inner error" test to increase coverage




commit 3756a1621a2560c78a0ee490f36c7f350d69b208
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Nov 14 21:31:03 2020 +0100

    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(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2b3061793..5564de03f 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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
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 ();
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]