Sebastian Lackner : kernel32/tests: Add tests for calling WriteFile on pipe when other end is closed.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Nov 23 09:59:46 CST 2015
Module: wine
Branch: master
Commit: 78948b24b72aeb6c5b33e2630ccb817097829251
URL: http://source.winehq.org/git/wine.git/?a=commit;h=78948b24b72aeb6c5b33e2630ccb817097829251
Author: Sebastian Lackner <sebastian at fds-team.de>
Date: Mon Nov 23 07:23:04 2015 +0100
kernel32/tests: Add tests for calling WriteFile on pipe when other end is closed.
Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/tests/pipe.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c
index 4f1b238..1095279 100644
--- a/dlls/kernel32/tests/pipe.c
+++ b/dlls/kernel32/tests/pipe.c
@@ -1430,6 +1430,11 @@ static void test_CloseHandle(void)
ok(!ret, "ReadFile unexpectedly succeeded\n");
ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %u\n", GetLastError());
+ SetLastError(0xdeadbeef);
+ ret = WriteFile(hfile, testdata, sizeof(testdata), &numbytes, NULL);
+ ok(!ret, "WriteFile unexpectedly succeeded\n");
+ todo_wine ok(GetLastError() == ERROR_NO_DATA, "expected ERROR_NO_DATA, got %u\n", GetLastError());
+
CloseHandle(hfile);
hpipe = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX,
@@ -1459,6 +1464,11 @@ static void test_CloseHandle(void)
ok(!ret, "ReadFile unexpectedly succeeded\n");
todo_wine ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %u\n", GetLastError());
+ SetLastError(0xdeadbeef);
+ ret = WriteFile(hfile, testdata, sizeof(testdata), &numbytes, NULL);
+ ok(!ret, "WriteFile unexpectedly succeeded\n");
+ todo_wine ok(GetLastError() == ERROR_NO_DATA, "expected ERROR_NO_DATA, got %u\n", GetLastError());
+
CloseHandle(hfile);
/* repeat test with hpipe <-> hfile swapped */
@@ -1502,6 +1512,11 @@ static void test_CloseHandle(void)
ok(!ret, "ReadFile unexpectedly succeeded\n");
ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %u\n", GetLastError());
+ SetLastError(0xdeadbeef);
+ ret = WriteFile(hpipe, testdata, sizeof(testdata), &numbytes, NULL);
+ ok(!ret, "WriteFile unexpectedly succeeded\n");
+ todo_wine ok(GetLastError() == ERROR_NO_DATA, "expected ERROR_NO_DATA, got %u\n", GetLastError());
+
CloseHandle(hpipe);
hpipe = CreateNamedPipeA(PIPENAME, PIPE_ACCESS_DUPLEX,
@@ -1531,6 +1546,11 @@ static void test_CloseHandle(void)
ok(!ret, "ReadFile unexpectedly succeeded\n");
ok(GetLastError() == ERROR_BROKEN_PIPE, "expected ERROR_BROKEN_PIPE, got %u\n", GetLastError());
+ SetLastError(0xdeadbeef);
+ ret = WriteFile(hpipe, testdata, sizeof(testdata), &numbytes, NULL);
+ ok(!ret, "WriteFile unexpectedly succeeded\n");
+ todo_wine ok(GetLastError() == ERROR_NO_DATA, "expected ERROR_NO_DATA, got %u\n", GetLastError());
+
CloseHandle(hpipe);
}
More information about the wine-cvs
mailing list