]> 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>
Mon, 21 Mar 2022 08:06:43 +0000 (09:06 +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 22039493abc15d7fd1c84225bb1be4e855cce37b..a3d22a843f615295f32fe1629e3dfb376ebe74c2 100644 (file)
@@ -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 (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 ();
+}