]> 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>
Sun, 7 Jan 2018 19:26:03 +0000 (20:26 +0100)
tests/Makefile.am
tests/objects/initially-unowned.vala [new file with mode: 0644]

index 95cc6f282a4974eba00d56df918dff41282e1f41..8ba947c406db3d42f4205d9e3b2c89dfe99eea0b 100644 (file)
@@ -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 (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");
+}