[PATCH v2] kernel32/tests: Detect and handle a redirected stdin.

Zebediah Figura z.figura12 at gmail.com
Fri Nov 3 09:31:14 CDT 2017


On 11/03/2017 05:43 AM, Alex Henrie wrote:
> Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
> ---
> v2: Simply skip the tests if the input is redirected.
> ---
>   dlls/kernel32/tests/console.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
> index a14bc45034..926c052686 100644
> --- a/dlls/kernel32/tests/console.c
> +++ b/dlls/kernel32/tests/console.c
> @@ -2582,6 +2582,11 @@ static void test_ReadConsole(void)
>   
>       SetLastError(0xdeadbeef);
>       ret = GetFileSize(std_input, NULL);
> +    if (GetLastError() == 0xdeadbeef)
> +    {
> +        skip("stdin is redirected\n");
> +        return;
> +    }
>       ok(ret == INVALID_FILE_SIZE, "expected INVALID_FILE_SIZE, got %#x\n", ret);
>       ok(GetLastError() == ERROR_INVALID_HANDLE ||
>          GetLastError() == ERROR_INVALID_FUNCTION, /* Win 8, 10 */
> 

Couldn't we just skip those two tests? The others don't seem to fail 
under that circumstance.



More information about the wine-devel mailing list