[vala/0.46] tests: Add "property array length" test to increase coverage



commit 5556608e2fadf5b222e1c2a4b1fbb30eb4013b84
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Wed Mar 18 18:11:13 2020 +0100

    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(+)
---
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 ();
+}


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