Nikolay Sivov : kernel32/tests: Don't test last error when there' s no failure.
Alexandre Julliard
julliard at winehq.org
Wed Feb 12 13:44:38 CST 2014
Module: wine
Branch: master
Commit: ee518b5e3611bfa106d36e98aa250e251e4d50e7
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ee518b5e3611bfa106d36e98aa250e251e4d50e7
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Wed Feb 12 08:27:24 2014 +0400
kernel32/tests: Don't test last error when there's no failure.
---
dlls/kernel32/tests/codepage.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/dlls/kernel32/tests/codepage.c b/dlls/kernel32/tests/codepage.c
index a269c7e..8423c75 100644
--- a/dlls/kernel32/tests/codepage.c
+++ b/dlls/kernel32/tests/codepage.c
@@ -546,32 +546,22 @@ static void test_threadcp(void)
SetLastError(0xdeadbeef);
memset(&cpi, 0, sizeof(cpi));
ret = GetCPInfoExA(CP_ACP, 0, &cpi);
- ok(ret, "GetCPInfoExA failed for lcid %04x\n", lcids[i].lcid);
- ok(GetLastError() == 0xdeadbeef ||
- broken(GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND), /* win2k */
- "GetLastError() is %u for lcid %04x\n", GetLastError(), lcids[i].lcid);
+ ok(ret, "GetCPInfoExA failed for lcid %04x, error %d\n", lcids[i].lcid, GetLastError());
ok(cpi.CodePage == acp, "wrong codepage %u for lcid %04x, should be %u\n", cpi.CodePage, lcids[i].lcid, acp);
/* WideCharToMultiByte - CP_ACP */
- SetLastError(0xdeadbeef);
num = WideCharToMultiByte(CP_ACP, 0, foobarW, -1, NULL, 0, NULL, NULL);
ok(num == 7, "ret is %d (%04x)\n", num, lcids[i].lcid);
- ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u (%04x)\n", GetLastError(), lcids[i].lcid);
/* MultiByteToWideChar - CP_ACP */
- SetLastError(0xdeadbeef);
num = MultiByteToWideChar(CP_ACP, 0, "foobar", -1, NULL, 0);
ok(num == 7, "ret is %d (%04x)\n", num, lcids[i].lcid);
- ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u (%04x)\n", GetLastError(), lcids[i].lcid);
/* GetCPInfoEx/GetCPInfo - CP_THREAD_ACP */
SetLastError(0xdeadbeef);
memset(&cpi, 0, sizeof(cpi));
ret = GetCPInfoExA(CP_THREAD_ACP, 0, &cpi);
- ok(ret, "GetCPInfoExA failed for lcid %04x\n", lcids[i].lcid);
- ok(GetLastError() == 0xdeadbeef ||
- broken(GetLastError() == ERROR_RESOURCE_LANG_NOT_FOUND), /* win2k */
- "GetLastError() is %u for lcid %04x\n", GetLastError(), lcids[i].lcid);
+ ok(ret, "GetCPInfoExA failed for lcid %04x, error %d\n", lcids[i].lcid, GetLastError());
if (lcids[i].threadcp)
ok(cpi.CodePage == lcids[i].threadcp, "wrong codepage %u for lcid %04x, should be %u\n",
cpi.CodePage, lcids[i].lcid, lcids[i].threadcp);
@@ -580,16 +570,12 @@ static void test_threadcp(void)
cpi.CodePage, lcids[i].lcid, acp);
/* WideCharToMultiByte - CP_THREAD_ACP */
- SetLastError(0xdeadbeef);
num = WideCharToMultiByte(CP_THREAD_ACP, 0, foobarW, -1, NULL, 0, NULL, NULL);
ok(num == 7, "ret is %d (%04x)\n", num, lcids[i].lcid);
- ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u (%04x)\n", GetLastError(), lcids[i].lcid);
/* MultiByteToWideChar - CP_THREAD_ACP */
- SetLastError(0xdeadbeef);
num = MultiByteToWideChar(CP_THREAD_ACP, 0, "foobar", -1, NULL, 0);
ok(num == 7, "ret is %d (%04x)\n", num, lcids[i].lcid);
- ok(GetLastError() == 0xdeadbeef, "GetLastError() is %u (%04x)\n", GetLastError(), lcids[i].lcid);
}
/* IsDBCSLeadByteEx - locales without codepage */
More information about the wine-cvs
mailing list