kernel32/tests: Fix version tests compilation with __WINESRC__ defined.

This commit is contained in:
Dmitry Timoshkov 2013-10-21 17:02:57 +09:00 committed by Alexandre Julliard
parent 965d903f33
commit 7dab5fe998
1 changed files with 25 additions and 25 deletions

View File

@ -156,7 +156,7 @@ static void test_GetVersionEx(void)
static void test_VerifyVersionInfo(void) static void test_VerifyVersionInfo(void)
{ {
OSVERSIONINFOEX info; OSVERSIONINFOEXA info;
BOOL ret; BOOL ret;
DWORD servicepack, error; DWORD servicepack, error;
@ -169,8 +169,8 @@ static void test_VerifyVersionInfo(void)
/* Before we start doing some tests we should check what the version of /* Before we start doing some tests we should check what the version of
* the ServicePack is. Tests on a box with no ServicePack will fail otherwise. * the ServicePack is. Tests on a box with no ServicePack will fail otherwise.
*/ */
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
GetVersionExA((OSVERSIONINFO *)&info); GetVersionExA((OSVERSIONINFOA *)&info);
servicepack = info.wServicePackMajor; servicepack = info.wServicePackMajor;
memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
@ -223,8 +223,8 @@ static void test_VerifyVersionInfo(void)
VER_MAJORVERSION, VER_GREATER_EQUAL)); VER_MAJORVERSION, VER_GREATER_EQUAL));
ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError()); ok(ret, "VerifyVersionInfoA failed with error %d\n", GetLastError());
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
GetVersionEx((OSVERSIONINFO *)&info); GetVersionExA((OSVERSIONINFOA *)&info);
info.wServicePackMinor++; info.wServicePackMinor++;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
@ -240,37 +240,37 @@ static void test_VerifyVersionInfo(void)
} }
else else
{ {
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
GetVersionEx((OSVERSIONINFO *)&info); GetVersionExA((OSVERSIONINFOA *)&info);
info.wServicePackMajor--; info.wServicePackMajor--;
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER)); pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER));
ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError()); ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError());
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
GetVersionEx((OSVERSIONINFO *)&info); GetVersionExA((OSVERSIONINFOA *)&info);
info.wServicePackMajor--; info.wServicePackMajor--;
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL)); pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL));
ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError()); ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError());
} }
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
GetVersionEx((OSVERSIONINFO *)&info); GetVersionExA((OSVERSIONINFOA *)&info);
info.wServicePackMajor++; info.wServicePackMajor++;
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
pVerSetConditionMask(0, VER_MINORVERSION, VER_LESS)); pVerSetConditionMask(0, VER_MINORVERSION, VER_LESS));
ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError()); ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError());
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
GetVersionEx((OSVERSIONINFO *)&info); GetVersionExA((OSVERSIONINFOA *)&info);
info.wServicePackMajor++; info.wServicePackMajor++;
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
pVerSetConditionMask(0, VER_MINORVERSION, VER_LESS_EQUAL)); pVerSetConditionMask(0, VER_MINORVERSION, VER_LESS_EQUAL));
ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError()); ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError());
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
GetVersionEx((OSVERSIONINFO *)&info); GetVersionExA((OSVERSIONINFOA *)&info);
info.wServicePackMajor--; info.wServicePackMajor--;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
@ -282,8 +282,8 @@ static void test_VerifyVersionInfo(void)
/* test the failure hierarchy for the four version fields */ /* test the failure hierarchy for the four version fields */
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
GetVersionEx((OSVERSIONINFO *)&info); GetVersionExA((OSVERSIONINFOA *)&info);
info.wServicePackMajor++; info.wServicePackMajor++;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
@ -293,8 +293,8 @@ static void test_VerifyVersionInfo(void)
ok(error == ERROR_OLD_WIN_VERSION || broken(error == ERROR_BAD_ARGUMENTS) /* some win2k */, ok(error == ERROR_OLD_WIN_VERSION || broken(error == ERROR_BAD_ARGUMENTS) /* some win2k */,
"VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %d\n", error); "VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %d\n", error);
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
GetVersionEx((OSVERSIONINFO *)&info); GetVersionExA((OSVERSIONINFOA *)&info);
info.dwMinorVersion++; info.dwMinorVersion++;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, ret = pVerifyVersionInfoA(&info, VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
@ -304,8 +304,8 @@ static void test_VerifyVersionInfo(void)
ok(error == ERROR_OLD_WIN_VERSION || broken(error == ERROR_BAD_ARGUMENTS) /* some win2k */, ok(error == ERROR_OLD_WIN_VERSION || broken(error == ERROR_BAD_ARGUMENTS) /* some win2k */,
"VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %d\n", error); "VerifyVersionInfoA should have failed with ERROR_OLD_WIN_VERSION instead of %d\n", error);
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
GetVersionEx((OSVERSIONINFO *)&info); GetVersionExA((OSVERSIONINFOA *)&info);
info.dwMajorVersion++; info.dwMajorVersion++;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
@ -319,8 +319,8 @@ static void test_VerifyVersionInfo(void)
pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL)); pVerSetConditionMask(0, VER_MINORVERSION, VER_GREATER_EQUAL));
ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError()); ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError());
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
GetVersionEx((OSVERSIONINFO *)&info); GetVersionExA((OSVERSIONINFOA *)&info);
info.dwBuildNumber++; info.dwBuildNumber++;
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
@ -335,8 +335,8 @@ static void test_VerifyVersionInfo(void)
ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError()); ok(ret || broken(!ret) /* some win2k */, "VerifyVersionInfoA failed with error %d\n", GetLastError());
/* test bad dwOSVersionInfoSize */ /* test bad dwOSVersionInfoSize */
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXA);
GetVersionEx((OSVERSIONINFO *)&info); GetVersionExA((OSVERSIONINFOA *)&info);
info.dwOSVersionInfoSize = 0; info.dwOSVersionInfoSize = 0;
ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR, ret = pVerifyVersionInfoA(&info, VER_MAJORVERSION | VER_MINORVERSION | VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR,
pVerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL)); pVerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL));