]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add invalid "property for Object() chainup" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Fri, 21 Sep 2018 16:12:49 +0000 (18:12 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 21 Sep 2018 16:12:49 +0000 (18:12 +0200)
tests/Makefile.am
tests/semantic/chainup-gobject-incompatible-type-property.test [new file with mode: 0644]
tests/semantic/chainup-gobject-unknown-property.test [new file with mode: 0644]
tests/semantic/chainup-gobject-unsupported-type-property.test [new file with mode: 0644]

index d41f7ccb4930e3a5b62f2134c877a2f6f562a9fc..1057f72a3d691d1972165e66d0e078aba78a3733 100644 (file)
@@ -492,6 +492,9 @@ TESTS = \
        semantic/assignment-same-variable.vala \
        semantic/assignment-signal-incompatible-method.test \
        semantic/assignment-signal-incompatible-type.test \
+       semantic/chainup-gobject-incompatible-type-property.test \
+       semantic/chainup-gobject-unknown-property.test \
+       semantic/chainup-gobject-unsupported-type-property.test \
        semantic/class-base-type-invalid.test \
        semantic/class-base-type-less-accessible.test \
        semantic/class-compact-derived-instance-field.test \
diff --git a/tests/semantic/chainup-gobject-incompatible-type-property.test b/tests/semantic/chainup-gobject-incompatible-type-property.test
new file mode 100644 (file)
index 0000000..bd0dfc6
--- /dev/null
@@ -0,0 +1,14 @@
+Invalid Code
+
+class Foo : Object {
+       public string s { get; construct; }
+}
+
+class Bar : Foo {
+       public Bar () {
+               Object (s: 42);
+       }
+}
+
+void main () {
+}
diff --git a/tests/semantic/chainup-gobject-unknown-property.test b/tests/semantic/chainup-gobject-unknown-property.test
new file mode 100644 (file)
index 0000000..b7648b5
--- /dev/null
@@ -0,0 +1,13 @@
+Invalid Code
+
+class Foo : Object {
+}
+
+class Bar : Foo {
+       public Bar () {
+               Object (unknown: "foo");
+       }
+}
+
+void main () {
+}
diff --git a/tests/semantic/chainup-gobject-unsupported-type-property.test b/tests/semantic/chainup-gobject-unsupported-type-property.test
new file mode 100644 (file)
index 0000000..49ee6f7
--- /dev/null
@@ -0,0 +1,19 @@
+Invalid Code
+
+delegate void Func ();
+
+class Foo : Object {
+       public Func f { get; construct; }
+}
+
+class Bar : Foo {
+       public Bar () {
+               Object (f: func);
+       }
+
+       void func () {
+       }
+}
+
+void main () {
+}