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
f26bace5
Commit
f26bace5
authored
Oct 23, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Oct 24, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Fix resource tests compilation with __WINESRC__ defined.
parent
a7219e8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
30 deletions
+30
-30
resource.c
dlls/user32/tests/resource.c
+30
-30
No files found.
dlls/user32/tests/resource.c
View file @
f26bace5
...
...
@@ -23,7 +23,7 @@
#include "wine/test.h"
static
UINT
(
WINAPI
*
pPrivateExtractIconsA
)(
LPC
T
STR
,
int
,
int
,
int
,
HICON
*
,
UINT
*
,
UINT
,
UINT
)
=
NULL
;
static
UINT
(
WINAPI
*
pPrivateExtractIconsA
)(
LPCSTR
,
int
,
int
,
int
,
HICON
*
,
UINT
*
,
UINT
,
UINT
)
=
NULL
;
static
void
init_function_pointers
(
void
)
{
...
...
@@ -33,7 +33,7 @@ static void init_function_pointers(void)
static
void
test_LoadStringW
(
void
)
{
HINSTANCE
hInst
=
GetModuleHandle
(
NULL
);
HINSTANCE
hInst
=
GetModuleHandle
A
(
NULL
);
WCHAR
copiedstringw
[
128
],
returnedstringw
[
128
],
*
resourcepointer
=
NULL
;
char
copiedstring
[
128
],
returnedstring
[
128
];
int
length1
,
length2
,
retvalue
;
...
...
@@ -79,7 +79,7 @@ static void test_LoadStringW(void)
static
void
test_LoadStringA
(
void
)
{
HINSTANCE
hInst
=
GetModuleHandle
(
NULL
);
HINSTANCE
hInst
=
GetModuleHandle
A
(
NULL
);
static
const
char
str
[]
=
"String resource"
;
/* same in resource.rc */
char
buf
[
128
];
struct
string_test
{
...
...
@@ -148,7 +148,7 @@ static void test_accel1(void)
ac
[
n
].
key
=
0
;
ac
[
n
++
].
fVirt
=
0
;
hAccel
=
CreateAcceleratorTable
(
&
ac
[
0
],
n
);
hAccel
=
CreateAcceleratorTable
A
(
&
ac
[
0
],
n
);
ok
(
hAccel
!=
NULL
,
"create accelerator table
\n
"
);
r
=
DestroyAcceleratorTable
(
hAccel
);
...
...
@@ -176,13 +176,13 @@ static void test_accel1(void)
ac
[
n
].
key
=
0xffff
;
ac
[
n
++
].
fVirt
=
0x0001
;
hAccel
=
CreateAcceleratorTable
(
&
ac
[
0
],
n
);
hAccel
=
CreateAcceleratorTable
A
(
&
ac
[
0
],
n
);
ok
(
hAccel
!=
NULL
,
"create accelerator table
\n
"
);
r
=
CopyAcceleratorTable
(
hAccel
,
NULL
,
0
);
r
=
CopyAcceleratorTable
A
(
hAccel
,
NULL
,
0
);
ok
(
r
==
n
,
"two entries in table %u/%u
\n
"
,
r
,
n
);
r
=
CopyAcceleratorTable
(
hAccel
,
&
ac
[
0
],
n
);
r
=
CopyAcceleratorTable
A
(
hAccel
,
&
ac
[
0
],
n
);
ok
(
r
==
n
,
"still should be two entries in table %u/%u
\n
"
,
r
,
n
);
n
=
0
;
...
...
@@ -213,7 +213,7 @@ done:
r
=
DestroyAcceleratorTable
(
hAccel
);
ok
(
r
,
"destroy accelerator table
\n
"
);
hAccel
=
CreateAcceleratorTable
(
&
ac
[
0
],
0
);
hAccel
=
CreateAcceleratorTable
A
(
&
ac
[
0
],
0
);
ok
(
!
hAccel
||
broken
(
hAccel
!=
NULL
),
/* nt4 */
"zero elements should fail
\n
"
);
/* these will on crash win2k
...
...
@@ -246,36 +246,36 @@ static void test_accel2(void)
*/
/* try a zero count */
hac
=
CreateAcceleratorTable
(
&
ac
[
0
],
0
);
hac
=
CreateAcceleratorTable
A
(
&
ac
[
0
],
0
);
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
);
hac
=
CreateAcceleratorTable
A
(
&
ac
[
0
],
1
);
ok
(
hac
!=
NULL
,
"fail
\n
"
);
ok
(
1
==
CopyAcceleratorTable
(
hac
,
out
,
1
),
"copy failed
\n
"
);
ok
(
1
==
CopyAcceleratorTable
A
(
hac
,
out
,
1
),
"copy failed
\n
"
);
ok
(
DestroyAcceleratorTable
(
hac
),
"destroy failed
\n
"
);
/* how about two of the same type? */
hac
=
CreateAcceleratorTable
(
&
ac
[
0
],
2
);
hac
=
CreateAcceleratorTable
A
(
&
ac
[
0
],
2
);
ok
(
hac
!=
NULL
,
"fail
\n
"
);
res
=
CopyAcceleratorTable
(
hac
,
NULL
,
100
);
res
=
CopyAcceleratorTable
A
(
hac
,
NULL
,
100
);
ok
(
res
==
2
,
"copy null failed %d
\n
"
,
res
);
res
=
CopyAcceleratorTable
(
hac
,
NULL
,
0
);
res
=
CopyAcceleratorTable
A
(
hac
,
NULL
,
0
);
ok
(
res
==
2
,
"copy null failed %d
\n
"
,
res
);
res
=
CopyAcceleratorTable
(
hac
,
NULL
,
1
);
res
=
CopyAcceleratorTable
A
(
hac
,
NULL
,
1
);
ok
(
res
==
2
,
"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
(
1
==
CopyAcceleratorTable
A
(
hac
,
out
,
1
),
"copy 1 failed
\n
"
);
ok
(
2
==
CopyAcceleratorTable
A
(
hac
,
out
,
2
),
"copy 2 failed
\n
"
);
ok
(
DestroyAcceleratorTable
(
hac
),
"destroy failed
\n
"
);
/* ok( !memcmp( ac, out, sizeof ac ), "tables different\n"); */
/* how about two of the same type with a non-zero key? */
ac
[
0
].
key
=
0x20
;
ac
[
1
].
key
=
0x20
;
hac
=
CreateAcceleratorTable
(
&
ac
[
0
],
2
);
hac
=
CreateAcceleratorTable
A
(
&
ac
[
0
],
2
);
ok
(
hac
!=
NULL
,
"fail
\n
"
);
ok
(
2
==
CopyAcceleratorTable
(
hac
,
out
,
2
),
"copy 2 failed
\n
"
);
ok
(
2
==
CopyAcceleratorTable
A
(
hac
,
out
,
2
),
"copy 2 failed
\n
"
);
ok
(
DestroyAcceleratorTable
(
hac
),
"destroy failed
\n
"
);
/* ok( !memcmp( ac, out, sizeof ac ), "tables different\n"); */
...
...
@@ -284,17 +284,17 @@ static void test_accel2(void)
ac
[
0
].
key
=
0x40
;
ac
[
1
].
fVirt
=
FVIRTKEY
;
ac
[
1
].
key
=
0x40
;
hac
=
CreateAcceleratorTable
(
&
ac
[
0
],
2
);
hac
=
CreateAcceleratorTable
A
(
&
ac
[
0
],
2
);
ok
(
hac
!=
NULL
,
"fail
\n
"
);
ok
(
2
==
CopyAcceleratorTable
(
hac
,
out
,
2
),
"copy 2 failed
\n
"
);
ok
(
2
==
CopyAcceleratorTable
A
(
hac
,
out
,
2
),
"copy 2 failed
\n
"
);
/* ok( !memcmp( ac, out, sizeof ac ), "tables different\n"); */
ok
(
DestroyAcceleratorTable
(
hac
),
"destroy failed
\n
"
);
/* how virtual key codes */
ac
[
0
].
fVirt
=
FVIRTKEY
;
hac
=
CreateAcceleratorTable
(
&
ac
[
0
],
1
);
hac
=
CreateAcceleratorTable
A
(
&
ac
[
0
],
1
);
ok
(
hac
!=
NULL
,
"fail
\n
"
);
ok
(
1
==
CopyAcceleratorTable
(
hac
,
out
,
2
),
"copy 2 failed
\n
"
);
ok
(
1
==
CopyAcceleratorTable
A
(
hac
,
out
,
2
),
"copy 2 failed
\n
"
);
/* ok( !memcmp( ac, out, sizeof ac/2 ), "tables different\n"); */
ok
(
DestroyAcceleratorTable
(
hac
),
"destroy failed
\n
"
);
...
...
@@ -302,9 +302,9 @@ static void test_accel2(void)
ac
[
0
].
cmd
=
0xffff
;
ac
[
0
].
fVirt
=
0xff
;
ac
[
0
].
key
=
0xffff
;
hac
=
CreateAcceleratorTable
(
&
ac
[
0
],
1
);
hac
=
CreateAcceleratorTable
A
(
&
ac
[
0
],
1
);
ok
(
hac
!=
NULL
,
"fail
\n
"
);
ok
(
1
==
CopyAcceleratorTable
(
hac
,
out
,
1
),
"copy 1 failed
\n
"
);
ok
(
1
==
CopyAcceleratorTable
A
(
hac
,
out
,
1
),
"copy 1 failed
\n
"
);
/* ok( memcmp( ac, out, sizeof ac/2 ), "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
"
);
...
...
@@ -313,9 +313,9 @@ static void test_accel2(void)
/* how turning on all bits? */
memset
(
ac
,
0xff
,
sizeof
ac
);
hac
=
CreateAcceleratorTable
(
&
ac
[
0
],
2
);
hac
=
CreateAcceleratorTable
A
(
&
ac
[
0
],
2
);
ok
(
hac
!=
NULL
,
"fail
\n
"
);
res
=
CopyAcceleratorTable
(
hac
,
out
,
2
);
res
=
CopyAcceleratorTable
A
(
hac
,
out
,
2
);
ok
(
res
==
2
,
"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
"
);
...
...
@@ -365,14 +365,14 @@ static void test_LoadImage(void)
HBITMAP
bmp
;
HRSRC
hres
;
bmp
=
LoadBitmapA
(
GetModuleHandle
(
NULL
),
MAKEINTRESOURCE
(
100
));
bmp
=
LoadBitmapA
(
GetModuleHandle
A
(
NULL
),
MAKEINTRESOURCEA
(
100
));
ok
(
bmp
!=
NULL
,
"Could not load a bitmap resource
\n
"
);
if
(
bmp
)
DeleteObject
(
bmp
);
hres
=
FindResource
(
GetModuleHandle
(
NULL
),
"#100"
,
RT_BITMAP
);
hres
=
FindResource
A
(
GetModuleHandleA
(
NULL
),
"#100"
,
(
LPCSTR
)
RT_BITMAP
);
ok
(
hres
!=
NULL
,
"Could not find a bitmap resource with a numeric string
\n
"
);
bmp
=
LoadBitmapA
(
GetModuleHandle
(
NULL
),
"#100"
);
bmp
=
LoadBitmapA
(
GetModuleHandle
A
(
NULL
),
"#100"
);
ok
(
bmp
!=
NULL
,
"Could not load a bitmap resource with a numeric string
\n
"
);
if
(
bmp
)
DeleteObject
(
bmp
);
}
...
...
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