mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2024-11-10 08:34:12 +01:00
Fix tests
This commit is contained in:
parent
52444d439e
commit
f22c506f46
2 changed files with 24 additions and 16 deletions
|
@ -284,27 +284,29 @@ public void Video_ToMP4_Args_StreamPipe()
|
||||||
|
|
||||||
[TestMethod, Timeout(45000)]
|
[TestMethod, Timeout(45000)]
|
||||||
public void Video_ToMP4_Args_StreamOutputPipe_Async_Failure()
|
public void Video_ToMP4_Args_StreamOutputPipe_Async_Failure()
|
||||||
{
|
|
||||||
Assert.ThrowsException<FFMpegException>(() =>
|
|
||||||
{
|
{
|
||||||
using var ms = new MemoryStream();
|
using var ms = new MemoryStream();
|
||||||
var pipeSource = new StreamPipeDataReader(ms);
|
var pipeSource = new StreamPipeDataReader(ms);
|
||||||
FFMpegArguments
|
var result = FFMpegArguments
|
||||||
.FromInputFiles(VideoLibrary.LocalVideo)
|
.FromInputFiles(VideoLibrary.LocalVideo)
|
||||||
.ForceFormat("mkv")
|
.ForceFormat("mkv")
|
||||||
.OutputToPipe(pipeSource)
|
.OutputToPipe(pipeSource)
|
||||||
.ProcessAsynchronously()
|
.ProcessAsynchronously()
|
||||||
.WaitForResult();
|
.WaitForResult();
|
||||||
});
|
Assert.IsFalse(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod, Timeout(45000)]
|
[TestMethod, Timeout(45000)]
|
||||||
public void Video_ToMP4_Args_StreamOutputPipe_Failure()
|
public void Video_ToMP4_Args_StreamOutputPipe_Failure()
|
||||||
{
|
{
|
||||||
Assert.ThrowsException<FFMpegException>(() =>
|
using var ms = new MemoryStream();
|
||||||
{
|
var pipeSource = new StreamPipeDataReader(ms);
|
||||||
ConvertToStreamPipe(new ForceFormatArgument("mkv"));
|
var result = FFMpegArguments
|
||||||
});
|
.FromInputFiles(VideoLibrary.LocalVideo)
|
||||||
|
.ForceFormat("mkv")
|
||||||
|
.OutputToPipe(pipeSource)
|
||||||
|
.ProcessSynchronously();
|
||||||
|
Assert.IsFalse(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,14 @@ public void Post()
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task During(CancellationToken? cancellationToken = null)
|
public async Task During(CancellationToken? cancellationToken = null)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
await ProcessDataAsync(cancellationToken ?? CancellationToken.None).ConfigureAwait(false);
|
await ProcessDataAsync(cancellationToken ?? CancellationToken.None).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
catch (TaskCanceledException)
|
||||||
|
{
|
||||||
|
}
|
||||||
Post();
|
Post();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue