diff options
author | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-01-17 13:10:13 +0100 |
---|---|---|
committer | Rico Tzschichholz <ricotz@ubuntu.com> | 2021-01-17 13:26:00 +0100 |
commit | 8ba64b8f0a7b6f3872802179e0854915201e07b4 (patch) | |
tree | f44617677e9d1fe3f7c7c696883ff163ff3aedd9 /tests/gtktemplate | |
parent | 6e7be51cb5455e9c5c721d4ba5121a6ab04673dd (diff) | |
download | vala-8ba64b8f0a7b6f3872802179e0854915201e07b4.tar.gz |
tests: Add more invalid "GtkTemplate" tests to increase coverage
Diffstat (limited to 'tests/gtktemplate')
-rw-r--r-- | tests/gtktemplate/gtkcallback-incompatible.test | 11 | ||||
-rw-r--r-- | tests/gtktemplate/gtkcallback-unknown.test | 11 | ||||
-rw-r--r-- | tests/gtktemplate/gtkchild-field-incompatible-type.test | 10 | ||||
-rw-r--r-- | tests/gtktemplate/gtkchild-field-unknown.test | 10 | ||||
-rw-r--r-- | tests/gtktemplate/gtkchild-property-not-automatic.test | 10 | ||||
-rw-r--r-- | tests/gtktemplate/gtkchild-property-unknown.test | 10 | ||||
-rw-r--r-- | tests/gtktemplate/gtkchild-without-gtktemplate.test | 9 | ||||
-rw-r--r-- | tests/gtktemplate/gtktemplate-gtkwidget-subclass.test | 8 |
8 files changed, 79 insertions, 0 deletions
diff --git a/tests/gtktemplate/gtkcallback-incompatible.test b/tests/gtktemplate/gtkcallback-incompatible.test new file mode 100644 index 000000000..226408ff1 --- /dev/null +++ b/tests/gtktemplate/gtkcallback-incompatible.test @@ -0,0 +1,11 @@ +Invalid Code + +[GtkTemplate (ui = "/org/example/gtktemplate.ui")] +public class GtkTemplate : Gtk.ApplicationWindow { + [GtkCallback] + void on_clicked_cb (string s) { + } +} + +void main () { +} diff --git a/tests/gtktemplate/gtkcallback-unknown.test b/tests/gtktemplate/gtkcallback-unknown.test new file mode 100644 index 000000000..3158da85e --- /dev/null +++ b/tests/gtktemplate/gtkcallback-unknown.test @@ -0,0 +1,11 @@ +Invalid Code + +[GtkTemplate (ui = "/org/example/gtktemplate.ui")] +public class GtkTemplate : Gtk.ApplicationWindow { + [GtkCallback] + void on_unknown_cb (Gtk.Button button) { + } +} + +void main () { +} diff --git a/tests/gtktemplate/gtkchild-field-incompatible-type.test b/tests/gtktemplate/gtkchild-field-incompatible-type.test new file mode 100644 index 000000000..1ce026135 --- /dev/null +++ b/tests/gtktemplate/gtkchild-field-incompatible-type.test @@ -0,0 +1,10 @@ +Invalid Code + +[GtkTemplate (ui = "/org/example/gtktemplate.ui")] +public class GtkTemplate : Gtk.ApplicationWindow { + [GtkChild] + public unowned Gtk.Box button0; +} + +void main () { +} diff --git a/tests/gtktemplate/gtkchild-field-unknown.test b/tests/gtktemplate/gtkchild-field-unknown.test new file mode 100644 index 000000000..2e23ea0b4 --- /dev/null +++ b/tests/gtktemplate/gtkchild-field-unknown.test @@ -0,0 +1,10 @@ +Invalid Code + +[GtkTemplate (ui = "/org/example/gtktemplate.ui")] +public class GtkTemplate : Gtk.ApplicationWindow { + [GtkChild] + public unowned Gtk.Button unknown; +} + +void main () { +} diff --git a/tests/gtktemplate/gtkchild-property-not-automatic.test b/tests/gtktemplate/gtkchild-property-not-automatic.test new file mode 100644 index 000000000..e46cee574 --- /dev/null +++ b/tests/gtktemplate/gtkchild-property-not-automatic.test @@ -0,0 +1,10 @@ +Invalid Code + +[GtkTemplate (ui = "/org/example/gtktemplate.ui")] +public class GtkTemplate : Gtk.ApplicationWindow { + [GtkChild] + public unowned Gtk.Button button0 { get { return null; } } +} + +void main () { +} diff --git a/tests/gtktemplate/gtkchild-property-unknown.test b/tests/gtktemplate/gtkchild-property-unknown.test new file mode 100644 index 000000000..caa6218f3 --- /dev/null +++ b/tests/gtktemplate/gtkchild-property-unknown.test @@ -0,0 +1,10 @@ +Invalid Code + +[GtkTemplate (ui = "/org/example/gtktemplate.ui")] +public class GtkTemplate : Gtk.ApplicationWindow { + [GtkChild] + public unowned Gtk.Button unknown { get; } +} + +void main () { +} diff --git a/tests/gtktemplate/gtkchild-without-gtktemplate.test b/tests/gtktemplate/gtkchild-without-gtktemplate.test new file mode 100644 index 000000000..33d32ea4e --- /dev/null +++ b/tests/gtktemplate/gtkchild-without-gtktemplate.test @@ -0,0 +1,9 @@ +Invalid Code + +public class GtkTemplate : Gtk.ApplicationWindow { + [GtkChild] + public unowned Gtk.Button button0; +} + +void main () { +} diff --git a/tests/gtktemplate/gtktemplate-gtkwidget-subclass.test b/tests/gtktemplate/gtktemplate-gtkwidget-subclass.test new file mode 100644 index 000000000..bea1b3b86 --- /dev/null +++ b/tests/gtktemplate/gtktemplate-gtkwidget-subclass.test @@ -0,0 +1,8 @@ +Invalid Code + +[GtkTemplate (ui = "/org/example/gtktemplate.ui")] +public class GtkTemplate : GLib.Object { +} + +void main () { +} |