From: Rico Tzschichholz Date: Sun, 21 Feb 2021 18:34:48 +0000 (+0100) Subject: tests: Add more "girparser" tests to increase coverage X-Git-Tag: 0.51.3~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86811ebe4e42d1f83c82a3bd1ad8a71b82754352;p=thirdparty%2Fvala.git tests: Add more "girparser" tests to increase coverage --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 860020161..5ca793613 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -707,6 +707,7 @@ TESTS = \ gir/bug742012.test \ gir/bug788775.test \ gir/bug792998.test \ + gir/alias.test \ gir/array-fixed-length.test \ gir/async-result-pos.test \ gir/async-sync-out.test \ @@ -727,6 +728,7 @@ TESTS = \ gir/property-non-readable.test \ gir/symbol-type-csuffix.test \ gir/union.test \ + gir/union-transparent.test \ gtktemplate/gtkcallback-incompatible.test \ gtktemplate/gtkcallback-unknown.test \ gtktemplate/gtkchild-field-assignment.test \ diff --git a/tests/gir/alias.test b/tests/gir/alias.test new file mode 100644 index 000000000..132d32af2 --- /dev/null +++ b/tests/gir/alias.test @@ -0,0 +1,14 @@ +GIR + +Input: + + + + + +Output: + +[CCode (cheader_filename = "test.h")] +[SimpleType] +public struct Foo : int { +} diff --git a/tests/gir/class.test b/tests/gir/class.test index 578c0b82e..cf265569d 100644 --- a/tests/gir/class.test +++ b/tests/gir/class.test @@ -2,6 +2,12 @@ GIR Input: + + + + + + @@ -127,6 +133,11 @@ Input: Output: +[CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")] +public class Bar : Test.Foo { + [CCode (has_construct_function = false)] + protected Bar (); +} [CCode (cheader_filename = "test.h", type_id = "test_foo_get_type ()")] public class Foo : GLib.Object, Test.IFoo { [CCode (has_construct_function = false)] @@ -140,6 +151,9 @@ public class Foo : GLib.Object, Test.IFoo { public string prop { owned get; set construct; } public signal void sig (string arg); } +[CCode (cheader_filename = "test.h")] +public interface IBar : Test.IFoo, GLib.Object { +} [CCode (cheader_filename = "test.h", type_id = "test_ifoo_get_type ()")] public interface IFoo : GLib.Object { public abstract void method () throws GLib.Error; diff --git a/tests/gir/union-transparent.test b/tests/gir/union-transparent.test new file mode 100644 index 000000000..d2e8e160a --- /dev/null +++ b/tests/gir/union-transparent.test @@ -0,0 +1,30 @@ +GIR + +Input: + + + + + + + + + + + + + + + + + + + +Output: + +[CCode (cheader_filename = "test.h", has_type_id = false)] +public struct Foo { + public uint u; + [CCode (array_length = false)] + public weak int a[2]; +}