]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add invalid "error creation" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 22 Feb 2022 09:56:05 +0000 (10:56 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 22 Feb 2022 09:56:05 +0000 (10:56 +0100)
tests/Makefile.am
tests/errors/error-creation-invalid-type.test [new file with mode: 0644]
tests/errors/error-creation-invalid.test [new file with mode: 0644]

index 05bf52d1dd19bb09bf6c76b57df80b24fa62f33b..06043b4ed63988d287e0ba1166a42f727673245b 100644 (file)
@@ -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 (file)
index 0000000..c5080b1
--- /dev/null
@@ -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 (file)
index 0000000..bb21adf
--- /dev/null
@@ -0,0 +1,9 @@
+Invalid Code
+
+errordomain FooError {
+       FAIL;
+}
+
+void main () {
+       var e = new FooError.FAIL ();
+}