Skip to content

Console.CursorLeft, Console.CursorTop, Console.WindowWidth, Console.WindowHeight and Console.WindowTopLeft doesn't throw an IOException for invalid values on Windows 7 x86 when Input is redirected #43138

Closed as not planned

Description

@ViktorHofer

Happening when input/output is redirected for the in the title noted properties.

Example:

Assert.Throws() Failure
Expected: typeof(System.IO.IOException)
Actual:   typeof(System.ArgumentOutOfRangeException): Positive number required. (Parameter 'width')
Actual value was -1.
---- System.ArgumentOutOfRangeException : Positive number required. (Parameter 'width')
Actual value was -1.

Currently affected tests:

  • WindowAndCursorProps.WindowAndCursorProps.WindowWidth_SetInvalid_ThrowsArgumentOutOfRangeException
  • WindowAndCursorProps.WindowAndCursorProps.CursorLeft_SetInvalid_ThrowsArgumentOutOfRangeException
  • WindowAndCursorProps.WindowAndCursorProps.WindowHeight_SetInvalid_ThrowsArgumentOutOfRangeException
  • WindowAndCursorProps.WindowAndCursorProps.CursorTop_SetInvalid_ThrowsArgumentOutOfRangeException
  • WindowAndCursorProps.WindowAndCursorProps.WindowLeftTop_Windows

It looks like the underlying Win32 API doesn't throw the getter of these properties is accessed during the set of the properties.

cc @eiriktsarpalis @stephentoub

Activity

  1. added
    untriaged
    on Oct 7, 2020
  2. eiriktsarpalis commented on Oct 13, 2020

    @eiriktsarpalis
    Member

    Related to #43015

  3. removed
    untriaged
    on Oct 29, 2020
  4. added this to the Future milestone on Oct 29, 2020
  5. adamsitnik commented on Jul 7, 2022

    @adamsitnik
    Member
  6. ghost locked as resolved and limited conversation to collaborators on Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions