summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2021-01-17 13:10:13 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2021-01-17 13:26:00 +0100
commit8ba64b8f0a7b6f3872802179e0854915201e07b4 (patch)
treef44617677e9d1fe3f7c7c696883ff163ff3aedd9
parent6e7be51cb5455e9c5c721d4ba5121a6ab04673dd (diff)
downloadvala-8ba64b8f0a7b6f3872802179e0854915201e07b4.tar.gz
tests: Add more invalid "GtkTemplate" tests to increase coverage
-rw-r--r--tests/Makefile.am8
-rw-r--r--tests/gtktemplate/gtkcallback-incompatible.test11
-rw-r--r--tests/gtktemplate/gtkcallback-unknown.test11
-rw-r--r--tests/gtktemplate/gtkchild-field-incompatible-type.test10
-rw-r--r--tests/gtktemplate/gtkchild-field-unknown.test10
-rw-r--r--tests/gtktemplate/gtkchild-property-not-automatic.test10
-rw-r--r--tests/gtktemplate/gtkchild-property-unknown.test10
-rw-r--r--tests/gtktemplate/gtkchild-without-gtktemplate.test9
-rw-r--r--tests/gtktemplate/gtktemplate-gtkwidget-subclass.test8
9 files changed, 87 insertions, 0 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 8c001a099..9ee73d0e7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -709,10 +709,18 @@ TESTS = \
gir/property-non-readable.test \
gir/symbol-type-csuffix.test \
gir/union.test \
+ gtktemplate/gtkcallback-incompatible.test \
+ gtktemplate/gtkcallback-unknown.test \
gtktemplate/gtkchild-field-assignment.test \
+ gtktemplate/gtkchild-field-incompatible-type.test \
gtktemplate/gtkchild-field-out-assignment.test \
gtktemplate/gtkchild-field-ref-assignment.test \
+ gtktemplate/gtkchild-field-unknown.test \
gtktemplate/gtkchild-property-assignment.test \
+ gtktemplate/gtkchild-property-not-automatic.test \
+ gtktemplate/gtkchild-property-unknown.test \
+ gtktemplate/gtkchild-without-gtktemplate.test \
+ gtktemplate/gtktemplate-gtkwidget-subclass.test \
annotations/deprecated.vala \
annotations/description.vala \
annotations/noaccessormethod.test \
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 () {
+}