diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2016-11-04 18:06:37 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2018-02-19 17:54:32 +0100 |
commit | 1fd2f6883a1ab42e8b880fadfbab015276e059fa (patch) | |
tree | 79eb1016682200d2a5bb92cff1b1a87e478de8e7 | |
parent | 3a40f6f1e7d472c1345003d4d1bbfaba6165c6f8 (diff) | |
download | vala-1fd2f6883a1ab42e8b880fadfbab015276e059fa.tar.gz |
tests: Add some invalid "chain-up" testswip/bug567269
https://bugzilla.gnome.org/show_bug.cgi?id=567269
-rw-r--r-- | tests/Makefile.am | 10 | ||||
-rw-r--r-- | tests/chainup/class-base-foo-invalid.test | 16 | ||||
-rw-r--r-- | tests/chainup/class-base-invalid.test | 15 | ||||
-rw-r--r-- | tests/chainup/class-object-invalid.test | 12 | ||||
-rw-r--r-- | tests/chainup/class-this-foo-invalid.test | 13 | ||||
-rw-r--r-- | tests/chainup/class-this-invalid.test | 12 | ||||
-rw-r--r-- | tests/chainup/class-with-lambda-invalid.test | 14 | ||||
-rw-r--r-- | tests/chainup/struct-base-foo-invalid.test | 16 | ||||
-rw-r--r-- | tests/chainup/struct-base-invalid.test | 17 | ||||
-rw-r--r-- | tests/chainup/struct-this-foo-invalid.test | 13 | ||||
-rw-r--r-- | tests/chainup/struct-this-invalid.test | 13 |
11 files changed, 151 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index ab30ae345..5c681597d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -58,17 +58,27 @@ TESTS = \ chainup/base-struct-invalid.test \ chainup/class-base.vala \ chainup/class-base-foo.vala \ + chainup/class-base-foo-invalid.test \ + chainup/class-base-invalid.test \ chainup/class-multiple.vala \ chainup/class-object.vala \ + chainup/class-object-invalid.test \ chainup/class-this.vala \ chainup/class-this-foo.vala \ + chainup/class-this-foo-invalid.test \ + chainup/class-this-invalid.test \ chainup/class-with-lambda.vala \ + chainup/class-with-lambda-invalid.test \ chainup/method-lambda-base.vala \ chainup/no-chainup.vala \ chainup/struct-base.vala \ chainup/struct-base-foo.vala \ + chainup/struct-base-foo-invalid.test \ + chainup/struct-base-invalid.test \ chainup/struct-this.vala \ chainup/struct-this-foo.vala \ + chainup/struct-this-foo-invalid.test \ + chainup/struct-this-invalid.test \ chainup/bug791785.vala \ pointers/bug590641.vala \ methods/lambda.vala \ diff --git a/tests/chainup/class-base-foo-invalid.test b/tests/chainup/class-base-foo-invalid.test new file mode 100644 index 000000000..7f9293b10 --- /dev/null +++ b/tests/chainup/class-base-foo-invalid.test @@ -0,0 +1,16 @@ +Invalid Code + +public class Foo { + public Foo.foo () {} +} + +public class Bar : Foo { + int i; + public Bar () { + i = 1; + base.foo (); + } +} + +void main () { +} diff --git a/tests/chainup/class-base-invalid.test b/tests/chainup/class-base-invalid.test new file mode 100644 index 000000000..6137805fe --- /dev/null +++ b/tests/chainup/class-base-invalid.test @@ -0,0 +1,15 @@ +Invalid Code + +public class Foo { +} + +public class Bar : Foo { + int i; + public Bar () { + i = 1; + base (); + } +} + +void main () { +} diff --git a/tests/chainup/class-object-invalid.test b/tests/chainup/class-object-invalid.test new file mode 100644 index 000000000..d9dd47dc7 --- /dev/null +++ b/tests/chainup/class-object-invalid.test @@ -0,0 +1,12 @@ +Invalid Code + +public class Foo : Object { + int i; + public Foo () { + i = 1; + Object (); + } +} + +void main () { +} diff --git a/tests/chainup/class-this-foo-invalid.test b/tests/chainup/class-this-foo-invalid.test new file mode 100644 index 000000000..3e6c438ef --- /dev/null +++ b/tests/chainup/class-this-foo-invalid.test @@ -0,0 +1,13 @@ +Invalid Code + +public class Foo { + int i; + public Foo () { + i = 1; + this.foo (); + } + public Foo.foo () {} +} + +void main () { +} diff --git a/tests/chainup/class-this-invalid.test b/tests/chainup/class-this-invalid.test new file mode 100644 index 000000000..171e928e9 --- /dev/null +++ b/tests/chainup/class-this-invalid.test @@ -0,0 +1,12 @@ +Invalid Code + +public class Foo { + int i; + public Foo.bar () { + i = 1; + this (); + } +} + +void main () { +} diff --git a/tests/chainup/class-with-lambda-invalid.test b/tests/chainup/class-with-lambda-invalid.test new file mode 100644 index 000000000..a4addb7a5 --- /dev/null +++ b/tests/chainup/class-with-lambda-invalid.test @@ -0,0 +1,14 @@ +Invalid Code + +public class Foo : Object { + int i; + + public Foo.with_foo () { + SourceFunc f = () => i==1; + f(); + this (); + } +} + +void main () { +} diff --git a/tests/chainup/struct-base-foo-invalid.test b/tests/chainup/struct-base-foo-invalid.test new file mode 100644 index 000000000..fc47cf752 --- /dev/null +++ b/tests/chainup/struct-base-foo-invalid.test @@ -0,0 +1,16 @@ +Invalid Code + +public struct Foo { + int i; + public Foo.foo () {} +} + +public struct Bar : Foo { + public Bar () { + i = 1; + base.foo (); + } +} + +void main () { +} diff --git a/tests/chainup/struct-base-invalid.test b/tests/chainup/struct-base-invalid.test new file mode 100644 index 000000000..e93499157 --- /dev/null +++ b/tests/chainup/struct-base-invalid.test @@ -0,0 +1,17 @@ +Invalid Code + +public struct Foo { + int i; + + public Foo () {} +} + +public struct Bar : Foo { + public Bar () { + i = 1; + base (); + } +} + +void main () { +} diff --git a/tests/chainup/struct-this-foo-invalid.test b/tests/chainup/struct-this-foo-invalid.test new file mode 100644 index 000000000..5f10f272f --- /dev/null +++ b/tests/chainup/struct-this-foo-invalid.test @@ -0,0 +1,13 @@ +Invalid Code + +public struct Foo { + int i; + public Foo () { + i = 1; + this.foo (); + } + public Foo.foo () {} +} + +void main () { +} diff --git a/tests/chainup/struct-this-invalid.test b/tests/chainup/struct-this-invalid.test new file mode 100644 index 000000000..656e85e83 --- /dev/null +++ b/tests/chainup/struct-this-invalid.test @@ -0,0 +1,13 @@ +Invalid Code + +public struct Foo { + int i; + public Foo () {} + public Foo.foo () { + i = 1; + this (); + } +} + +void main () { +} |