diff --git a/src/System.Drawing.Common/tests/FontFamilyTests.cs b/src/System.Drawing.Common/tests/FontFamilyTests.cs index 0ac652fc88ac..941bdac007f8 100644 --- a/src/System.Drawing.Common/tests/FontFamilyTests.cs +++ b/src/System.Drawing.Common/tests/FontFamilyTests.cs @@ -100,6 +100,10 @@ public void Equals_Object_ReturnsExpected(FontFamily fontFamily, object other, b } } + // This will fail on any platform we use libgdiplus, with any + // installed system fonts whose name is longer than 31 chars. + // macOS 10.15+ ships out of the box with a problem font + [ActiveIssue("https://github.com/dotnet/runtime/issues/40937", TestPlatforms.AnyUnix)] [ConditionalFact(Helpers.IsDrawingSupported)] public void Families_Get_ReturnsExpected() { diff --git a/src/System.IO.Ports/tests/SerialPort/DosDevices.cs b/src/System.IO.Ports/tests/SerialPort/DosDevices.cs index ed4e45a73339..aa830cc9530c 100644 --- a/src/System.IO.Ports/tests/SerialPort/DosDevices.cs +++ b/src/System.IO.Ports/tests/SerialPort/DosDevices.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; +using System.ComponentModel; using System.Runtime.InteropServices; namespace System.IO.Ports.Tests @@ -128,14 +129,20 @@ private static char[] CallQueryDosDevice(string name, out int dataSize) buffer = new char[buffer.Length * 2]; dataSize = QueryDosDevice(null, buffer, buffer.Length); } + else if (lastError == ERROR_ACCESS_DENIED) // Access denied eg for "MSSECFLTSYS" - just skip + { + dataSize = 0; + break; + } else { - throw new Exception("Unknown Win32 Error: " + lastError); + throw new Exception($"Error {lastError} calling QueryDosDevice for '{name}' with buffer size {buffer.Length}. {new Win32Exception((int)lastError).Message}"); } } return buffer; } + public const int ERROR_ACCESS_DENIED = 5; public const int ERROR_INSUFFICIENT_BUFFER = 122; public const int ERROR_MORE_DATA = 234;