[vala/0.42] tests: Add "struct in array" test to increase coverage



commit 0dd21471bb09bebc3a432daa8af323946f60c1cd
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sat Feb 23 20:19:31 2019 +0100

    tests: Add "struct in array" test to increase coverage

 tests/basic-types/arrays.vala | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/tests/basic-types/arrays.vala b/tests/basic-types/arrays.vala
index cbbdc6ef0..174e5d472 100644
--- a/tests/basic-types/arrays.vala
+++ b/tests/basic-types/arrays.vala
@@ -263,8 +263,17 @@ const Foo[] FOO_ARRAY_CONST = {
        { { "foo", "bar" }, 42 },
 };
 
+struct Bar {
+       public int bar;
+}
+
 void test_struct_array () {
        assert (FOO_ARRAY_CONST[0].bar == 42);
+
+       Bar b = { 4711 };
+       var bar = new Bar[23];
+       bar[7] = b;
+       assert (b in bar);
 }
 
 void give_fixed_array (out int i[3]) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]