user32/tests: Fix the clipboard format id vs. atom table checks.
One cannot assume that a random integer has zero chance of being a valid atom. Reenable the GlobalFindAtomA() check in a todo_wine. Signed-off-by: Francois Gouget <fgouget@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
33e2b134fa
commit
cf85253a9c
|
@ -391,29 +391,30 @@ static void test_RegisterClipboardFormatA(void)
|
|||
lstrcpyA(buf, "foo");
|
||||
SetLastError(0xdeadbeef);
|
||||
len = GetAtomNameA((ATOM)format_id, buf, ARRAY_SIZE(buf));
|
||||
ok(len == 0, "GetAtomNameA should fail\n");
|
||||
ok(GetLastError() == ERROR_INVALID_HANDLE, "err %d\n", GetLastError());
|
||||
ok(len == 0 || lstrcmpA(buf, "my_cool_clipboard_format") != 0,
|
||||
"format_id should not be a valid local atom\n");
|
||||
ok(len != 0 || GetLastError() == ERROR_INVALID_HANDLE,
|
||||
"err %d\n", GetLastError());
|
||||
|
||||
todo_wine
|
||||
{
|
||||
lstrcpyA(buf, "foo");
|
||||
SetLastError(0xdeadbeef);
|
||||
len = GlobalGetAtomNameA((ATOM)format_id, buf, ARRAY_SIZE(buf));
|
||||
ok(len == 0, "GlobalGetAtomNameA should fail\n");
|
||||
ok(GetLastError() == ERROR_INVALID_HANDLE, "err %d\n", GetLastError());
|
||||
}
|
||||
todo_wine ok(len == 0 || lstrcmpA(buf, "my_cool_clipboard_format") != 0,
|
||||
"format_id should not be a valid global atom\n");
|
||||
ok(len != 0 || GetLastError() == ERROR_INVALID_HANDLE,
|
||||
"err %d\n", GetLastError());
|
||||
|
||||
SetLastError(0xdeadbeef);
|
||||
atom_id = FindAtomA("my_cool_clipboard_format");
|
||||
ok(atom_id == 0, "FindAtomA should fail\n");
|
||||
ok(atom_id == 0, "FindAtomA should fail, but it returned %x (format_id=%x)\n", atom_id, format_id);
|
||||
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "err %d\n", GetLastError());
|
||||
|
||||
if (0)
|
||||
todo_wine
|
||||
{
|
||||
/* this relies on the clipboard and global atom table being different */
|
||||
SetLastError(0xdeadbeef);
|
||||
atom_id = GlobalFindAtomA("my_cool_clipboard_format");
|
||||
ok(atom_id == 0, "GlobalFindAtomA should fail\n");
|
||||
ok(atom_id == 0, "GlobalFindAtomA should fail, but it returned %x (format_id=%x)\n", atom_id, format_id);
|
||||
ok(GetLastError() == ERROR_FILE_NOT_FOUND, "err %d\n", GetLastError());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue