summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2021-11-17 21:26:39 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2021-11-17 21:26:39 +0100
commit1051b5f138817a96592137f4f5b16e53c9669539 (patch)
treeb7611f8710a94ce883dd8ec108f0b13fb4dd4a16 /tests
parent16840d25fb474f313e98989856fc315149f3b73e (diff)
downloadvala-1051b5f138817a96592137f4f5b16e53c9669539.tar.gz
codegen: Check required length of enum type name for GType support
Add corresponding tests for types which have support for GType
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am5
-rw-r--r--tests/enums/enum-gtype-too-short.test8
-rw-r--r--tests/objects/class-gtype-too-short.test7
-rw-r--r--tests/objects/interface-gtype-too-short.test7
-rw-r--r--tests/structs/bug764041.test10
-rw-r--r--tests/structs/struct-gtype-too-short.test8
6 files changed, 34 insertions, 11 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 84af6bef1..2ea1b2e78 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -331,6 +331,7 @@ TESTS = \
enums/default-gtype.vala \
enums/enum_only.vala \
enums/enum-no-gtype.vala \
+ enums/enum-gtype-too-short.test \
enums/enums.vala \
enums/flags.vala \
enums/from-0-literal.vala \
@@ -352,6 +353,7 @@ TESTS = \
structs/struct-base-types.vala \
structs/struct-boxed-cast.vala \
structs/struct-empty-still.test \
+ structs/struct-gtype-too-short.test \
structs/struct-initializer-list-in-array.vala \
structs/struct-initializer-list-nested.vala \
structs/struct-no-gtype.vala \
@@ -400,7 +402,6 @@ TESTS = \
structs/bug690380.vala \
structs/bug694140.vala \
structs/bug749952.vala \
- structs/bug764041.test \
structs/bug775761.vala \
structs/bug777194.vala \
structs/bug777194-2.vala \
@@ -453,6 +454,7 @@ TESTS = \
objects/class-ccode-cprefix.vala \
objects/class_only.vala \
objects/class-destroysinstance.vala \
+ objects/class-gtype-too-short.test \
objects/class-inner-types.vala \
objects/class-new-no-override.vala \
objects/class-partial.vala \
@@ -489,6 +491,7 @@ TESTS = \
objects/interface_only.vala \
objects/interface-async-base-access.vala \
objects/interface-base-access.vala \
+ objects/interface-gtype-too-short.test \
objects/interface-inner-types.vala \
objects/interfaces.vala \
objects/interface-abstract-async-override.vala \
diff --git a/tests/enums/enum-gtype-too-short.test b/tests/enums/enum-gtype-too-short.test
new file mode 100644
index 000000000..b897ab50c
--- /dev/null
+++ b/tests/enums/enum-gtype-too-short.test
@@ -0,0 +1,8 @@
+Invalid Code
+
+enum E {
+ FOO
+}
+
+void main () {
+}
diff --git a/tests/objects/class-gtype-too-short.test b/tests/objects/class-gtype-too-short.test
new file mode 100644
index 000000000..de346c0aa
--- /dev/null
+++ b/tests/objects/class-gtype-too-short.test
@@ -0,0 +1,7 @@
+Invalid Code
+
+class C {
+}
+
+void main () {
+}
diff --git a/tests/objects/interface-gtype-too-short.test b/tests/objects/interface-gtype-too-short.test
new file mode 100644
index 000000000..6a13b8cf7
--- /dev/null
+++ b/tests/objects/interface-gtype-too-short.test
@@ -0,0 +1,7 @@
+Invalid Code
+
+interface I {
+}
+
+void main () {
+}
diff --git a/tests/structs/bug764041.test b/tests/structs/bug764041.test
deleted file mode 100644
index 1911cda0c..000000000
--- a/tests/structs/bug764041.test
+++ /dev/null
@@ -1,10 +0,0 @@
-Invalid Code
-
-struct N {
- public int i;
-}
-
-void main() {
- N n = { 42 };
- Value v = n;
-}
diff --git a/tests/structs/struct-gtype-too-short.test b/tests/structs/struct-gtype-too-short.test
new file mode 100644
index 000000000..a260d155e
--- /dev/null
+++ b/tests/structs/struct-gtype-too-short.test
@@ -0,0 +1,8 @@
+Invalid Code
+
+struct S {
+ public int i;
+}
+
+void main () {
+}