]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add "subtype cycle" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 28 Nov 2018 16:48:55 +0000 (17:48 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Thu, 6 Dec 2018 17:25:16 +0000 (18:25 +0100)
tests/Makefile.am
tests/resolver/class-base-cycle.test [new file with mode: 0644]
tests/resolver/interface-prerequisite-cycle.test [new file with mode: 0644]
tests/resolver/struct-base-cycle.test [new file with mode: 0644]

index d903bf400051c21f6fe7051e16054cfadf36827f..6f276d6594373df71b2b835b8956bc36ae43cc49 100644 (file)
@@ -518,6 +518,9 @@ TESTS = \
        parser/yield-return.vala \
        parser/bug728574.vala \
        parser/bug749576.vala \
+       resolver/class-base-cycle.test \
+       resolver/interface-prerequisite-cycle.test \
+       resolver/struct-base-cycle.test \
        semantic/array-stacked.test \
        semantic/array-incompatible-initializer.test \
        semantic/array-incompatible-initializer2.test \
diff --git a/tests/resolver/class-base-cycle.test b/tests/resolver/class-base-cycle.test
new file mode 100644 (file)
index 0000000..5951253
--- /dev/null
@@ -0,0 +1,10 @@
+Invalid Code
+
+class Bar : Foo {
+}
+
+class Foo : Bar {
+}
+
+void main () {
+}
diff --git a/tests/resolver/interface-prerequisite-cycle.test b/tests/resolver/interface-prerequisite-cycle.test
new file mode 100644 (file)
index 0000000..585c7db
--- /dev/null
@@ -0,0 +1,10 @@
+Invalid Code
+
+interface IBar : IFoo {
+}
+
+interface IFoo : IBar {
+}
+
+void main () {
+}
diff --git a/tests/resolver/struct-base-cycle.test b/tests/resolver/struct-base-cycle.test
new file mode 100644 (file)
index 0000000..111c7d8
--- /dev/null
@@ -0,0 +1,10 @@
+Invalid Code
+
+struct Bar : Foo {
+}
+
+struct Foo : Bar {
+}
+
+void main () {
+}