[vala/0.44] tests: More "unassigned variable" tests to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.44] tests: More "unassigned variable" tests to increase coverage
- Date: Wed, 1 May 2019 17:19:56 +0000 (UTC)
commit 6b30e1af4f3fa5d14e7601f561ce0c10297288df
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Tue Apr 23 09:22:40 2019 +0200
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(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2823697c3..30af52d2b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -164,6 +164,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 ();
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]