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




commit ac9a2ae616675a30b079c9eb7c4002cfeb00adde
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 05bf52d1d..06043b4ed 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -677,6 +677,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]