kernel32/tests: Win9x doesn't change last error.

This commit is contained in:
Paul Vriens 2008-02-26 10:32:24 +01:00 committed by Alexandre Julliard
parent f9e5296c7d
commit ad697ecdc4
1 changed files with 12 additions and 6 deletions

View File

@ -59,22 +59,28 @@ static void test_GetVersionEx(void)
memset(&infoA,0,sizeof infoA);
ret = GetVersionExA(&infoA);
ok(!ret, "Expected GetVersionExA to fail\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
GetLastError() == 0xdeadbeef /* Win9x */,
"Expected ERROR_INSUFFICIENT_BUFFER or 0xdeadbeef (Win9x), got %d\n",
GetLastError());
SetLastError(0xdeadbeef);
infoA.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA) / 2;
ret = GetVersionExA(&infoA);
ok(!ret, "Expected GetVersionExA to fail\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
GetLastError() == 0xdeadbeef /* Win9x */,
"Expected ERROR_INSUFFICIENT_BUFFER or 0xdeadbeef (Win9x), got %d\n",
GetLastError());
SetLastError(0xdeadbeef);
infoA.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA) * 2;
ret = GetVersionExA(&infoA);
ok(!ret, "Expected GetVersionExA to fail\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER,
"Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError());
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER ||
GetLastError() == 0xdeadbeef /* Win9x */,
"Expected ERROR_INSUFFICIENT_BUFFER or 0xdeadbeef (Win9x), got %d\n",
GetLastError());
SetLastError(0xdeadbeef);
infoA.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);