]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "struct in array" test to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Sat, 23 Feb 2019 19:19:31 +0000 (20:19 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sat, 23 Feb 2019 19:19:31 +0000 (20:19 +0100)
tests/basic-types/arrays.vala

index cbbdc6ef0119d96aadd6dd1c9ecd17a8f354cee3..174e5d4728004858d27b1d29249a7112d079bf27 100644 (file)
@@ -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]) {