From: Rico Tzschichholz Date: Mon, 17 Apr 2023 15:53:38 +0000 (+0200) Subject: WIP tests X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b287d8707928aeb1fe2af61496e006a1255f9311;p=thirdparty%2Fvala.git WIP tests --- diff --git a/tests/girwriter/girtest.vala b/tests/girwriter/girtest.vala index 06a506505..ce55cad78 100644 --- a/tests/girwriter/girtest.vala +++ b/tests/girwriter/girtest.vala @@ -169,7 +169,7 @@ namespace GirTest { public delegate bool DelegateErrorTest () throws ErrorTest; - public delegate bool DelegateGenericsTest (G g, T? t); + public delegate bool DelegateGenericsTest (G g, T? t) where G : TypeTest; [GIR (visible = false)] public delegate void SkippedDelegate (); @@ -442,7 +442,7 @@ namespace GirTest { public int i; } - public class GenericsTest { + public class GenericsTest where G : TypeTest { public GenericsTest (owned DelegateTest cb) { } @@ -454,7 +454,7 @@ namespace GirTest { } public class GenericsObjectTest : Object { - public void method (K[] param) { + public void method (K[] param) where K : TypeTest { } } diff --git a/tests/girwriter/girtest.vapi-expected b/tests/girwriter/girtest.vapi-expected index 5c75f2b5c..e6a77277d 100644 --- a/tests/girwriter/girtest.vapi-expected +++ b/tests/girwriter/girtest.vapi-expected @@ -35,10 +35,10 @@ namespace GirTest { [CCode (cheader_filename = "girtest.h")] public class GenericsObjectTest : GLib.Object { public GenericsObjectTest (); - public void method (K[] param); + public void method (K[] param) where K : GirTest.TypeTest; } [CCode (cheader_filename = "girtest.h")] - public class GenericsTest { + public class GenericsTest where G : GirTest.TypeTest { public GenericsTest (owned GirTest.DelegateTest cb); public void method (T? param); public GenericsTest.typed (owned GirTest.DelegateGenericsTest cb); @@ -262,7 +262,7 @@ namespace GirTest { [CCode (cheader_filename = "girtest.h")] public delegate bool DelegateErrorTest () throws GirTest.ErrorTest; [CCode (cheader_filename = "girtest.h")] - public delegate bool DelegateGenericsTest (G g, T? t); + public delegate bool DelegateGenericsTest (G g, T? t) where G : GirTest.TypeTest; [CCode (cheader_filename = "girtest.h")] public delegate bool DelegateTest (void* a, void* b); [CCode (cheader_filename = "girtest.h")]