From 2a25bff836671a2a823143e6dcfc3acab81fb4ef Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Fri, 17 Oct 2025 15:14:42 +0200 Subject: [PATCH] Remove WindowsOnlyTestMethod and use OsSpecificTestMethod --- .../Utilities/WindowsOnlyTestMethod.cs | 28 ------------------- FFMpegCore.Test/VideoTest.cs | 20 ++++++------- 2 files changed, 10 insertions(+), 38 deletions(-) delete mode 100644 FFMpegCore.Test/Utilities/WindowsOnlyTestMethod.cs diff --git a/FFMpegCore.Test/Utilities/WindowsOnlyTestMethod.cs b/FFMpegCore.Test/Utilities/WindowsOnlyTestMethod.cs deleted file mode 100644 index 9a87749..0000000 --- a/FFMpegCore.Test/Utilities/WindowsOnlyTestMethod.cs +++ /dev/null @@ -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 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); - } -} diff --git a/FFMpegCore.Test/VideoTest.cs b/FFMpegCore.Test/VideoTest.cs index 010ec44..7946552 100644 --- a/FFMpegCore.Test/VideoTest.cs +++ b/FFMpegCore.Test/VideoTest.cs @@ -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() {