]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "initially-unowned" test to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 7 Jan 2018 08:20:43 +0000 (09:20 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 10 Jan 2018 19:44:54 +0000 (20:44 +0100)
tests/Makefile.am
tests/objects/initially-unowned.vala [new file with mode: 0644]

index 22ce5d1d3ae33bfe6dd09f9b11791d341beb04ee..e3cdb36df777640c189d80a2140b6bae9df227b7 100644 (file)
@@ -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 (file)
index 0000000..f576b2f
--- /dev/null
@@ -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");
+}