From c74a782ad22c57fa6e85fb2d786e612e2b713eb9 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Thu, 9 May 2024 13:52:09 +0200 Subject: [PATCH] More debugging --- src/NetVips/VipsProgress.cs | 2 +- tests/NetVips.Tests/IoFuncsTests.cs | 6 ++++-- tests/NetVips.Tests/NetVips.Tests.csproj | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/NetVips/VipsProgress.cs b/src/NetVips/VipsProgress.cs index f09936b..3881730 100644 --- a/src/NetVips/VipsProgress.cs +++ b/src/NetVips/VipsProgress.cs @@ -66,6 +66,6 @@ public struct VipsProgress /// /// Start time. /// - private IntPtr StartPtr; + public IntPtr Start; } } \ No newline at end of file diff --git a/tests/NetVips.Tests/IoFuncsTests.cs b/tests/NetVips.Tests/IoFuncsTests.cs index 62ffc20..8686742 100644 --- a/tests/NetVips.Tests/IoFuncsTests.cs +++ b/tests/NetVips.Tests/IoFuncsTests.cs @@ -6,6 +6,7 @@ namespace NetVips.Tests using System.Runtime.InteropServices; using Xunit; using Xunit.Abstractions; + using ObjectLayoutInspector; public class IoFuncsTests : IClassFixture { @@ -245,10 +246,11 @@ void EvalCallback(Image image, VipsProgress progressStruct) _testOutputHelper.WriteLine($" tpels = {progressStruct.TPels} (total number of pels)"); _testOutputHelper.WriteLine($" npels = {progressStruct.NPels} (number of pels computed so far)"); _testOutputHelper.WriteLine($" percent = {progressStruct.Percent} (percent complete)"); - //_testOutputHelper.WriteLine($" active = {progressStruct.Start.Active} (timer active)"); + //_testOutputHelper.WriteLine($" active = {Marshal.PtrToStructure(progressStruct.Start).Active} (timer active)"); } - _testOutputHelper.WriteLine($"sizeof(VipsProgress): {Marshal.SizeOf()}"); + _testOutputHelper.WriteLine(TypeLayout.GetLayout().ToString()); + _testOutputHelper.WriteLine(TypeLayout.GetLayout().ToString()); im.SetProgress(true); im.SignalConnect(Enums.Signals.PreEval, EvalCallback); diff --git a/tests/NetVips.Tests/NetVips.Tests.csproj b/tests/NetVips.Tests/NetVips.Tests.csproj index d35d1f1..90cd1fe 100644 --- a/tests/NetVips.Tests/NetVips.Tests.csproj +++ b/tests/NetVips.Tests/NetVips.Tests.csproj @@ -23,6 +23,7 @@ +