Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
1aab7ea8
Commit
1aab7ea8
authored
Oct 13, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Add more tests for DestroyCursor on the active cursor.
parent
e54d9afb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
16 deletions
+78
-16
cursoricon.c
dlls/user32/tests/cursoricon.c
+78
-16
No files found.
dlls/user32/tests/cursoricon.c
View file @
1aab7ea8
...
...
@@ -1731,8 +1731,8 @@ static void test_ShowCursor(void)
static
void
test_DestroyCursor
(
void
)
{
static
const
BYTE
bmp_bits
[
4096
];
ICONINFO
cursorInfo
;
HCURSOR
cursor
,
cursor2
;
ICONINFO
cursorInfo
,
new_info
;
HCURSOR
cursor
,
cursor2
,
new_cursor
;
BOOL
ret
;
DWORD
error
;
UINT
display_bpp
;
...
...
@@ -1760,23 +1760,85 @@ static void test_DestroyCursor(void)
ok
(
!
ret
||
broken
(
ret
)
/* succeeds on win9x */
,
"DestroyCursor on the active cursor succeeded
\n
"
);
error
=
GetLastError
();
ok
(
error
==
0xdeadbeef
,
"Last error: %u
\n
"
,
error
);
if
(
!
ret
)
new_cursor
=
GetCursor
();
if
(
ret
)
/* win9x replaces cursor by another one on destroy */
ok
(
new_cursor
!=
cursor
,
"GetCursor returned %p/%p
\n
"
,
new_cursor
,
cursor
);
else
ok
(
new_cursor
==
cursor
,
"GetCursor returned %p/%p
\n
"
,
new_cursor
,
cursor
);
SetLastError
(
0xdeadbeef
);
ret
=
GetIconInfo
(
cursor
,
&
new_info
);
todo_wine
ok
(
!
ret
||
broken
(
ret
),
/* nt4 */
"GetIconInfo succeeded
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_INVALID_CURSOR_HANDLE
||
broken
(
GetLastError
()
==
0xdeadbeef
),
/* win9x */
"wrong error %u
\n
"
,
GetLastError
()
);
if
(
ret
)
/* nt4 delays destruction until cursor changes */
{
cursor2
=
GetCursor
();
ok
(
cursor2
==
cursor
,
"Active was set to %p when trying to destroy it
\n
"
,
cursor2
);
SetCursor
(
NULL
);
/* Trying to destroy the cursor properly fails now with
* ERROR_INVALID_CURSOR_HANDLE. This happens because we called
* DestroyCursor() 2+ times after calling SetCursor(). The calls to
* GetCursor() and SetCursor(NULL) in between make no difference. */
DeleteObject
(
new_info
.
hbmColor
);
DeleteObject
(
new_info
.
hbmMask
);
SetLastError
(
0xdeadbeef
);
ret
=
DestroyCursor
(
cursor
);
todo_wine
ok
(
!
ret
,
"DestroyCursor succeeded.
\n
"
);
error
=
GetLastError
();
ok
(
error
==
ERROR_INVALID_CURSOR_HANDLE
||
error
==
0xdeadbeef
,
/* vista */
"Last error: 0x%08x
\n
"
,
error
);
ret
=
DestroyCursor
(
cursor
);
ok
(
!
ret
,
"DestroyCursor succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_CURSOR_HANDLE
||
GetLastError
()
==
0xdeadbeef
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
cursor2
=
SetCursor
(
cursor
);
ok
(
cursor2
==
cursor
,
"SetCursor returned %p/%p
\n
"
,
cursor2
,
cursor
);
ok
(
GetLastError
()
==
ERROR_INVALID_CURSOR_HANDLE
||
GetLastError
()
==
0xdeadbeef
,
"wrong error %u
\n
"
,
GetLastError
()
);
}
else
{
SetLastError
(
0xdeadbeef
);
cursor2
=
CopyCursor
(
cursor
);
ok
(
!
cursor2
,
"CopyCursor succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_CURSOR_HANDLE
||
broken
(
GetLastError
()
==
0xdeadbeef
),
/* win9x */
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
ret
=
DestroyCursor
(
cursor
);
if
(
new_cursor
!=
cursor
)
/* win9x */
ok
(
ret
,
"DestroyCursor succeeded
\n
"
);
else
ok
(
!
ret
,
"DestroyCursor succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_CURSOR_HANDLE
||
GetLastError
()
==
0xdeadbeef
,
"wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
cursor2
=
SetCursor
(
cursor
);
ok
(
!
cursor2
,
"SetCursor returned %p/%p
\n
"
,
cursor2
,
cursor
);
ok
(
GetLastError
()
==
ERROR_INVALID_CURSOR_HANDLE
||
GetLastError
()
==
0xdeadbeef
,
"wrong error %u
\n
"
,
GetLastError
()
);
}
cursor2
=
GetCursor
();
ok
(
cursor2
==
new_cursor
,
"GetCursor returned %p/%p
\n
"
,
cursor2
,
new_cursor
);
SetLastError
(
0xdeadbeef
);
cursor2
=
SetCursor
(
0
);
if
(
new_cursor
!=
cursor
)
/* win9x */
ok
(
cursor2
==
new_cursor
,
"SetCursor returned %p/%p
\n
"
,
cursor2
,
cursor
);
else
todo_wine
ok
(
!
cursor2
,
"SetCursor returned %p/%p
\n
"
,
cursor2
,
cursor
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"wrong error %u
\n
"
,
GetLastError
()
);
cursor2
=
GetCursor
();
ok
(
!
cursor2
,
"GetCursor returned %p/%p
\n
"
,
cursor2
,
cursor
);
SetLastError
(
0xdeadbeef
);
ret
=
DestroyCursor
(
cursor
);
if
(
new_cursor
!=
cursor
)
/* win9x */
ok
(
ret
,
"DestroyCursor succeeded
\n
"
);
else
todo_wine
ok
(
!
ret
,
"DestroyCursor succeeded
\n
"
);
error
=
GetLastError
();
ok
(
GetLastError
()
==
ERROR_INVALID_CURSOR_HANDLE
||
GetLastError
()
==
0xdeadbeef
,
"wrong error %u
\n
"
,
GetLastError
()
);
DeleteObject
(
cursorInfo
.
hbmMask
);
DeleteObject
(
cursorInfo
.
hbmColor
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment