mirror of
https://github.com/reactos/reactos.git
synced 2025-08-11 13:35:33 +00:00
[USER32_APITESTS]
- Add some test for DestroyCursor/DestroyIcon svn path=/trunk/; revision=57647
This commit is contained in:
parent
9aec2fb369
commit
a74a3edcc7
2 changed files with 50 additions and 0 deletions
|
@ -3,6 +3,7 @@ list(APPEND SOURCE
|
||||||
AttachThreadInput.c
|
AttachThreadInput.c
|
||||||
helper.c
|
helper.c
|
||||||
DeferWindowPos.c
|
DeferWindowPos.c
|
||||||
|
DestroyCursorIcon.c
|
||||||
desktop.c
|
desktop.c
|
||||||
GetIconInfo.c
|
GetIconInfo.c
|
||||||
GetKeyState.c
|
GetKeyState.c
|
||||||
|
|
49
rostests/apitests/user32/DestroyCursorIcon.c
Normal file
49
rostests/apitests/user32/DestroyCursorIcon.c
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <wine/test.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#include "resource.h"
|
||||||
|
|
||||||
|
START_TEST(DestroyCursorIcon)
|
||||||
|
{
|
||||||
|
HICON hicon;
|
||||||
|
HCURSOR hcursor;
|
||||||
|
ICONINFO iconinfo;
|
||||||
|
|
||||||
|
ZeroMemory(&iconinfo, sizeof(iconinfo));
|
||||||
|
|
||||||
|
iconinfo.hbmMask = CreateBitmap(8, 16, 1, 1, NULL);
|
||||||
|
ok(iconinfo.hbmMask != NULL, "\n");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Test if DestroyCursor can destroy an icon, and vice-versa .
|
||||||
|
* It can.
|
||||||
|
*/
|
||||||
|
iconinfo.fIcon = TRUE;
|
||||||
|
hicon = CreateIconIndirect(&iconinfo);
|
||||||
|
ok(hicon != 0, "should not fail\n");
|
||||||
|
ok(DestroyCursor(hicon), "\n");
|
||||||
|
ok(!DestroyIcon(hicon), "\n");
|
||||||
|
|
||||||
|
iconinfo.fIcon = FALSE;
|
||||||
|
hcursor = CreateIconIndirect(&iconinfo);
|
||||||
|
ok(hcursor != 0, "should not fail\n");
|
||||||
|
ok(DestroyIcon(hcursor), "\n");
|
||||||
|
ok(!DestroyCursor(hcursor), "\n");
|
||||||
|
|
||||||
|
/* Clean up */
|
||||||
|
DeleteObject(iconinfo.hbmMask);
|
||||||
|
|
||||||
|
/* Now check its behaviour regarding Shared icons/cursors */
|
||||||
|
hcursor = LoadCursor(GetModuleHandle(NULL), "TESTCURSOR");
|
||||||
|
ok(hcursor != 0, "\n");
|
||||||
|
|
||||||
|
/* MSDN says we shouldn't do that, but it still succeeds */
|
||||||
|
ok(DestroyCursor(hcursor), "\n");
|
||||||
|
|
||||||
|
/* In fact, it's still there */
|
||||||
|
ok(GetIconInfo(hcursor, &iconinfo), "\n");
|
||||||
|
|
||||||
|
/* clean up */
|
||||||
|
DeleteObject(iconinfo.hbmMask);
|
||||||
|
DeleteObject(iconinfo.hbmColor);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue