From 0022508889adb8b60bde8bc5e69640d3ff8dd346 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Mon, 15 Jun 2026 21:20:06 +0200 Subject: Add regression test --- .../Encoder/ApplePlatformHelperTests.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/Jellyfin.MediaEncoding.Tests/Encoder/ApplePlatformHelperTests.cs (limited to 'tests/Jellyfin.MediaEncoding.Tests/Encoder') diff --git a/tests/Jellyfin.MediaEncoding.Tests/Encoder/ApplePlatformHelperTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Encoder/ApplePlatformHelperTests.cs new file mode 100644 index 0000000000..586a382485 --- /dev/null +++ b/tests/Jellyfin.MediaEncoding.Tests/Encoder/ApplePlatformHelperTests.cs @@ -0,0 +1,18 @@ +using System; +using System.Runtime.Versioning; +using MediaBrowser.MediaEncoding.Encoder; +using Xunit; + +namespace Jellyfin.MediaEncoding.Tests; + +[SupportedOSPlatform("macos")] +public class ApplePlatformHelperTests +{ + [Fact] + public void GetSysctlValue_CpuBrand_NotEmpty() + { + Assert.SkipUnless(OperatingSystem.IsMacOS(), "macOS-only test"); + + Assert.NotEmpty(ApplePlatformHelper.GetSysctlValue("machdep.cpu.brand_string")); + } +} -- cgit v1.2.3 From 4c228eaf63c0b60e40a5a4b82aa66af336750f08 Mon Sep 17 00:00:00 2001 From: Bond_009 Date: Tue, 16 Jun 2026 17:45:22 +0200 Subject: Make sure we don't include the null terminator --- .../Encoder/ApplePlatformHelperTests.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests/Jellyfin.MediaEncoding.Tests/Encoder') diff --git a/tests/Jellyfin.MediaEncoding.Tests/Encoder/ApplePlatformHelperTests.cs b/tests/Jellyfin.MediaEncoding.Tests/Encoder/ApplePlatformHelperTests.cs index 586a382485..9847acbb0a 100644 --- a/tests/Jellyfin.MediaEncoding.Tests/Encoder/ApplePlatformHelperTests.cs +++ b/tests/Jellyfin.MediaEncoding.Tests/Encoder/ApplePlatformHelperTests.cs @@ -13,6 +13,10 @@ public class ApplePlatformHelperTests { Assert.SkipUnless(OperatingSystem.IsMacOS(), "macOS-only test"); - Assert.NotEmpty(ApplePlatformHelper.GetSysctlValue("machdep.cpu.brand_string")); + var value = ApplePlatformHelper.GetSysctlValue("machdep.cpu.brand_string"); + Assert.NotEmpty(value); + + // Make sure we don't include the null terminator + Assert.DoesNotContain("\0", value, StringComparison.Ordinal); } } -- cgit v1.2.3