]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
tests: Add more invalid "GtkTemplate" tests to increase coverage
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 17 Jan 2021 12:10:13 +0000 (13:10 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 17 Jan 2021 12:26:00 +0000 (13:26 +0100)
tests/Makefile.am
tests/gtktemplate/gtkcallback-incompatible.test [new file with mode: 0644]
tests/gtktemplate/gtkcallback-unknown.test [new file with mode: 0644]
tests/gtktemplate/gtkchild-field-incompatible-type.test [new file with mode: 0644]
tests/gtktemplate/gtkchild-field-unknown.test [new file with mode: 0644]
tests/gtktemplate/gtkchild-property-not-automatic.test [new file with mode: 0644]
tests/gtktemplate/gtkchild-property-unknown.test [new file with mode: 0644]
tests/gtktemplate/gtkchild-without-gtktemplate.test [new file with mode: 0644]
tests/gtktemplate/gtktemplate-gtkwidget-subclass.test [new file with mode: 0644]

index 8c001a0994bd43d6d929aeeed10db5c42d880d13..9ee73d0e7f4cf7276a6b5013807bbf11ef71c7b2 100644 (file)
@@ -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 (file)
index 0000000..226408f
--- /dev/null
@@ -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 (file)
index 0000000..3158da8
--- /dev/null
@@ -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 (file)
index 0000000..1ce0261
--- /dev/null
@@ -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 (file)
index 0000000..2e23ea0
--- /dev/null
@@ -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 (file)
index 0000000..e46cee5
--- /dev/null
@@ -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 (file)
index 0000000..caa6218
--- /dev/null
@@ -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 (file)
index 0000000..33d32ea
--- /dev/null
@@ -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 (file)
index 0000000..bea1b3b
--- /dev/null
@@ -0,0 +1,8 @@
+Invalid Code
+
+[GtkTemplate (ui = "/org/example/gtktemplate.ui")]
+public class GtkTemplate : GLib.Object {
+}
+
+void main () {
+}