From e44611bd25360df725d9331ca6bbffef3e71ad72 Mon Sep 17 00:00:00 2001 From: Sergey Nechaev <6499856+snechaev@users.noreply.github.com> Date: Wed, 22 Oct 2025 21:23:30 +0200 Subject: [PATCH] Additional test to verify that FFProbeHelper still throws FFMpegException when FFProbe exits with non-zero code and no cancellation was requested. Ref.: #594 --- FFMpegCore.Test/FFProbeTests.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/FFMpegCore.Test/FFProbeTests.cs b/FFMpegCore.Test/FFProbeTests.cs index 16f3b4c..ee837bf 100644 --- a/FFMpegCore.Test/FFProbeTests.cs +++ b/FFMpegCore.Test/FFProbeTests.cs @@ -1,4 +1,5 @@ -using FFMpegCore.Test.Resources; +using FFMpegCore.Exceptions; +using FFMpegCore.Test.Resources; namespace FFMpegCore.Test; @@ -342,4 +343,13 @@ public class FFProbeTests // Check that all exceptions are OperationCanceledException CollectionAssert.AllItemsAreInstancesOfType(exceptions, typeof(OperationCanceledException)); } + + [TestMethod] + [Timeout(10000, CooperativeCancellation = true)] + public async Task FFProbe_Should_Throw_FFMpegException_When_Exits_With_Non_Zero_Code() + { + var input = TestResources.SrtSubtitle; //non media file + await Assert.ThrowsAsync(async () => await FFProbe.AnalyseAsync(input, + cancellationToken: TestContext.CancellationToken, customArguments: "--some-invalid-argument")); + } }