]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add some tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 3 Mar 2021 15:06:34 +0000 (16:06 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 3 Mar 2021 16:48:41 +0000 (17:48 +0100)
tests/Makefile.am
tests/control-flow/for.vala
tests/semantic/assignment-fixed-array-length.test [new file with mode: 0644]

index fe064e2f8bf8aeaffd8e22501d51a2c8f166a301..7af73a9867790d3bbe004bf0ebb0c1138786a9dd 100644 (file)
@@ -882,6 +882,7 @@ TESTS = \
        semantic/array-incompatible-initializer2.test \
        semantic/assignment-element-incompatible-ownership.test \
        semantic/assignment-element-incompatible-type.test \
+       semantic/assignment-fixed-array-length.test \
        semantic/assignment-same-variable.vala \
        semantic/assignment-signal-incompatible-method.test \
        semantic/assignment-signal-incompatible-type.test \
index c435c04171c209944edc4f202ae2e7d57d433226..7b074d787e4012718722bd632f21c1d11ba87ea3 100644 (file)
@@ -8,7 +8,22 @@ void test_for_void_methods () {
        }
 }
 
+void condition_true () {
+       for (;true;) {
+               return;
+       }
+       assert_not_reached ();
+}
+
+void condition_false () {
+       for (;false;) {
+               assert_not_reached ();
+       }
+}
+
 void main () {
+       condition_true ();
+       condition_false ();
        test_for_void_methods ();
 }
 
diff --git a/tests/semantic/assignment-fixed-array-length.test b/tests/semantic/assignment-fixed-array-length.test
new file mode 100644 (file)
index 0000000..5de56ba
--- /dev/null
@@ -0,0 +1,6 @@
+Invalid Code
+
+void main () {
+       int i[42];
+       i.length = 23;
+}