diff --git a/tests/Makefile.am b/tests/Makefile.am index a74461645a1b83ef3d23f2596c9d33c5dbda2fcd..654cef00863c0a9acc048cc60317c10c5171ffe8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -68,7 +68,9 @@ TESTS = \ basic-types/bug787152.vala \ basic-types/bug788775.vala \ arrays/class-field-length-cname.vala \ + arrays/expression-bracket.test \ arrays/field-global-length-cname.vala \ + arrays/fixed-length-non-const.test \ arrays/struct-field-length-cname.vala \ arrays/incompatible-integer-elements.test \ arrays/slice-invalid-start.test \ @@ -184,12 +186,14 @@ TESTS = \ control-semantic/argument-owned-ref.test \ control-semantic/argument-value-out.test \ control-semantic/argument-value-ref.test \ + control-semantic/literal-immutable.test \ control-semantic/member-incompatible-type.test \ control-semantic/member-invalid.test \ control-semantic/member-private.test \ control-semantic/member-readonly.test \ control-semantic/printf-too-few.test \ control-semantic/printf-too-many.test \ + control-semantic/this-assignment.test \ control-semantic/variadic-argument-invalid.test \ enums/default-gtype.vala \ enums/enum_only.vala \ @@ -282,6 +286,7 @@ TESTS = \ objects/classes-implicit-implementation.vala \ objects/compact-class.vala \ objects/compact-class-destructor.vala \ + objects/property-construct-only-write.test \ objects/constructor-abstract-public.test \ objects/constructor-variadic.test \ objects/constructors.vala \ @@ -301,7 +306,9 @@ TESTS = \ objects/plugin-module-init.vala \ objects/properties.vala \ objects/property-notify.vala \ + objects/property-read-only.test \ objects/property-read-only-auto.vala \ + objects/property-construct-only-write-foreign.test \ objects/property-static.vala \ objects/regex.vala \ objects/signals.vala \ diff --git a/tests/arrays/expression-bracket.test b/tests/arrays/expression-bracket.test new file mode 100644 index 0000000000000000000000000000000000000000..687e4b3a00b1a5e45caccc6343e98545fbd70944 --- /dev/null +++ b/tests/arrays/expression-bracket.test @@ -0,0 +1,13 @@ +Invalid Code + +public int get_size () { + return 1; +} + +public string[get_size ()] returns_array () { + return {"test"}; +} + +void main () { + returns_array (); +} diff --git a/tests/arrays/fixed-length-non-const.test b/tests/arrays/fixed-length-non-const.test new file mode 100644 index 0000000000000000000000000000000000000000..7ae22936f965963cd1a305ef8bcdb6dc757754e6 --- /dev/null +++ b/tests/arrays/fixed-length-non-const.test @@ -0,0 +1,6 @@ +Invalid Code + +void main () { + int test_len = 60; + string test_array[test_len]; +} diff --git a/tests/control-semantic/literal-immutable.test b/tests/control-semantic/literal-immutable.test new file mode 100644 index 0000000000000000000000000000000000000000..a335da9ee3022f29f5b1badd0d6c2abd735e241d --- /dev/null +++ b/tests/control-semantic/literal-immutable.test @@ -0,0 +1,5 @@ +Invalid Code + +void main () { + true = false; +} diff --git a/tests/control-semantic/this-assignment.test b/tests/control-semantic/this-assignment.test new file mode 100644 index 0000000000000000000000000000000000000000..69dc5709aff9141b0bb1e2e9e7c0c6e0717dffc5 --- /dev/null +++ b/tests/control-semantic/this-assignment.test @@ -0,0 +1,12 @@ +Invalid Code + +class Foo { + public void do_bar () { + this = new Foo (); + } +} + +void main () { + var foo = new Foo (); + foo.do_bar (); +} diff --git a/tests/objects/property-construct-only-write-foreign.test b/tests/objects/property-construct-only-write-foreign.test new file mode 100644 index 0000000000000000000000000000000000000000..4ec5be7fff2b8490c047e9d839309198a7ceb627 --- /dev/null +++ b/tests/objects/property-construct-only-write-foreign.test @@ -0,0 +1,16 @@ +Invalid Code + +class Foo : GLib.Object { + public string test { construct; } + public Foo () { + var other = new Foo.ok (); + other.test = ""; + } + + public Foo.ok () { + } +} + +void main () { + var foo = new Foo (); +} diff --git a/tests/objects/property-construct-only-write.test b/tests/objects/property-construct-only-write.test new file mode 100644 index 0000000000000000000000000000000000000000..1b7636c77bcaae7535339f6c3ef8ac270d9d7342 --- /dev/null +++ b/tests/objects/property-construct-only-write.test @@ -0,0 +1,12 @@ +Invalid Code + +class Foo : GLib.Object { + public string test { construct; } + public Foo () { + test = ""; + } +} + +void main () { + var foo = new Foo (); +} diff --git a/tests/objects/property-read-only.test b/tests/objects/property-read-only.test new file mode 100644 index 0000000000000000000000000000000000000000..7e1e02de2be267b758188993223e5139a076fbc0 --- /dev/null +++ b/tests/objects/property-read-only.test @@ -0,0 +1,12 @@ +Invalid Code + +class Foo : GLib.Object { + public string test { get; } + public Foo () { + } +} + +void main () { + var foo = new Foo (); + foo.test= ""; +}