diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-04-23 09:22:40 +0200 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-04-23 09:23:55 +0200 |
commit | d4da5be30c43ecbc74723e53c7200e8aaeb8cc1a (patch) | |
tree | 0e596df7125b19fcbb0d4d7197a064d13e7c69e7 | |
parent | 3e09e17f318c2af7cb71271ed6509b5a6624b82b (diff) | |
download | vala-d4da5be30c43ecbc74723e53c7200e8aaeb8cc1a.tar.gz |
tests: More "unassigned variable" tests to increase coverage
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/control-flow/unassigned-local-variable-2.test | 8 | ||||
-rw-r--r-- | tests/control-flow/unassigned-local-variable-3.test | 8 |
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 (); + } +} |