[vala/0.44] tests: Extend "property base-access" interface test to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.44] tests: Extend "property base-access" interface test to increase coverage
- Date: Thu, 7 Nov 2019 11:19:01 +0000 (UTC)
commit 34391b248a44726b92940b6d975498e0cd4ea938
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]