Additional test to verify that FFProbeHelper still throws FFMpegException when FFProbe exits with non-zero code and no cancellation was requested.

Ref.: #594
This commit is contained in:
Sergey Nechaev 2025-10-22 21:23:30 +02:00
parent b863f5d19e
commit e44611bd25

View file

@ -1,4 +1,5 @@
using FFMpegCore.Test.Resources; using FFMpegCore.Exceptions;
using FFMpegCore.Test.Resources;
namespace FFMpegCore.Test; namespace FFMpegCore.Test;
@ -342,4 +343,13 @@ public class FFProbeTests
// Check that all exceptions are OperationCanceledException // Check that all exceptions are OperationCanceledException
CollectionAssert.AllItemsAreInstancesOfType(exceptions, typeof(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<FFMpegException>(async () => await FFProbe.AnalyseAsync(input,
cancellationToken: TestContext.CancellationToken, customArguments: "--some-invalid-argument"));
}
} }