[vala/staging] 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/staging] tests: Extend "property base-access" interface test to increase coverage
- Date: Sat, 19 Oct 2019 08:38:29 +0000 (UTC)
commit f3ce99e3448f00992b828265f2a776c8938c4423
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]