mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-19 06:00:41 +01:00
Merge pull request #17099 from Bond-009/libraryimport
Follow native interoperability best practices
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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");
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ using Xunit;
|
||||
|
||||
namespace Jellyfin.Server.Implementations.Tests.IO;
|
||||
|
||||
public class ManagedFileSystemTests
|
||||
public partial class ManagedFileSystemTests
|
||||
{
|
||||
private readonly IFixture _fixture;
|
||||
private readonly ManagedFileSystem _sut;
|
||||
@@ -117,7 +117,7 @@ public class ManagedFileSystemTests
|
||||
}
|
||||
|
||||
[SuppressMessage("Naming Rules", "SA1300:ElementMustBeginWithUpperCaseLetter", Justification = "Have to")]
|
||||
[DllImport("libc", SetLastError = true, CharSet = CharSet.Ansi)]
|
||||
[LibraryImport("libc", SetLastError = true)]
|
||||
[DefaultDllImportSearchPaths(DllImportSearchPath.UserDirectories)]
|
||||
private static extern int symlink(string target, string linkpath);
|
||||
private static partial int symlink([MarshalAs(UnmanagedType.LPStr)] string target, [MarshalAs(UnmanagedType.LPStr)] string linkpath);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{2E3A1B4B-4225-4AAA-8B29-0181A84E7AEE}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user