[vala/staging: 3/4] tests: Add some tests to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging: 3/4] tests: Add some tests to increase coverage
- Date: Wed, 3 Mar 2021 16:49:39 +0000 (UTC)
commit ac1e52dfa654a3d184f7b843bfbdb2e33fa8c24f
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Wed Mar 3 16:06:34 2021 +0100
tests: Add some tests to increase coverage
tests/Makefile.am | 1 +
tests/control-flow/for.vala | 15 +++++++++++++++
tests/semantic/assignment-fixed-array-length.test | 6 ++++++
3 files changed, 22 insertions(+)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index fe064e2f8..7af73a986 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -882,6 +882,7 @@ TESTS = \
semantic/array-incompatible-initializer2.test \
semantic/assignment-element-incompatible-ownership.test \
semantic/assignment-element-incompatible-type.test \
+ semantic/assignment-fixed-array-length.test \
semantic/assignment-same-variable.vala \
semantic/assignment-signal-incompatible-method.test \
semantic/assignment-signal-incompatible-type.test \
diff --git a/tests/control-flow/for.vala b/tests/control-flow/for.vala
index c435c0417..7b074d787 100644
--- a/tests/control-flow/for.vala
+++ b/tests/control-flow/for.vala
@@ -8,7 +8,22 @@ void test_for_void_methods () {
}
}
+void condition_true () {
+ for (;true;) {
+ return;
+ }
+ assert_not_reached ();
+}
+
+void condition_false () {
+ for (;false;) {
+ assert_not_reached ();
+ }
+}
+
void main () {
+ condition_true ();
+ condition_false ();
test_for_void_methods ();
}
diff --git a/tests/semantic/assignment-fixed-array-length.test
b/tests/semantic/assignment-fixed-array-length.test
new file mode 100644
index 000000000..5de56ba56
--- /dev/null
+++ b/tests/semantic/assignment-fixed-array-length.test
@@ -0,0 +1,6 @@
+Invalid Code
+
+void main () {
+ int i[42];
+ i.length = 23;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]