Skip to content

Annotate APIs throwing PNSE on Android #47911

Closed

Description

@marek-safar

All public APIs that throw PNSE needs to be annotated with System.Runtime.Versioning.UnsupportedOSPlatformAttribute.

Activity

  1. ghost added
    untriaged
    on Feb 5, 2021
  2. added
    tracking
    and removed
    untriaged
    on Feb 5, 2021
  3. added this to the 6.0.0 milestone on Feb 5, 2021
  4. MaximLipnin commented on Apr 2, 2021

    @MaximLipnin
    Contributor

    This is a list of the library tests (thanks to @mdh1418) which fail with PNSE on Android:

    System.Net.NetworkInformation.Functional.Tests
    System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpActiveConnections_Succeed(address: 127.0.0.1)
    System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpActiveConnections_Succeed(address: ::1)
    System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_AccessAllMethods_NoErrors
    System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpActiveConnections_NotListening
    System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpListeners_Succeed(address: 127.0.0.1)
    System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpListeners_Succeed(address: ::1)
    
    System.Net.Primitives.Functional.Tests
    System.Net.Primitives.Functional.Tests.SocketAddressTest.ToString_UnsupportedFamily_Throws(family: Packet)
    System.Net.Primitives.Functional.Tests.SocketAddressTest.ToString_UnsupportedFamily_Throws(family: ControllerAreaNetwork)
    
    System.Console.Tests
    CancelKeyPressTests.CanAddAndRemoveHandler
    ReadAndWrite.OutputEncodingPreamble
    ReadAndWrite.ReadAndReadLine
    ReadAndWrite.OutputEncoding
    SetIn.SetInReadLine
    SetIn.SetInThrowsOnNull
    Color.RoundtrippingColor
    Color.RedirectedOutputDoesNotUseAnsiSequences
    Color.InvalidColors
    ConsoleEncoding.TestEncoding(inputString: \"This string has non ascii characters αßΓπΣσµ\")
    ConsoleEncoding.TestEncoding(inputString: \"\\xd800\")
    ConsoleEncoding.TestEncoding(inputString: \"This is Ascii string\")
    ConsoleEncoding.TestEncoding(inputString: \"This string has invalid surrogates \\xd800\\xd800\\xd\"...)
    ConsoleEncoding.TestEncoding(inputString: \"This is string have surrogates �\")
    ConsoleEncoding.TestValidEncodings
    SyncTextReader.ReadAsync
    SyncTextReader.ReadBlockAsync
    SyncTextReader.ReadLineAsync
    SyncTextReader.Read
    SyncTextReader.ReadToEnd
    SyncTextReader.ReadBlock
    SyncTextReader.Peek
    SyncTextReader.ReadToEndAsync
    TimeOut.OpenStandardXXX_ReadTimeOut
    TimeOut.OpenStandardXXX_WriteTimeOut
    TimeOut.OpenStandardXXX_CanTimeOut
    ThreadSafety.SetStandardXXXCanBeCalledConcurrently
    ThreadSafety.ReadMayBeCalledConcurrently
    ThreadSafety.OpenStandardXXXCanBeCalledConcurrently
    WindowAndCursorProps.GetCursorPosition_Invoke_ReturnsExpected
    WindowAndCursorProps.CursorVisible_SetUnixRedirected_Nop(value: False)
    WindowAndCursorProps.CursorVisible_SetUnixRedirected_Nop(value: True)
    WindowAndCursorProps.CursorTop_SetInvalid_ThrowsArgumentOutOfRangeException(value: -1)
    WindowAndCursorProps.CursorTop_SetInvalid_ThrowsArgumentOutOfRangeException(value: 32768)
    WindowAndCursorProps.CursorLeft_SetInvalid_ThrowsArgumentOutOfRangeException(value: 32768)
    WindowAndCursorProps.CursorLeft_SetInvalid_ThrowsArgumentOutOfRangeException(value: -1)
    WindowAndCursorProps.LargestWindowHeight_UnixGet_ReturnsExpected
    WindowAndCursorProps.WindowHeight_GetUnix_Success
    WindowAndCursorProps.WindowWidth_GetUnix_Success
    WindowAndCursorProps.BufferWidth_GetUnix_ReturnsWindowWidth
    WindowAndCursorProps.SetCursorPosition_Invoke_Success
    WindowAndCursorProps.CursorSize_GetUnix_ReturnsExpected
    WindowAndCursorProps.LargestWindowWidth_UnixGet_ReturnsExpected
    WindowAndCursorProps.BufferHeight_GetUnix_ReturnsWindowHeight
    WindowAndCursorProps.CursorTop_Set_GetReturnsExpected
    WindowAndCursorProps.CursorLeft_Set_GetReturnsExpected
    

    It can be helpful for annotating the unsupported APIs.

  5. marek-safar commented on Apr 2, 2021

    @marek-safar
    ContributorAuthor

    The list looks reasonable perhaps except SocketAddressTest.ToString_UnsupportedFamily_Throws. I think ToString in general should never throw so that might need general fix.

  6. MaximLipnin commented on Apr 29, 2021

    @MaximLipnin
    Contributor

    If we don't have any other issue where the PNSE-throwing APIs are listed, then this issue can be closed as resolved.

  7. MaximLipnin commented on Apr 30, 2021

    @MaximLipnin
    Contributor

    This is a list of the library tests (thanks to @mdh1418) which fail with PNSE on Android:

    System.Net.NetworkInformation.Functional.Tests
    System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpActiveConnections_Succeed(address: 127.0.0.1)
    System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpActiveConnections_Succeed(address: ::1)
    System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_AccessAllMethods_NoErrors
    System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpActiveConnections_NotListening
    System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpListeners_Succeed(address: 127.0.0.1)
    System.Net.NetworkInformation.Tests.IPGlobalPropertiesTest.IPGlobalProperties_TcpListeners_Succeed(address: ::1)
    
    System.Net.Primitives.Functional.Tests
    System.Net.Primitives.Functional.Tests.SocketAddressTest.ToString_UnsupportedFamily_Throws(family: Packet)
    System.Net.Primitives.Functional.Tests.SocketAddressTest.ToString_UnsupportedFamily_Throws(family: ControllerAreaNetwork)
    
    System.Console.Tests
    CancelKeyPressTests.CanAddAndRemoveHandler
    ReadAndWrite.OutputEncodingPreamble
    ReadAndWrite.ReadAndReadLine
    ReadAndWrite.OutputEncoding
    SetIn.SetInReadLine
    SetIn.SetInThrowsOnNull
    Color.RoundtrippingColor
    Color.RedirectedOutputDoesNotUseAnsiSequences
    Color.InvalidColors
    ConsoleEncoding.TestEncoding(inputString: \"This string has non ascii characters αßΓπΣσµ\")
    ConsoleEncoding.TestEncoding(inputString: \"\\xd800\")
    ConsoleEncoding.TestEncoding(inputString: \"This is Ascii string\")
    ConsoleEncoding.TestEncoding(inputString: \"This string has invalid surrogates \\xd800\\xd800\\xd\"...)
    ConsoleEncoding.TestEncoding(inputString: \"This is string have surrogates �\")
    ConsoleEncoding.TestValidEncodings
    SyncTextReader.ReadAsync
    SyncTextReader.ReadBlockAsync
    SyncTextReader.ReadLineAsync
    SyncTextReader.Read
    SyncTextReader.ReadToEnd
    SyncTextReader.ReadBlock
    SyncTextReader.Peek
    SyncTextReader.ReadToEndAsync
    TimeOut.OpenStandardXXX_ReadTimeOut
    TimeOut.OpenStandardXXX_WriteTimeOut
    TimeOut.OpenStandardXXX_CanTimeOut
    ThreadSafety.SetStandardXXXCanBeCalledConcurrently
    ThreadSafety.ReadMayBeCalledConcurrently
    ThreadSafety.OpenStandardXXXCanBeCalledConcurrently
    WindowAndCursorProps.GetCursorPosition_Invoke_ReturnsExpected
    WindowAndCursorProps.CursorVisible_SetUnixRedirected_Nop(value: False)
    WindowAndCursorProps.CursorVisible_SetUnixRedirected_Nop(value: True)
    WindowAndCursorProps.CursorTop_SetInvalid_ThrowsArgumentOutOfRangeException(value: -1)
    WindowAndCursorProps.CursorTop_SetInvalid_ThrowsArgumentOutOfRangeException(value: 32768)
    WindowAndCursorProps.CursorLeft_SetInvalid_ThrowsArgumentOutOfRangeException(value: 32768)
    WindowAndCursorProps.CursorLeft_SetInvalid_ThrowsArgumentOutOfRangeException(value: -1)
    WindowAndCursorProps.LargestWindowHeight_UnixGet_ReturnsExpected
    WindowAndCursorProps.WindowHeight_GetUnix_Success
    WindowAndCursorProps.WindowWidth_GetUnix_Success
    WindowAndCursorProps.BufferWidth_GetUnix_ReturnsWindowWidth
    WindowAndCursorProps.SetCursorPosition_Invoke_Success
    WindowAndCursorProps.CursorSize_GetUnix_ReturnsExpected
    WindowAndCursorProps.LargestWindowWidth_UnixGet_ReturnsExpected
    WindowAndCursorProps.BufferHeight_GetUnix_ReturnsWindowHeight
    WindowAndCursorProps.CursorTop_Set_GetReturnsExpected
    WindowAndCursorProps.CursorLeft_Set_GetReturnsExpected
    

    It can be helpful for annotating the unsupported APIs.

    All the respective APIs were processed so I'm closing this issue as resolved.

  8. ghost locked as resolved and limited conversation to collaborators on May 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-Metaos-androidtracking

Type

No type

Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions