]> 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>
Thu, 17 Mar 2022 10:52:20 +0000 (11:52 +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 6f14a582a140fcb767fff4fb071fe276fe7dd746..2e77fd7f6d9b7df056abfbf3527755c4a39c15be 100644 (file)
@@ -662,6 +662,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 ();
+}