summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2019-04-23 09:22:40 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2019-04-23 09:23:55 +0200
commitd4da5be30c43ecbc74723e53c7200e8aaeb8cc1a (patch)
tree0e596df7125b19fcbb0d4d7197a064d13e7c69e7
parent3e09e17f318c2af7cb71271ed6509b5a6624b82b (diff)
downloadvala-d4da5be30c43ecbc74723e53c7200e8aaeb8cc1a.tar.gz
tests: More "unassigned variable" tests to increase coverage
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/control-flow/unassigned-local-variable-2.test8
-rw-r--r--tests/control-flow/unassigned-local-variable-3.test8
3 files changed, 18 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 456761ea6..cfdfafa1e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -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
index 000000000..6d9d5e74f
--- /dev/null
+++ b/tests/control-flow/unassigned-local-variable-2.test
@@ -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
index 000000000..36ad99a39
--- /dev/null
+++ b/tests/control-flow/unassigned-local-variable-3.test
@@ -0,0 +1,8 @@
+Invalid Code
+
+void main () {
+ int i;
+ if (i < 42 && (i = 23) > 42) {
+ assert_not_reached ();
+ }
+}