]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "property array length" test to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 18 Mar 2020 17:11:13 +0000 (18:11 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Tue, 24 Mar 2020 08:50:25 +0000 (09:50 +0100)
tests/Makefile.am
tests/objects/property-array-length.vala [new file with mode: 0644]

index f5898b62055f74dcebc9cc83d952343f38e472b1..5a6bbbb3f1172dcfa63ffac4b1dcf1bbdf3840fc 100644 (file)
@@ -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 (file)
index 0000000..b3d52ee
--- /dev/null
@@ -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 ();
+}