From 5556608e2fadf5b222e1c2a4b1fbb30eb4013b84 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Wed, 18 Mar 2020 18:11:13 +0100 Subject: [PATCH] tests: Add "property array length" test to increase coverage --- tests/Makefile.am | 1 + tests/objects/property-array-length.vala | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/objects/property-array-length.vala diff --git a/tests/Makefile.am b/tests/Makefile.am index f5898b620..5a6bbbb3f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -363,6 +363,7 @@ TESTS = \ objects/paramspec.vala \ objects/plugin-module-init.vala \ objects/properties.vala \ + objects/property-array-length.vala \ objects/property-notify.vala \ objects/property-ownership.vala \ objects/property-read-only-auto.vala \ diff --git a/tests/objects/property-array-length.vala b/tests/objects/property-array-length.vala new file mode 100644 index 000000000..b3d52eeef --- /dev/null +++ b/tests/objects/property-array-length.vala @@ -0,0 +1,21 @@ +[Compact] +class Foo { + public uint8[] data { + owned get { + return new uint8[42]; + } + } +} + +async void foo (uint8[] data) { + assert (data.length == 42); +} + +async void bar () { + var f = new Foo (); + foo.begin (f.data); +} + +void main() { + bar.begin (); +} -- 2.47.2