Commit 1c61a53e authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

kernel32/tests: Don't test last error on success.

parent 460991a8
......@@ -1152,22 +1152,13 @@ static void test_OpenConsoleW(void)
CloseHandle(ret);
}
/* OpenConsoleW should not touch the last error on success. */
SetLastError(0xdeadbeef);
ret = pOpenConsoleW(coninW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_EXISTING);
ok(ret != INVALID_HANDLE_VALUE,
"Expected OpenConsoleW to return a valid handle\n");
ok(GetLastError() == 0xdeadbeef,
"Expected the last error to be untouched, got %u\n", GetLastError());
ok(ret != INVALID_HANDLE_VALUE, "Expected OpenConsoleW to return a valid handle\n");
if (ret != INVALID_HANDLE_VALUE)
CloseHandle(ret);
SetLastError(0xdeadbeef);
ret = pOpenConsoleW(conoutW, GENERIC_READ | GENERIC_WRITE, FALSE, OPEN_EXISTING);
ok(ret != INVALID_HANDLE_VALUE,
"Expected OpenConsoleW to return a valid handle\n");
ok(GetLastError() == 0xdeadbeef,
"Expected the last error to be untouched, got %u\n", GetLastError());
ok(ret != INVALID_HANDLE_VALUE, "Expected OpenConsoleW to return a valid handle\n");
if (ret != INVALID_HANDLE_VALUE)
CloseHandle(ret);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment