Dmitry Timoshkov : kernel32/tests: Add 0-length read tests for a mailslot.
Alexandre Julliard
julliard at winehq.org
Fri Sep 20 14:21:30 CDT 2013
Module: wine
Branch: master
Commit: 0c024503dbf22310cc276f6e197d6ba614079138
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0c024503dbf22310cc276f6e197d6ba614079138
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Wed Sep 18 15:53:50 2013 +0900
kernel32/tests: Add 0-length read tests for a mailslot.
---
dlls/kernel32/tests/mailslot.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/dlls/kernel32/tests/mailslot.c b/dlls/kernel32/tests/mailslot.c
index fb3ec34..ca0b108 100644
--- a/dlls/kernel32/tests/mailslot.c
+++ b/dlls/kernel32/tests/mailslot.c
@@ -77,6 +77,24 @@ static int mailslot_test(void)
ok( hSlot != INVALID_HANDLE_VALUE , "valid mailslot failed\n");
/* try and read/write to it */
+ count = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = ReadFile(INVALID_HANDLE_VALUE, buffer, 0, &count, NULL);
+todo_wine
+ ok(!ret, "ReadFile should fail\n");
+todo_wine
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "wrong error %u\n", GetLastError());
+ ok(count == 0, "expected 0, got %u\n", count);
+
+ count = 0xdeadbeef;
+ SetLastError(0xdeadbeef);
+ ret = ReadFile(hSlot, buffer, 0, &count, NULL);
+todo_wine
+ ok(!ret, "ReadFile should fail\n");
+todo_wine
+ ok(GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError());
+ ok(count == 0, "expected 0, got %u\n", count);
+
count = 0;
memset(buffer, 0, sizeof buffer);
ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL);
More information about the wine-cvs
mailing list