[vala/0.48] tests: Add invalid "error creation" tests to increase coverage



commit 2a9d007ae89529ffa10d7c198e0c8006f35c5bbb
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Feb 22 10:56:05 2022 +0100

    tests: Add invalid "error creation" tests to increase coverage

 tests/Makefile.am                             | 2 ++
 tests/errors/error-creation-invalid-type.test | 9 +++++++++
 tests/errors/error-creation-invalid.test      | 9 +++++++++
 3 files changed, 20 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 22039493a..a3d22a843 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -633,6 +633,8 @@ TESTS = \
        errors/default-gtype.vala \
        errors/delegate-throws-error-code.vala \
        errors/delegate-throws-no-error-type.test \
+       errors/error-creation-invalid.test \
+       errors/error-creation-invalid-type.test \
        errors/errors.vala \
        errors/errorcode.vala \
        errors/errordomain.vala \
diff --git a/tests/errors/error-creation-invalid-type.test b/tests/errors/error-creation-invalid-type.test
new file mode 100644
index 000000000..c5080b1e8
--- /dev/null
+++ b/tests/errors/error-creation-invalid-type.test
@@ -0,0 +1,9 @@
+Invalid Code
+
+errordomain FooError {
+       FAIL;
+}
+
+void main () {
+       var e = new FooError.FAIL (42);
+}
diff --git a/tests/errors/error-creation-invalid.test b/tests/errors/error-creation-invalid.test
new file mode 100644
index 000000000..bb21adf9f
--- /dev/null
+++ b/tests/errors/error-creation-invalid.test
@@ -0,0 +1,9 @@
+Invalid Code
+
+errordomain FooError {
+       FAIL;
+}
+
+void main () {
+       var e = new FooError.FAIL ();
+}


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