Akihiro Sagawa : kernel32/tests: Add more tests for WriteConsole.
Alexandre Julliard
julliard at winehq.org
Fri Mar 9 12:34:18 CST 2012
Module: wine
Branch: master
Commit: e4692b3f6681799fb41749cd36151734cea81c88
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e4692b3f6681799fb41749cd36151734cea81c88
Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date: Tue Mar 6 22:51:57 2012 +0900
kernel32/tests: Add more tests for WriteConsole.
---
dlls/kernel32/tests/console.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c
index 7eea5d9..d0c58f8 100644
--- a/dlls/kernel32/tests/console.c
+++ b/dlls/kernel32/tests/console.c
@@ -780,6 +780,28 @@ static void testScreenBuffer(HANDLE hConOut)
"GetLastError: expecting %u got %u\n",
ERROR_INVALID_HANDLE, GetLastError());
+ /* trying to write non-console handle */
+ SetLastError(0xdeadbeef);
+ ok(!WriteConsoleA(hFileOutRW, test_str1, lstrlenA(test_str1), &len, NULL),
+ "Shouldn't succeed\n");
+ ok(GetLastError() == ERROR_INVALID_HANDLE,
+ "GetLastError: expecting %u got %u\n",
+ ERROR_INVALID_HANDLE, GetLastError());
+
+ SetLastError(0xdeadbeef);
+ ok(!WriteConsoleA(hFileOutRO, test_str1, lstrlenA(test_str1), &len, NULL),
+ "Shouldn't succeed\n");
+ ok(GetLastError() == ERROR_INVALID_HANDLE,
+ "GetLastError: expecting %u got %u\n",
+ ERROR_INVALID_HANDLE, GetLastError());
+
+ SetLastError(0xdeadbeef);
+ ok(!WriteConsoleA(hFileOutWT, test_str1, lstrlenA(test_str1), &len, NULL),
+ "Shouldn't succeed\n");
+ todo_wine ok(GetLastError() == ERROR_INVALID_HANDLE,
+ "GetLastError: expecting %u got %u\n",
+ ERROR_INVALID_HANDLE, GetLastError());
+
CloseHandle(hFileOutRW);
CloseHandle(hFileOutRO);
CloseHandle(hFileOutWT);
More information about the wine-cvs
mailing list