diff --git a/tests/NetVips.Tests/IoFuncsTests.cs b/tests/NetVips.Tests/IoFuncsTests.cs index a7901f68..e4d83c83 100644 --- a/tests/NetVips.Tests/IoFuncsTests.cs +++ b/tests/NetVips.Tests/IoFuncsTests.cs @@ -9,8 +9,11 @@ namespace NetVips.Tests public class IoFuncsTests : IClassFixture { + private readonly ITestOutputHelper _testOutputHelper; + public IoFuncsTests(TestsFixture testsFixture, ITestOutputHelper output) { + _testOutputHelper = output; testsFixture.SetUpLogging(output); } @@ -235,14 +238,24 @@ public void TestSetProgress() var im = Image.NewFromFile(Helper.JpegFile, access: Enums.Access.Sequential); - var lastPercent = 0; + void EvalCallback(Image image, VipsProgress progressStruct) + { + _testOutputHelper.WriteLine($" run = {progressStruct.Run} (seconds of run time)"); + _testOutputHelper.WriteLine($" eta = {progressStruct.Eta} (estimated seconds left)"); + _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)"); + } - var progress = new Progress(percent => lastPercent = percent); - im.SetProgress(progress); + im.SetProgress(true); + im.SignalConnect(Enums.Signals.PreEval, EvalCallback); + im.SignalConnect(Enums.Signals.Eval, EvalCallback); + im.SignalConnect(Enums.Signals.PostEval, EvalCallback); - var buf = im.DzsaveBuffer("image-pyramid"); + var buf = im.DzsaveBuffer("image-pyramid", suffix: ".png"); Assert.True(buf.Length > 0); - Assert.True(lastPercent <= 100); + Assert.True(false); } [Fact]