From d4da5be30c43ecbc74723e53c7200e8aaeb8cc1a Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Tue, 23 Apr 2019 09:22:40 +0200 Subject: [PATCH] tests: More "unassigned variable" tests to increase coverage --- tests/Makefile.am | 2 ++ tests/control-flow/unassigned-local-variable-2.test | 8 ++++++++ tests/control-flow/unassigned-local-variable-3.test | 8 ++++++++ 3 files changed, 18 insertions(+) create mode 100644 tests/control-flow/unassigned-local-variable-2.test create mode 100644 tests/control-flow/unassigned-local-variable-3.test 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 (); + } +} -- 2.47.2