Skip to content

naming corrections - macOS and .NET #2065

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ImageSharp/Metadata/Profiles/Exif/ExifReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ protected void ReadSubIfd(List<IExifValue> values)

protected void ReadValues64(List<IExifValue> values, ulong offset)
{
DebugGuard.MustBeLessThanOrEqualTo(offset, (ulong)this.data.Length, "By spec UInt64.MaxValue is supported, but .Net Stream.Length can Int64.MaxValue.");
DebugGuard.MustBeLessThanOrEqualTo(offset, (ulong)this.data.Length, "By spec UInt64.MaxValue is supported, but .NET Stream.Length can Int64.MaxValue.");

this.Seek(offset);
ulong count = this.ReadUInt64();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,12 @@ public void Invoke(in RowInterval rows, Span<Vector4> span)
&& RuntimeEnvironment.IsNetCore)
{
// There's something wrong with the JIT in .NET Core 3.1 on certain
// MacOSX machines so we have to use different pipelines.
// macOS machines so we have to use different pipelines.
// It's:
// - Not reproducable locally
// - Doesn't seem to be triggered by the bulk Numerics.UnPremultiply method but by caller.
// https://github.com/SixLabors/ImageSharp/pull/1591
this.InvokeMacOSX(in rows, span);
this.InvokeMacOS(in rows, span);
return;
}

Expand Down Expand Up @@ -259,7 +259,7 @@ public void Invoke(in RowInterval rows, Span<Vector4> span)

[ExcludeFromCodeCoverage]
[MethodImpl(InliningOptions.ShortMethod)]
private void InvokeMacOSX(in RowInterval rows, Span<Vector4> span)
private void InvokeMacOS(in RowInterval rows, Span<Vector4> span)
{
Matrix3x2 matrix = this.matrix;
TResampler sampler = this.sampler;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,12 @@ public void Invoke(in RowInterval rows, Span<Vector4> span)
&& RuntimeEnvironment.IsNetCore)
{
// There's something wrong with the JIT in .NET Core 3.1 on certain
// MacOSX machines so we have to use different pipelines.
// macOS machines so we have to use different pipelines.
// It's:
// - Not reproducable locally
// - Doesn't seem to be triggered by the bulk Numerics.UnPremultiply method but by caller.
// https://github.com/SixLabors/ImageSharp/pull/1591
this.InvokeMacOSX(in rows, span);
this.InvokeMacOS(in rows, span);
return;
}

Expand Down Expand Up @@ -258,7 +258,7 @@ public void Invoke(in RowInterval rows, Span<Vector4> span)

