[vala/0.36: 133/212] tests: Add explicit "move" and "resize" array tests to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.36: 133/212] tests: Add explicit "move" and "resize" array tests to increase coverage
- Date: Sat, 14 Apr 2018 07:54:32 +0000 (UTC)
commit 02784e8502957508735f5ede4f7f5ee938922954
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Jan 7 09:45:04 2018 +0100
tests: Add explicit "move" and "resize" array tests to increase coverage
tests/basic-types/arrays.vala | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/tests/basic-types/arrays.vala b/tests/basic-types/arrays.vala
index 874f411..4f821d9 100644
--- a/tests/basic-types/arrays.vala
+++ b/tests/basic-types/arrays.vala
@@ -227,6 +227,20 @@ void test_explicit_copying () {
assert (a0[1] == a1[1]);
}
+void test_array_move () {
+ int[] a = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ assert (a[4] == 5);
+ a.move (4, 0, 5);
+ assert (a[4] == 9);
+}
+
+void test_array_resize () {
+ int[] a = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
+ assert (a[a.length - 1] == 9);
+ a.resize (5);
+ assert (a[a.length - 1] == 5);
+}
+
void main () {
test_integer_array ();
test_string_array ();
@@ -240,4 +254,6 @@ void main () {
test_generics_array ();
test_void_array ();
test_explicit_copying ();
+ test_array_move ();
+ test_array_resize ();
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]