From: Rico Tzschichholz Date: Tue, 23 Apr 2019 07:22:40 +0000 (+0200) Subject: tests: More "unassigned variable" tests to increase coverage X-Git-Tag: 0.36.20~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aadbace07ec43f1d7bd995138c1ff949ad0fbb1e;p=thirdparty%2Fvala.git tests: More "unassigned variable" tests to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index bc600c141..98185b294 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -141,6 +141,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/while-false.vala \ control-flow/bug628336.vala \ control-flow/bug639482.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 (); + } +}