Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
1877ff01
Commit
1877ff01
authored
Nov 14, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Fix the resource tests for various Windows versions.
parent
e4d7d902
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
21 deletions
+35
-21
resource.c
dlls/user32/tests/resource.c
+35
-21
No files found.
dlls/user32/tests/resource.c
View file @
1877ff01
...
...
@@ -180,41 +180,43 @@ static void test_accel1(void)
ok
(
hAccel
!=
NULL
,
"create accelerator table
\n
"
);
r
=
CopyAcceleratorTable
(
hAccel
,
NULL
,
0
);
ok
(
r
==
n
,
"two entries in table
\n
"
);
ok
(
r
==
n
||
broken
(
r
==
2
),
/* win9x */
"two entries in table %u/%u
\n
"
,
r
,
n
);
r
=
CopyAcceleratorTable
(
hAccel
,
&
ac
[
0
],
r
);
ok
(
r
==
n
,
"still should be two entries in table
\n
"
);
r
=
CopyAcceleratorTable
(
hAccel
,
&
ac
[
0
],
n
);
ok
(
r
==
n
||
broken
(
r
==
2
),
/* win9x */
"still should be two entries in table %u/%u
\n
"
,
r
,
n
);
n
=
0
;
ok
(
ac
[
n
].
cmd
==
1000
,
"cmd 0 not preserved
\n
"
);
ok
(
ac
[
n
].
key
==
'A'
,
"key 0 not preserved
\n
"
);
ok
(
ac
[
n
].
fVirt
==
(
FVIRTKEY
|
FNOINVERT
),
"fVirt 0 not preserved
\n
"
);
n
++
;
if
(
++
n
==
r
)
goto
done
;
ok
(
ac
[
n
].
cmd
==
0xffff
,
"cmd 1 not preserved
\n
"
);
ok
(
ac
[
n
].
key
==
0xffff
,
"key 1 not preserved
\n
"
);
ok
(
ac
[
n
].
fVirt
==
0x007f
,
"fVirt 1 not changed
\n
"
);
n
++
;
if
(
++
n
==
r
)
goto
done
;
ok
(
ac
[
n
].
cmd
==
0xfff0
,
"cmd 2 not preserved
\n
"
);
ok
(
ac
[
n
].
key
==
0x00ff
,
"key 2 not preserved
\n
"
);
ok
(
ac
[
n
].
fVirt
==
0x0070
,
"fVirt 2 not changed
\n
"
);
n
++
;
if
(
++
n
==
r
)
goto
done
;
ok
(
ac
[
n
].
cmd
==
0xfff0
,
"cmd 3 not preserved
\n
"
);
ok
(
ac
[
n
].
key
==
0x00ff
,
"key 3 not preserved
\n
"
);
ok
(
ac
[
n
].
fVirt
==
0x0000
,
"fVirt 3 not changed
\n
"
);
n
++
;
if
(
++
n
==
r
)
goto
done
;
ok
(
ac
[
n
].
cmd
==
0xfff0
,
"cmd 4 not preserved
\n
"
);
ok
(
ac
[
n
].
key
==
0xffff
,
"key 4 not preserved
\n
"
);
ok
(
ac
[
n
].
fVirt
==
0x0001
,
"fVirt 4 not changed
\n
"
);
done:
r
=
DestroyAcceleratorTable
(
hAccel
);
ok
(
r
,
"destroy accelerator table
\n
"
);
hAccel
=
CreateAcceleratorTable
(
&
ac
[
0
],
0
);
ok
(
!
hAccel
,
"zero elements should fail
\n
"
);
ok
(
!
hAccel
||
broken
(
hAccel
!=
NULL
),
/* nt4 */
"zero elements should fail
\n
"
);
/* these will on crash win2k
hAccel = CreateAcceleratorTable( NULL, 1 );
...
...
@@ -230,6 +232,7 @@ static void test_accel2(void)
{
ACCEL
ac
[
2
],
out
[
2
];
HACCEL
hac
;
int
res
;
ac
[
0
].
cmd
=
0
;
ac
[
0
].
fVirt
=
0
;
...
...
@@ -246,8 +249,8 @@ static void test_accel2(void)
/* try a zero count */
hac
=
CreateAcceleratorTable
(
&
ac
[
0
],
0
);
ok
(
!
hac
,
"fail
\n
"
);
ok
(
!
DestroyAcceleratorTable
(
hac
),
"destroy failed
\n
"
);
ok
(
!
hac
||
broken
(
hac
!=
NULL
),
/* nt4 */
"fail
\n
"
);
if
(
!
hac
)
ok
(
!
DestroyAcceleratorTable
(
hac
),
"destroy failed
\n
"
);
/* creating one accelerator should work */
hac
=
CreateAcceleratorTable
(
&
ac
[
0
],
1
);
...
...
@@ -258,9 +261,12 @@ static void test_accel2(void)
/* how about two of the same type? */
hac
=
CreateAcceleratorTable
(
&
ac
[
0
],
2
);
ok
(
hac
!=
NULL
,
"fail
\n
"
);
ok
(
2
==
CopyAcceleratorTable
(
hac
,
NULL
,
100
),
"copy null failed
\n
"
);
ok
(
2
==
CopyAcceleratorTable
(
hac
,
NULL
,
0
),
"copy null failed
\n
"
);
ok
(
2
==
CopyAcceleratorTable
(
hac
,
NULL
,
1
),
"copy null failed
\n
"
);
res
=
CopyAcceleratorTable
(
hac
,
NULL
,
100
);
ok
(
res
==
2
||
broken
(
res
==
0
),
/* win9x */
"copy null failed %d
\n
"
,
res
);
res
=
CopyAcceleratorTable
(
hac
,
NULL
,
0
);
ok
(
res
==
2
,
"copy null failed %d
\n
"
,
res
);
res
=
CopyAcceleratorTable
(
hac
,
NULL
,
1
);
ok
(
res
==
2
||
broken
(
res
==
0
),
/* win9x */
"copy null failed %d
\n
"
,
res
);
ok
(
1
==
CopyAcceleratorTable
(
hac
,
out
,
1
),
"copy 1 failed
\n
"
);
ok
(
2
==
CopyAcceleratorTable
(
hac
,
out
,
2
),
"copy 2 failed
\n
"
);
ok
(
DestroyAcceleratorTable
(
hac
),
"destroy failed
\n
"
);
...
...
@@ -311,14 +317,18 @@ static void test_accel2(void)
memset
(
ac
,
0xff
,
sizeof
ac
);
hac
=
CreateAcceleratorTable
(
&
ac
[
0
],
2
);
ok
(
hac
!=
NULL
,
"fail
\n
"
);
ok
(
2
==
CopyAcceleratorTable
(
hac
,
out
,
2
),
"copy 2 failed
\n
"
);
res
=
CopyAcceleratorTable
(
hac
,
out
,
2
);
ok
(
res
==
2
||
broken
(
res
==
1
),
/* win9x */
"copy 2 failed %d
\n
"
,
res
);
/* ok( memcmp( ac, out, sizeof ac ), "tables not different\n"); */
ok
(
out
[
0
].
cmd
==
ac
[
0
].
cmd
,
"cmd modified
\n
"
);
ok
(
out
[
0
].
fVirt
==
(
ac
[
0
].
fVirt
&
0x7f
),
"fVirt not modified
\n
"
);
ok
(
out
[
0
].
key
==
ac
[
0
].
key
,
"key modified
\n
"
);
ok
(
out
[
1
].
cmd
==
ac
[
1
].
cmd
,
"cmd modified
\n
"
);
ok
(
out
[
1
].
fVirt
==
(
ac
[
1
].
fVirt
&
0x7f
),
"fVirt not modified
\n
"
);
ok
(
out
[
1
].
key
==
ac
[
1
].
key
,
"key modified
\n
"
);
if
(
res
==
2
)
{
ok
(
out
[
1
].
cmd
==
ac
[
1
].
cmd
,
"cmd modified
\n
"
);
ok
(
out
[
1
].
fVirt
==
(
ac
[
1
].
fVirt
&
0x7f
),
"fVirt not modified
\n
"
);
ok
(
out
[
1
].
key
==
ac
[
1
].
key
,
"key modified
\n
"
);
}
ok
(
DestroyAcceleratorTable
(
hac
),
"destroy failed
\n
"
);
}
...
...
@@ -343,9 +353,13 @@ static void test_PrivateExtractIcons(void) {
cIcons
=
pPrivateExtractIconsA
(
szShell32Dll
,
0
,
16
,
16
,
ahIcon
,
aIconId
,
3
,
0
);
ok
(
cIcons
==
3
,
"Three icons requested got cIcons=%d
\n
"
,
cIcons
);
cIcons
=
pPrivateExtractIconsA
(
szShell32Dll
,
0
,
MAKELONG
(
32
,
16
),
MAKELONG
(
32
,
16
),
ahIcon
,
aIconId
,
3
,
0
);
ok
(
cIcons
==
4
,
"Three icons requested, four expected, got cIcons=%d
\n
"
,
cIcons
);
/* count must be a multiple of two when getting two sizes */
cIcons
=
pPrivateExtractIconsA
(
szShell32Dll
,
0
,
MAKELONG
(
16
,
32
),
MAKELONG
(
16
,
32
),
ahIcon
,
aIconId
,
3
,
0
);
ok
(
cIcons
==
0
/* vista */
||
cIcons
==
4
,
"Three icons requested got cIcons=%d
\n
"
,
cIcons
);
cIcons
=
pPrivateExtractIconsA
(
szShell32Dll
,
0
,
MAKELONG
(
16
,
32
),
MAKELONG
(
16
,
32
),
ahIcon
,
aIconId
,
4
,
0
);
ok
(
cIcons
==
4
,
"Four icons requested got cIcons=%d
\n
"
,
cIcons
);
}
static
void
test_LoadImage
(
void
)
...
...
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