Remove WindowsOnlyTestMethod and use OsSpecificTestMethod

This commit is contained in:
Malte Rosenbjerg 2025-10-17 15:14:42 +02:00
parent a71a55741f
commit 2a25bff836
2 changed files with 10 additions and 38 deletions

View file

@ -1,28 +0,0 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace FFMpegCore.Test.Utilities;
public class WindowsOnlyTestMethod : TestMethodAttribute
{
public WindowsOnlyTestMethod([CallerFilePath] string callerFilePath = "", [CallerLineNumber] int callerLineNumber = -1)
: base(callerFilePath, callerLineNumber)
{
}
public override async Task<TestResult[]> ExecuteAsync(ITestMethod testMethod)
{
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
var message = "Test not executed on other platforms than Windows";
{
return
[
new TestResult { Outcome = UnitTestOutcome.Inconclusive, TestFailureException = new AssertInconclusiveException(message) }
];
}
}
return await base.ExecuteAsync(testMethod);
}
}

View file

@ -93,7 +93,7 @@ public class VideoTest
}
[SupportedOSPlatform("windows")]
[WindowsOnlyTestMethod]
[OsSpecificTestMethod(OsPlatforms.Windows)]
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
[DataRow(PixelFormat.Format24bppRgb)]
[DataRow(PixelFormat.Format32bppArgb)]
@ -125,7 +125,7 @@ public class VideoTest
}
[SupportedOSPlatform("windows")]
[WindowsOnlyTestMethod]
[OsSpecificTestMethod(OsPlatforms.Windows)]
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
public void Video_ToMP4_Args_Pipe_DifferentImageSizes_WindowsOnly()
{
@ -157,7 +157,7 @@ public class VideoTest
}
[SupportedOSPlatform("windows")]
[WindowsOnlyTestMethod]
[OsSpecificTestMethod(OsPlatforms.Windows)]
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
public async Task Video_ToMP4_Args_Pipe_DifferentImageSizes_WindowsOnly_Async()
{
@ -189,7 +189,7 @@ public class VideoTest
}
[SupportedOSPlatform("windows")]
[WindowsOnlyTestMethod]
[OsSpecificTestMethod(OsPlatforms.Windows)]
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
public void Video_ToMP4_Args_Pipe_DifferentPixelFormats_WindowsOnly()
{
@ -222,7 +222,7 @@ public class VideoTest
}
[SupportedOSPlatform("windows")]
[WindowsOnlyTestMethod]
[OsSpecificTestMethod(OsPlatforms.Windows)]
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
public async Task Video_ToMP4_Args_Pipe_DifferentPixelFormats_WindowsOnly_Async()
{
@ -397,7 +397,7 @@ public class VideoTest
}
[SupportedOSPlatform("windows")]
[WindowsOnlyTestMethod]
[OsSpecificTestMethod(OsPlatforms.Windows)]
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
[DataRow(PixelFormat.Format24bppRgb)]
[DataRow(PixelFormat.Format32bppArgb)]
@ -446,7 +446,7 @@ public class VideoTest
}
[SupportedOSPlatform("windows")]
[WindowsOnlyTestMethod]
[OsSpecificTestMethod(OsPlatforms.Windows)]
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
[DataRow(SKColorType.Rgb565)]
[DataRow(SKColorType.Bgra8888)]
@ -483,7 +483,7 @@ public class VideoTest
}
[SupportedOSPlatform("windows")]
[WindowsOnlyTestMethod]
[OsSpecificTestMethod(OsPlatforms.Windows)]
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
[DataRow(PixelFormat.Format24bppRgb)]
[DataRow(PixelFormat.Format32bppArgb)]
@ -516,7 +516,7 @@ public class VideoTest
}
[SupportedOSPlatform("windows")]
[WindowsOnlyTestMethod]
[OsSpecificTestMethod(OsPlatforms.Windows)]
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
public void Video_Snapshot_InMemory_SystemDrawingCommon()
{
@ -840,7 +840,7 @@ public class VideoTest
}
[SupportedOSPlatform("windows")]
[WindowsOnlyTestMethod]
[OsSpecificTestMethod(OsPlatforms.Windows)]
[Timeout(BaseTimeoutMilliseconds, CooperativeCancellation = true)]
public void Video_TranscodeInMemory_WindowsOnly()
{