diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-02-23 20:19:31 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2019-02-23 20:19:31 +0100 |
commit | 339776721db26b897a85f0f9052e708fd2a919ba (patch) | |
tree | ef3bfc54bb5a9ea60b834e7bf36af3891968996f /tests/basic-types | |
parent | 4e4ce22bdf93ec3ba3f12cc74b1fa2af66e32404 (diff) | |
download | vala-339776721db26b897a85f0f9052e708fd2a919ba.tar.gz |
tests: Add "struct in array" test to increase coverage
Diffstat (limited to 'tests/basic-types')
-rw-r--r-- | tests/basic-types/arrays.vala | 9 |
1 files changed, 9 insertions, 0 deletions
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]) { |