From: Rico Tzschichholz Date: Wed, 16 Oct 2019 17:16:20 +0000 (+0200) Subject: tests: Extent "girwriter" test to increase coverage X-Git-Tag: 0.44.10~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d8d5001ca2b07ff280d017a9e8e976339585aa9;p=thirdparty%2Fvala.git tests: Extent "girwriter" test to increase coverage --- diff --git a/tests/girwriter/GirTest-1.0.gir-expected b/tests/girwriter/GirTest-1.0.gir-expected index 034f48418..a03f48fc6 100644 --- a/tests/girwriter/GirTest-1.0.gir-expected +++ b/tests/girwriter/GirTest-1.0.gir-expected @@ -137,6 +137,16 @@ + + + + + + + + + + @@ -527,6 +537,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -707,6 +763,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -933,6 +1022,19 @@ + + + + + + + + + + + + + @@ -1021,6 +1123,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1377,6 +1513,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/girwriter/girtest.vala b/tests/girwriter/girtest.vala index 3ace08a5b..e9b3d2ae1 100644 --- a/tests/girwriter/girtest.vala +++ b/tests/girwriter/girtest.vala @@ -79,6 +79,10 @@ namespace GirTest { public delegate bool DelegateTest (void* a, void* b); + public delegate bool DelegateErrorTest () throws ErrorTest; + + public delegate bool DelegateGenericsTest (G g, T t); + [GIR (visible = false)] public delegate void SkippedDelegate (); @@ -119,6 +123,9 @@ namespace GirTest { public ObjectTest.with_int (int param) { field = param; } + public ObjectTest.may_fail (int param) throws ErrorTest { + field = param; + } public ObjectTest.newv (int param, ...) { field = param; } @@ -232,6 +239,9 @@ namespace GirTest { public async void coroutine_async () { } + public virtual async void coroutine_virtual_async () { + } + public virtual async void coroutine_method_throw (int i1, out int o1) throws ErrorTest { o1 = i1; } @@ -267,6 +277,12 @@ namespace GirTest { public int property { get; construct set; } } + [Compact] + public class CompactClass { + public string s; + public int i; + } + [GIR (visible = false)] public class SkippedClass { } @@ -279,6 +295,9 @@ namespace GirTest { public GenericsTest (owned DelegateTest cb) { } + public GenericsTest.typed (owned DelegateGenericsTest cb) { + } + public void method (T param) { } } diff --git a/tests/girwriter/girtest.vapi-expected b/tests/girwriter/girtest.vapi-expected index 52d23d16a..f92e00d05 100644 --- a/tests/girwriter/girtest.vapi-expected +++ b/tests/girwriter/girtest.vapi-expected @@ -9,6 +9,13 @@ namespace GirTest { public abstract void method_throw () throws GirTest.ErrorTest; } [CCode (cheader_filename = "girtest.h")] + [Compact] + public class CompactClass { + public int i; + public string s; + public CompactClass (); + } + [CCode (cheader_filename = "girtest.h")] [Version (deprecated = true, deprecated_since = "0.1.2", since = "0.1.0")] public class DeprecatedClassTest { public DeprecatedClassTest (); @@ -22,6 +29,7 @@ namespace GirTest { public class GenericsTest { public GenericsTest (owned GirTest.DelegateTest cb); public void method (T param); + public GenericsTest.typed (owned GirTest.DelegateGenericsTest cb); } [CCode (cheader_filename = "girtest.h")] public class ImplementionTest : GLib.Object, GirTest.InterfaceTest { @@ -41,6 +49,7 @@ namespace GirTest { public (unowned string)[] container_return (); public async void coroutine_async (); public virtual async void coroutine_method_throw (int i1, out int o1) throws GirTest.ErrorTest; + public virtual async void coroutine_virtual_async (); public GirTest.DelegateTest delegate_return (); public GirTest.DelegateTest delegate_return_int_in_array_out (int i1, out int[] a); public static void full_inout (ref GirTest.ObjectTest obj); @@ -51,6 +60,7 @@ namespace GirTest { public void int8_out (out int8 param); public void int_in_int_in_array_out (int param1, int param2, out int[] array); public int[] int_in_int_in_array_return (int param1, int param2); + public ObjectTest.may_fail (int param) throws GirTest.ErrorTest; public void method (); public virtual void method_throw () throws GirTest.ErrorTest; public void method_valist (int param, va_list vargs); @@ -162,6 +172,10 @@ namespace GirTest { FISHY } [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); + [CCode (cheader_filename = "girtest.h")] public delegate bool DelegateTest (void* a, void* b); [CCode (cheader_filename = "girtest.h")] [GIR (visible = false)]