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



commit 32d02f11d64ce348227e27a1d55183be1ef2d623
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 95cc6f2..8ba947c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -182,6 +182,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]