Create variable for holding macOS max pipe path length to avoid magic number

This commit is contained in:
Malte Rosenbjerg 2025-10-17 19:53:38 +02:00
parent f0b5859afd
commit 1b0051b234

View file

@ -9,6 +9,7 @@ namespace FFMpegCore.Test;
public class ArgumentBuilderTest public class ArgumentBuilderTest
{ {
private readonly string[] _concatFiles = { "1.mp4", "2.mp4", "3.mp4", "4.mp4" }; private readonly string[] _concatFiles = { "1.mp4", "2.mp4", "3.mp4", "4.mp4" };
private readonly int _macOsMaxPipePathLength = 104;
private readonly string[] _multiFiles = { "1.mp3", "2.mp3", "3.mp3", "4.mp3" }; private readonly string[] _multiFiles = { "1.mp3", "2.mp3", "3.mp3", "4.mp3" };
[TestMethod] [TestMethod]
@ -709,13 +710,13 @@ public class ArgumentBuilderTest
public void InputPipe_MaxLength_ShorterThanMacOsMax() public void InputPipe_MaxLength_ShorterThanMacOsMax()
{ {
var pipePath = new InputPipeArgument(new StreamPipeSource(Stream.Null)).PipePath; var pipePath = new InputPipeArgument(new StreamPipeSource(Stream.Null)).PipePath;
Assert.IsLessThan(104, pipePath.Length); Assert.IsLessThan(_macOsMaxPipePathLength, pipePath.Length);
} }
[TestMethod] [TestMethod]
public void OutputPipe_MaxLength_ShorterThanMacOsMax() public void OutputPipe_MaxLength_ShorterThanMacOsMax()
{ {
var pipePath = new OutputPipeArgument(new StreamPipeSink(Stream.Null)).PipePath; var pipePath = new OutputPipeArgument(new StreamPipeSink(Stream.Null)).PipePath;
Assert.IsLessThan(104, pipePath.Length); Assert.IsLessThan(_macOsMaxPipePathLength, pipePath.Length);
} }
} }