[vala/0.38] tests: Add "initially-unowned" test to increase coverage



commit 774b021a52ceafc4a657c515cdbab860d103ca68
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Sun Jan 7 09:20:43 2018 +0100

    tests: Add "initially-unowned" test to increase coverage

 tests/Makefile.am                    |    1 +
 tests/objects/initially-unowned.vala |   10 ++++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 22ce5d1..e3cdb36 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -179,6 +179,7 @@ TESTS = \
        objects/classes.vala \
        objects/constructors.vala \
        objects/generics.vala \
+       objects/initially-unowned.vala \
        objects/fields.vala \
        objects/interfaces.vala \
        objects/methods.vala \
diff --git a/tests/objects/initially-unowned.vala b/tests/objects/initially-unowned.vala
new file mode 100644
index 0000000..f576b2f
--- /dev/null
+++ b/tests/objects/initially-unowned.vala
@@ -0,0 +1,10 @@
+class Foo : Object {
+       public string foo { get; construct; }
+}
+
+void main () {
+       Foo foo;
+
+       foo = (Foo) Object.@new (typeof (Foo), "foo", "foo.initially");
+       assert (foo.foo == "foo.initially");
+}


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