[vala/wip/issue/1121: 2/2] tests: Add more invalid "GtkTemplate" tests to increase coverage
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/issue/1121: 2/2] tests: Add more invalid "GtkTemplate" tests to increase coverage
- Date: Sun, 17 Jan 2021 12:42:41 +0000 (UTC)
commit 8ba64b8f0a7b6f3872802179e0854915201e07b4
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Jan 17 13:10:13 2021 +0100
tests: Add more invalid "GtkTemplate" tests to increase coverage
tests/Makefile.am | 8 ++++++++
tests/gtktemplate/gtkcallback-incompatible.test | 11 +++++++++++
tests/gtktemplate/gtkcallback-unknown.test | 11 +++++++++++
tests/gtktemplate/gtkchild-field-incompatible-type.test | 10 ++++++++++
tests/gtktemplate/gtkchild-field-unknown.test | 10 ++++++++++
tests/gtktemplate/gtkchild-property-not-automatic.test | 10 ++++++++++
tests/gtktemplate/gtkchild-property-unknown.test | 10 ++++++++++
tests/gtktemplate/gtkchild-without-gtktemplate.test | 9 +++++++++
tests/gtktemplate/gtktemplate-gtkwidget-subclass.test | 8 ++++++++
9 files changed, 87 insertions(+)
---
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 () {
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]