[ExcludeFromCodeCoverage]
[MethodImpl(InliningOptions.ShortMethod)]
public void InvokeMacOSX(in RowInterval rows, Span<Vector4> span)
public void InvokeMacOS(in RowInterval rows, Span<Vector4> span)
{
Matrix4x4 matrix = this.matrix;
TResampler sampler = this.sampler;
Expand Down
16 changes: 8 additions & 8 deletions tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public void TiffDecoder_CanDecode_12Bit_WithUnassociatedAlpha<TPixel>(TestImageP
public void TiffDecoder_CanDecode_12Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsOSX)
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder);
Expand Down Expand Up @@ -249,7 +249,7 @@ public void TiffDecoder_CanDecode_20Bit_WithAssociatedAlpha<TPixel>(TestImagePro

where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsOSX)
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder);
Expand All @@ -276,7 +276,7 @@ public void TiffDecoder_CanDecode_24Bit_WithUnassociatedAlpha<TPixel>(TestImageP
public void TiffDecoder_CanDecode_24Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsOSX)
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder);
Expand Down Expand Up @@ -313,7 +313,7 @@ public void TiffDecoder_CanDecode_YCbCr_24Bit<TPixel>(TestImageProvider<TPixel>
where TPixel : unmanaged, IPixel<TPixel>
{
// Note: The image from MagickReferenceDecoder does not look right, maybe we are doing something wrong
// converting the pixel data from Magick.Net to our format with YCbCr?
// converting the pixel data from Magick.NET to our format with YCbCr?
using Image<TPixel> image = provider.GetImage();
image.DebugSave(provider);
}
Expand Down Expand Up @@ -353,7 +353,7 @@ public void TiffDecoder_CanDecode_32Bit_WithUnassociatedAlpha<TPixel>(TestImageP
public void TiffDecoder_CanDecode_32Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsOSX)
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder);
Expand Down Expand Up @@ -393,7 +393,7 @@ public void TiffDecoder_CanDecode_40Bit_WithUnassociatedAlpha<TPixel>(TestImageP
public void TiffDecoder_CanDecode_40Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsOSX)
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder);
Expand Down Expand Up @@ -432,7 +432,7 @@ public void TiffDecoder_CanDecode_48Bit_WithUnassociatedAlpha<TPixel>(TestImageP
public void TiffDecoder_CanDecode_48Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsOSX)
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder);
Expand Down Expand Up @@ -462,7 +462,7 @@ public void TiffDecoder_CanDecode_56Bit_WithUnassociatedAlpha<TPixel>(TestImageP
public void TiffDecoder_CanDecode_56Bit_WithAssociatedAlpha<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
if (TestEnvironment.IsOSX)
if (TestEnvironment.IsMacOS)
{
// Only debug save on OSX: For some reason the reference image has a difference of 50%. The imagesharp output file looks ok though.
using Image<TPixel> image = provider.GetImage(TiffDecoder);
Expand Down
2 changes: 1 addition & 1 deletion tests/ImageSharp.Tests/Helpers/RuntimeEnvironmentTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public void CanDetectOSPlatform()
{
Assert.True(RuntimeEnvironment.IsOSPlatform(OSPlatform.Linux));
}
else if (TestEnvironment.IsOSX)
else if (TestEnvironment.IsMacOS)
{
Assert.True(RuntimeEnvironment.IsOSPlatform(OSPlatform.OSX));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ public class NonParallelCollection
[Collection(nameof(NonParallelCollection))]
public class NonParallel
{
public static readonly bool IsNotMacOs = !TestEnvironment.IsOSX;
public static readonly bool IsNotMacOS = !TestEnvironment.IsMacOS;

// TODO: Investigate failures on MacOS. All handles are released after GC.
// TODO: Investigate failures on macOS. All handles are released after GC.
// (It seems to happen more consistently on .NET 6.)
[ConditionalFact(nameof(IsNotMacOs))]
[ConditionalFact(nameof(IsNotMacOS))]
public void MultiplePoolInstances_TrimPeriodElapsed_AllAreTrimmed()
{
if (!TestEnvironment.RunsOnCI)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,9 @@ public void Rent_MultiBuff_BelowCapacity_Succeeds(int initialRent, int attempt,
cleanup.Register(b1);
}

public static readonly bool IsNotMacOS = !TestEnvironment.IsOSX;
public static readonly bool IsNotMacOS = !TestEnvironment.IsMacOS;

// TODO: Investigate MacOS failures
// TODO: Investigate macOS failures
[ConditionalTheory(nameof(IsNotMacOS))]
[InlineData(false)]
[InlineData(true)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,9 @@ static void RunTest()
[InlineData(1200)] // Group of two UniformUnmanagedMemoryPool buffers
public void AllocateMemoryGroup_Finalization_ReturnsToPool(int length)
{
if (TestEnvironment.IsOSX)
if (TestEnvironment.IsMacOS)
{
// Skip on OSX: https://github.com/SixLabors/ImageSharp/issues/1887
// Skip on macOS: https://github.com/SixLabors/ImageSharp/issues/1887
return;
}

Expand Down Expand Up @@ -321,9 +321,9 @@ private static void AllocateGroupAndForget(UniformUnmanagedMemoryPoolMemoryAlloc
[InlineData(600)] // Group of single UniformUnmanagedMemoryPool buffer
public void AllocateSingleMemoryOwner_Finalization_ReturnsToPool(int length)
{
if (TestEnvironment.IsOSX)
if (TestEnvironment.IsMacOS)
{
// Skip on OSX: https://github.com/SixLabors/ImageSharp/issues/1887
// Skip on macOS: https://github.com/SixLabors/ImageSharp/issues/1887
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class ResizeTests
};

private static readonly ImageComparer ValidatorComparer =
ImageComparer.TolerantPercentage(TestEnvironment.IsOSX && TestEnvironment.RunsOnCI ? 0.26F : 0.07F);
ImageComparer.TolerantPercentage(TestEnvironment.IsMacOS && TestEnvironment.RunsOnCI ? 0.26F : 0.07F);

[Fact]
public void Resize_PixelAgnostic()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private static string StringifyReports(IEnumerable<ImageSimilarityReport> report

sb.Append(Environment.NewLine);

// TODO: We should add OSX.
// TODO: We should add macOS.
sb.AppendFormat("Test Environment OS : {0}", TestEnvironment.IsWindows ? "Windows" : "Linux");
sb.Append(Environment.NewLine);

Expand Down
2 changes: 1 addition & 1 deletion tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ internal static string GetReferenceOutputFileName(string actualOutputFileName) =

internal static bool IsLinux => RuntimeInformation.IsOSPlatform(OSPlatform.Linux);

internal static bool IsOSX => RuntimeInformation.IsOSPlatform(OSPlatform.OSX);
internal static bool IsMacOS => RuntimeInformation.IsOSPlatform(OSPlatform.OSX);

internal static bool IsMono => Type.GetType("Mono.Runtime") != null; // https://stackoverflow.com/a/721194

Expand Down