[vala/0.46] tests: Extend "property base-access" interface test to increase coverage



commit a4f8f99bb2d60f77ca906148fd45450a5b93c52d
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Oct 18 08:17:33 2019 +0200

    tests: Extend "property base-access" interface test to increase coverage

 tests/objects/interface-property-base-access.vala | 13 +++++++++++++
 1 file changed, 13 insertions(+)
---
diff --git a/tests/objects/interface-property-base-access.vala 
b/tests/objects/interface-property-base-access.vala
index 036ce8b1e..76482a3bf 100644
--- a/tests/objects/interface-property-base-access.vala
+++ b/tests/objects/interface-property-base-access.vala
@@ -1,9 +1,15 @@
+struct Manam {
+       public int i;
+}
+
 interface IFoo {
        public abstract string foo { get; set; }
+       public abstract Manam manam { get; set; }
 }
 
 class Bar : IFoo {
        public string foo { get; set; }
+       public Manam manam { get; set; }
 }
 
 class Foo : Bar {
@@ -11,10 +17,17 @@ class Foo : Bar {
                base.foo = s;
                return base.foo;
        }
+
+       public Manam baz (Manam m) {
+               base.manam = m;
+               return base.manam;
+       }
 }
 
 void main () {
        var foo = new Foo ();
        assert (foo is IFoo);
        assert (foo.bar ("foo") == "foo");
+       Manam manam = { 42 };
+       assert (foo.baz (manam) == manam);
 }


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