Module: wine Branch: master Commit: 3ba2b5898cf9c78f81afc1fd620e5046a3392be0 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3ba2b5898cf9c78f81afc1fd62...
Author: Jacek Caban jacek@codeweavers.com Date: Thu Jan 19 18:17:15 2017 +0100
kernel32/tests: Improved pipe CloseHandle tests.
Current tests suggest that SetNamedPipeHandleState between ReadFile calls makes a difference (and it doesn't).
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/kernel32/tests/pipe.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index b9ac06c..33440bf 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -1473,6 +1473,11 @@ static void test_CloseHandle(void) todo_wine ok(ret, "ReadFile failed with %u\n", GetLastError()); ok(numbytes == 0, "expected 0, got %u\n", numbytes);
+ SetLastError(0xdeadbeef); + ret = ReadFile(hfile, buffer, 0, &numbytes, NULL); + ok(!ret, "ReadFile unexpectedly succeeded\n"); + todo_wine ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %u\n", GetLastError()); + ret = GetNamedPipeHandleStateA(hfile, &state, NULL, NULL, NULL, NULL, 0); ok(ret, "GetNamedPipeHandleState failed with %u\n", GetLastError()); state = PIPE_READMODE_MESSAGE | PIPE_WAIT; @@ -1567,6 +1572,11 @@ static void test_CloseHandle(void) todo_wine ok(ret, "ReadFile failed with %u\n", GetLastError()); ok(numbytes == 0, "expected 0, got %u\n", numbytes);
+ SetLastError(0xdeadbeef); + ret = ReadFile(hpipe, buffer, 0, &numbytes, NULL); + ok(!ret, "ReadFile unexpectedly succeeded\n"); + ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %u\n", GetLastError()); + ret = GetNamedPipeHandleStateA(hpipe, &state, NULL, NULL, NULL, NULL, 0); ok(ret, "GetNamedPipeHandleState failed with %u\n", GetLastError()); state = PIPE_READMODE_MESSAGE | PIPE_WAIT;