From: Rico Tzschichholz Date: Sun, 7 Jan 2018 08:45:04 +0000 (+0100) Subject: tests: Add explicit "move" and "resize" array tests to increase coverage X-Git-Tag: 0.39.4~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2457d833b102de0504797aff57042deb835d4ae;p=thirdparty%2Fvala.git tests: Add explicit "move" and "resize" array tests to increase coverage --- diff --git a/tests/basic-types/arrays.vala b/tests/basic-types/arrays.vala index 874f4112f..4f821d94d 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 (); }