user32/tests: Fix some tests on Win9x.

This commit is contained in:
Alexandre Julliard 2008-07-30 13:50:00 +02:00
parent 24b0296017
commit ba644e9c31
2 changed files with 17 additions and 5 deletions

View File

@ -896,7 +896,8 @@ static void test_GetDlgItemText(void)
ret = GetDlgItemTextA(NULL, 0, string, sizeof(string)/sizeof(string[0]));
ok(!ret, "GetDlgItemText(NULL) shouldn't have succeeded\n");
ok(string[0] == '\0', "string retrieved using GetDlgItemText should have been NULL terminated\n");
ok(string[0] == '\0' || broken(!strcmp(string, "Overwrite Me")),
"string retrieved using GetDlgItemText should have been NULL terminated\n");
}
static void test_DialogBoxParamA(void)
@ -906,12 +907,16 @@ static void test_DialogBoxParamA(void)
SetLastError(0xdeadbeef);
ret = DialogBoxParamA(GetModuleHandle(NULL), "IDD_DIALOG" , hwnd_invalid, 0 , 0);
ok(0 == ret, "DialogBoxParamA returned %d, expected 0\n", ret);
ok(ERROR_INVALID_WINDOW_HANDLE == GetLastError(),"got %d, expected ERROR_INVALID_WINDOW_HANDLE\n",GetLastError());
ok(0 == ret || broken(ret == -1), "DialogBoxParamA returned %d, expected 0\n", ret);
ok(ERROR_INVALID_WINDOW_HANDLE == GetLastError() ||
broken(GetLastError() == 0xdeadbeef),
"got %d, expected ERROR_INVALID_WINDOW_HANDLE\n",GetLastError());
SetLastError(0xdeadbeef);
ret = DialogBoxParamA(GetModuleHandle(NULL), "RESOURCE_INVALID" , 0, 0, 0);
ok(-1 == ret, "DialogBoxParamA returned %d, expected -1\n", ret);
ok(ERROR_RESOURCE_NAME_NOT_FOUND == GetLastError(),"got %d, expected ERROR_RESOURCE_NAME_NOT_FOUND\n",GetLastError());
ok(ERROR_RESOURCE_NAME_NOT_FOUND == GetLastError() ||
broken(GetLastError() == 0xdeadbeef),
"got %d, expected ERROR_RESOURCE_NAME_NOT_FOUND\n",GetLastError());
}
static void test_DisabledDialogTest(void)

View File

@ -40,7 +40,13 @@ static void test_LoadStringW(void)
/* Check that the string which is returned by LoadStringW matches
the string at the pointer returned by LoadStringW when called with buflen = 0 */
SetLastError(0xdeadbeef);
length1 = LoadStringW(hInst, 2, (WCHAR *) &resourcepointer, 0); /* get pointer to resource. */
if (!length1 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
win_skip( "LoadStringW not implemented\n" );
return;
}
length2 = LoadStringW(hInst, 2, returnedstringw, sizeof(returnedstringw) /sizeof(WCHAR)); /* get resource string */
ok(length2 > 0, "LoadStringW failed to load resource 2, ret %d, err %d\n", length2, GetLastError());
ok(length1 == length2, "LoadStringW returned different values dependent on buflen. ret1 %d, ret2 %d\n",
@ -114,7 +120,8 @@ static void test_LoadStringA (void)
"LoadString failed: ret %d err %d\n", ret, GetLastError());
ret = LoadStringA(hInst, 0, buf, 0);
ok( ret == -1, "LoadStringA did not return -1 when called with buflen = 0, got %d, err %d\n",
ok( ret == -1 || broken(ret == 0),
"LoadStringA did not return -1 when called with buflen = 0, got %d, err %d\n",
ret, GetLastError());
}