]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: More "unassigned variable" tests to increase coverage d4da5be30c43ecbc74723e53c7200e8aaeb8cc1a
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 23 Apr 2019 07:22:40 +0000 (09:22 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 23 Apr 2019 07:23:55 +0000 (09:23 +0200)
tests/Makefile.am
tests/control-flow/unassigned-local-variable-2.test [new file with mode: 0644]
tests/control-flow/unassigned-local-variable-3.test [new file with mode: 0644]

index 456761ea6aee2edaf6cfc7003fcf9be42131de13..cfdfafa1e5c9a337a9a6957bb4227028e258f8ba 100644 (file)
@@ -165,6 +165,8 @@ TESTS = \
        control-flow/unassigned-captured-local-variable.test \
        control-flow/unassigned-local-block-variable.test \
        control-flow/unassigned-local-variable.test \
+       control-flow/unassigned-local-variable-2.test \
+       control-flow/unassigned-local-variable-3.test \
        control-flow/unassigned-local-variable-while.test \
        control-flow/while-false.vala \
        control-flow/bug628336.vala \
diff --git a/tests/control-flow/unassigned-local-variable-2.test b/tests/control-flow/unassigned-local-variable-2.test
new file mode 100644 (file)
index 0000000..6d9d5e7
--- /dev/null
@@ -0,0 +1,8 @@
+Invalid Code
+
+void main () {
+       int i;
+       if (i < 42 || (i = 23) > 42) {
+               assert_not_reached ();
+       }
+}
diff --git a/tests/control-flow/unassigned-local-variable-3.test b/tests/control-flow/unassigned-local-variable-3.test
new file mode 100644 (file)
index 0000000..36ad99a
--- /dev/null
@@ -0,0 +1,8 @@
+Invalid Code
+
+void main () {
+       int i;
+       if (i < 42 && (i = 23) > 42) {
+               assert_not_reached ();
+       }
+}