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
dac63ff6
Commit
dac63ff6
authored
Dec 05, 2007
by
Peter Oberndorfer
Committed by
Alexandre Julliard
Dec 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Add EnumMRUList tests.
parent
a76d60c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
2 deletions
+66
-2
mru.c
dlls/comctl32/tests/mru.c
+66
-2
No files found.
dlls/comctl32/tests/mru.c
View file @
dac63ff6
...
...
@@ -68,11 +68,12 @@ static HMODULE hComctl32;
static
HANDLE
(
WINAPI
*
pCreateMRUListA
)(
LPCREATEMRULISTA
);
static
void
(
WINAPI
*
pFreeMRUList
)(
HANDLE
);
static
INT
(
WINAPI
*
pAddMRUStringA
)(
HANDLE
,
LPCSTR
);
static
INT
(
WINAPI
*
pEnumMRUList
)(
HANDLE
,
INT
,
LPVOID
,
DWORD
);
/*
static INT (WINAPI *pFindMRUStringA)(HANDLE,LPCSTR,LPINT);
static INT (WINAPI *pEnumMRUList)(HANDLE,INT,LPVOID,DWORD);
*/
static
BOOL
create_reg_entries
(
void
)
{
HKEY
hKey
=
NULL
;
...
...
@@ -162,8 +163,13 @@ static void test_MRUListA(void)
pCreateMRUListA
=
(
void
*
)
GetProcAddress
(
hComctl32
,(
LPCSTR
)
151
);
pFreeMRUList
=
(
void
*
)
GetProcAddress
(
hComctl32
,(
LPCSTR
)
152
);
pAddMRUStringA
=
(
void
*
)
GetProcAddress
(
hComctl32
,(
LPCSTR
)
153
);
if
(
!
pCreateMRUListA
||
!
pFreeMRUList
||
!
pAddMRUStringA
)
pEnumMRUList
=
(
void
*
)
GetProcAddress
(
hComctl32
,(
LPCSTR
)
154
);
if
(
!
pCreateMRUListA
||
!
pFreeMRUList
||
!
pAddMRUStringA
||
!
pEnumMRUList
)
{
skip
(
"MRU entry points not found
\n
"
);
return
;
}
if
(
0
)
{
...
...
@@ -213,6 +219,7 @@ static void test_MRUListA(void)
if
(
hMRU
)
{
char
buffer
[
255
];
checks
[
0
]
=
"Test 1"
;
checks
[
1
]
=
"Test 2"
;
checks
[
2
]
=
"Test 3"
;
...
...
@@ -277,6 +284,63 @@ static void test_MRUListA(void)
checks
[
0
]
=
checks
[
3
];
check_reg_entries
(
"abc"
,
checks
);
/* NULL buffer = get list size */
iRet
=
pEnumMRUList
(
hMRU
,
0
,
NULL
,
0
);
ok
(
iRet
==
3
,
"EnumMRUList expected %d, got %d
\n
"
,
LIST_SIZE
,
iRet
);
todo_wine
{
/* negative item pos = get list size */
iRet
=
pEnumMRUList
(
hMRU
,
-
1
,
NULL
,
0
);
ok
(
iRet
==
3
,
"EnumMRUList expected %d, got %d
\n
"
,
LIST_SIZE
,
iRet
);
/* negative item pos = get list size */
iRet
=
pEnumMRUList
(
hMRU
,
-
5
,
NULL
,
0
);
ok
(
iRet
==
3
,
"EnumMRUList expected %d, got %d
\n
"
,
LIST_SIZE
,
iRet
);
/* negative item pos = get list size */
iRet
=
pEnumMRUList
(
hMRU
,
-
1
,
buffer
,
255
);
ok
(
iRet
==
3
,
"EnumMRUList expected %d, got %d
\n
"
,
LIST_SIZE
,
iRet
);
/* negative item pos = get list size */
iRet
=
pEnumMRUList
(
hMRU
,
-
5
,
buffer
,
255
);
ok
(
iRet
==
3
,
"EnumMRUList expected %d, got %d
\n
"
,
LIST_SIZE
,
iRet
);
}
/* check entry 0 */
buffer
[
0
]
=
0
;
iRet
=
pEnumMRUList
(
hMRU
,
0
,
buffer
,
255
);
todo_wine
ok
(
iRet
==
strlen
(
checks
[
3
]),
"EnumMRUList expected %d, got %d
\n
"
,
strlen
(
checks
[
3
]),
iRet
);
ok
(
strcmp
(
buffer
,
checks
[
3
])
==
0
,
"EnumMRUList expected %s, got %s
\n
"
,
checks
[
3
],
buffer
);
/* check entry 0 with a too small buffer */
buffer
[
0
]
=
0
;
/* overwritten with 'T' */
buffer
[
1
]
=
'A'
;
/* overwritten with 0 */
buffer
[
2
]
=
'A'
;
/* unchanged */
buffer
[
3
]
=
0
;
/* unchanged */
iRet
=
pEnumMRUList
(
hMRU
,
0
,
buffer
,
2
);
todo_wine
ok
(
iRet
==
strlen
(
checks
[
3
]),
"EnumMRUList expected %d, got %d
\n
"
,
strlen
(
checks
[
3
]),
iRet
);
todo_wine
ok
(
strcmp
(
buffer
,
"T"
)
==
0
,
"EnumMRUList expected %s, got %s
\n
"
,
"T"
,
buffer
);
/* make sure space after buffer has old values */
ok
(
buffer
[
2
]
==
'A'
,
"EnumMRUList expected %02x, got %02x
\n
"
,
'A'
,
buffer
[
2
]);
/* check entry 1 */
buffer
[
0
]
=
0
;
iRet
=
pEnumMRUList
(
hMRU
,
1
,
buffer
,
255
);
todo_wine
ok
(
iRet
==
strlen
(
checks
[
1
]),
"EnumMRUList expected %d, got %d
\n
"
,
strlen
(
checks
[
1
]),
iRet
);
ok
(
strcmp
(
buffer
,
checks
[
1
])
==
0
,
"EnumMRUList expected %s, got %s
\n
"
,
checks
[
1
],
buffer
);
/* check entry 2 */
buffer
[
0
]
=
0
;
iRet
=
pEnumMRUList
(
hMRU
,
2
,
buffer
,
255
);
todo_wine
ok
(
iRet
==
strlen
(
checks
[
2
]),
"EnumMRUList expected %d, got %d
\n
"
,
strlen
(
checks
[
2
]),
iRet
);
ok
(
strcmp
(
buffer
,
checks
[
2
])
==
0
,
"EnumMRUList expected %s, got %s
\n
"
,
checks
[
2
],
buffer
);
/* check out of bounds entry 3 */
strcpy
(
buffer
,
"dummy"
);
iRet
=
pEnumMRUList
(
hMRU
,
3
,
buffer
,
255
);
ok
(
iRet
==
-
1
,
"EnumMRUList expected %d, got %d
\n
"
,
-
1
,
iRet
);
ok
(
strcmp
(
buffer
,
"dummy"
)
==
0
,
"EnumMRUList expected unchanged buffer %s, got %s
\n
"
,
"dummy"
,
buffer
);
/* Finished with this MRU */
pFreeMRUList
(
hMRU
);
}
...
...
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