]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add invalid "property" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 5 Feb 2018 08:39:30 +0000 (09:39 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 5 Feb 2018 08:39:30 +0000 (09:39 +0100)
14 files changed:
tests/Makefile.am
tests/semantic/property-abstract-derived-compact.test [new file with mode: 0644]
tests/semantic/property-abstract.test [new file with mode: 0644]
tests/semantic/property-accessibility.test [new file with mode: 0644]
tests/semantic/property-construct.test [new file with mode: 0644]
tests/semantic/property-initializer-type.test [new file with mode: 0644]
tests/semantic/property-override-class.test [new file with mode: 0644]
tests/semantic/property-override-interface.test [new file with mode: 0644]
tests/semantic/property-override.test [new file with mode: 0644]
tests/semantic/property-struct-abstract.test [new file with mode: 0644]
tests/semantic/property-struct-override.test [new file with mode: 0644]
tests/semantic/property-struct-protected.test [new file with mode: 0644]
tests/semantic/property-struct-virtual.test [new file with mode: 0644]
tests/semantic/property-void.test [new file with mode: 0644]

index 0a8139bc8cefe68908505b67e9b710bd25fbdee7..6eb70cea0ca260c6b14ff56f1d96dcc45adfbf41 100644 (file)
@@ -405,6 +405,19 @@ TESTS = \
        semantic/parameter-params.test \
        semantic/parameter-ref-default.test \
        semantic/parameter-void.test \
+       semantic/property-abstract.test \
+       semantic/property-abstract-derived-compact.test \
+       semantic/property-accessibility.test \
+       semantic/property-construct.test \
+       semantic/property-initializer-type.test \
+       semantic/property-override.test \
+       semantic/property-override-class.test \
+       semantic/property-override-interface.test \
+       semantic/property-struct-abstract.test \
+       semantic/property-struct-override.test \
+       semantic/property-struct-protected.test \
+       semantic/property-struct-virtual.test \
+       semantic/property-void.test \
        $(NULL)
 
 NON_NULL_TESTS = \
diff --git a/tests/semantic/property-abstract-derived-compact.test b/tests/semantic/property-abstract-derived-compact.test
new file mode 100644 (file)
index 0000000..02d38d3
--- /dev/null
@@ -0,0 +1,12 @@
+Invalid Code
+
+[Compact]
+class Foo {
+}
+
+class Bar : Foo {
+       public abstract string foo { get; }
+}
+
+void main () {
+}
diff --git a/tests/semantic/property-abstract.test b/tests/semantic/property-abstract.test
new file mode 100644 (file)
index 0000000..41fc955
--- /dev/null
@@ -0,0 +1,8 @@
+Invalid Code
+
+class Bar {
+       public abstract string foo { get; }
+}
+
+void main () {
+}
diff --git a/tests/semantic/property-accessibility.test b/tests/semantic/property-accessibility.test
new file mode 100644 (file)
index 0000000..d532723
--- /dev/null
@@ -0,0 +1,11 @@
+Invalid Code
+
+class Bar {
+}
+
+public class Foo {
+       public Bar foo { get; set; }
+}
+
+void main () {
+}
diff --git a/tests/semantic/property-construct.test b/tests/semantic/property-construct.test
new file mode 100644 (file)
index 0000000..25f73cd
--- /dev/null
@@ -0,0 +1,8 @@
+Invalid Code
+
+class Foo {
+       string foo { get; construct set; }
+}
+
+void main () {
+}
diff --git a/tests/semantic/property-initializer-type.test b/tests/semantic/property-initializer-type.test
new file mode 100644 (file)
index 0000000..201fc58
--- /dev/null
@@ -0,0 +1,8 @@
+Invalid Code
+
+public class Foo {
+       public string foo { get; set; default = 23; }
+}
+
+void main () {
+}
diff --git a/tests/semantic/property-override-class.test b/tests/semantic/property-override-class.test
new file mode 100644 (file)
index 0000000..1bf51c6
--- /dev/null
@@ -0,0 +1,13 @@
+Invalid Code
+
+class Bar {
+       public virtual int foo { get; set; }
+}
+
+class Foo : Bar {
+       public override string foo { get; set; }
+}
+
+void main () {
+}
+
diff --git a/tests/semantic/property-override-interface.test b/tests/semantic/property-override-interface.test
new file mode 100644 (file)
index 0000000..317ba77
--- /dev/null
@@ -0,0 +1,13 @@
+Invalid Code
+
+interface Bar {
+       public abstract int foo { get; set; }
+}
+
+class Foo : Bar {
+       public override string foo { get; set; }
+}
+
+void main () {
+}
+
diff --git a/tests/semantic/property-override.test b/tests/semantic/property-override.test
new file mode 100644 (file)
index 0000000..c714696
--- /dev/null
@@ -0,0 +1,12 @@
+Invalid Code
+
+class Bar {
+}
+
+class Foo : Bar {
+       public override string foo { get; set; }
+}
+
+void main () {
+}
+
diff --git a/tests/semantic/property-struct-abstract.test b/tests/semantic/property-struct-abstract.test
new file mode 100644 (file)
index 0000000..4f4437a
--- /dev/null
@@ -0,0 +1,9 @@
+Invalid Code
+
+struct Foo {
+       public abstract string foo { get; set; }
+}
+
+void main () {
+}
+
diff --git a/tests/semantic/property-struct-override.test b/tests/semantic/property-struct-override.test
new file mode 100644 (file)
index 0000000..5a599dc
--- /dev/null
@@ -0,0 +1,9 @@
+Invalid Code
+
+struct Foo {
+       public override string foo { get; set; }
+}
+
+void main () {
+}
+
diff --git a/tests/semantic/property-struct-protected.test b/tests/semantic/property-struct-protected.test
new file mode 100644 (file)
index 0000000..0062291
--- /dev/null
@@ -0,0 +1,9 @@
+Invalid Code
+
+struct Foo {
+       protected string foo { get; set; }
+}
+
+void main () {
+}
+
diff --git a/tests/semantic/property-struct-virtual.test b/tests/semantic/property-struct-virtual.test
new file mode 100644 (file)
index 0000000..a6c593f
--- /dev/null
@@ -0,0 +1,9 @@
+Invalid Code
+
+struct Foo {
+       public virtual string foo { get; set; }
+}
+
+void main () {
+}
+
diff --git a/tests/semantic/property-void.test b/tests/semantic/property-void.test
new file mode 100644 (file)
index 0000000..abfb428
--- /dev/null
@@ -0,0 +1,8 @@
+Invalid Code
+
+class Foo {
+       public void foo { get; set; }
+}
+
+void main () {
+}