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
ceb7add4
Commit
ceb7add4
authored
Sep 21, 2011
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32/tests: Added more SHChangeNotify tests.
parent
93c001b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
shlfolder.c
dlls/shell32/tests/shlfolder.c
+22
-7
No files found.
dlls/shell32/tests/shlfolder.c
View file @
ceb7add4
...
@@ -4343,16 +4343,23 @@ struct ChNotifyTest {
...
@@ -4343,16 +4343,23 @@ struct ChNotifyTest {
};
};
struct
ChNotifyTest
*
exp_data
;
struct
ChNotifyTest
*
exp_data
;
BOOL
test_new_delivery_flag
;
static
LRESULT
CALLBACK
testwindow_wndproc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
static
LRESULT
CALLBACK
testwindow_wndproc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
{
UINT
signal
=
(
UINT
)
lparam
;
LONG
signal
=
(
LONG
)
lparam
;
switch
(
msg
){
switch
(
msg
){
case
WM_USER_NOTIFY
:
case
WM_USER_NOTIFY
:
if
(
exp_data
->
missing_events
>
0
){
if
(
exp_data
->
missing_events
>
0
)
{
WCHAR
*
path1
,
*
path2
;
WCHAR
*
path1
,
*
path2
;
LPCITEMIDLIST
*
pidls
=
(
LPCITEMIDLIST
*
)
wparam
;
LPITEMIDLIST
*
pidls
=
(
LPITEMIDLIST
*
)
wparam
;
HANDLE
hLock
=
NULL
;
if
(
test_new_delivery_flag
)
{
hLock
=
SHChangeNotification_Lock
((
HANDLE
)
wparam
,
lparam
,
&
pidls
,
&
signal
);
ok
(
hLock
!=
NULL
,
"SHChangeNotification_Lock returned NULL
\n
"
);
}
ok
(
exp_data
->
signal
==
signal
,
ok
(
exp_data
->
signal
==
signal
,
"%s: expected notification type %x, got: %x
\n
"
,
"%s: expected notification type %x, got: %x
\n
"
,
...
@@ -4367,6 +4374,9 @@ static LRESULT CALLBACK testwindow_wndproc(HWND hwnd, UINT msg, WPARAM wparam, L
...
@@ -4367,6 +4374,9 @@ static LRESULT CALLBACK testwindow_wndproc(HWND hwnd, UINT msg, WPARAM wparam, L
HeapFree
(
GetProcessHeap
(),
0
,
path2
);
HeapFree
(
GetProcessHeap
(),
0
,
path2
);
exp_data
->
missing_events
--
;
exp_data
->
missing_events
--
;
if
(
test_new_delivery_flag
)
SHChangeNotification_Unlock
(
hLock
);
}
else
}
else
ok
(
0
,
"Didn't expect a WM_USER_NOTIFY message (event: %x)
\n
"
,
signal
);
ok
(
0
,
"Didn't expect a WM_USER_NOTIFY message (event: %x)
\n
"
,
signal
);
return
0
;
return
0
;
...
@@ -4408,7 +4418,7 @@ static void do_events(void)
...
@@ -4408,7 +4418,7 @@ static void do_events(void)
trace
(
"%s: took %d tries
\n
"
,
exp_data
->
id
,
c
);
trace
(
"%s: took %d tries
\n
"
,
exp_data
->
id
,
c
);
}
}
static
void
test_SHChangeNotify
(
void
)
static
void
test_SHChangeNotify
(
BOOL
test_new_delivery
)
{
{
HWND
wnd
;
HWND
wnd
;
ULONG
notifyID
,
i
;
ULONG
notifyID
,
i
;
...
@@ -4418,10 +4428,14 @@ static void test_SHChangeNotify(void)
...
@@ -4418,10 +4428,14 @@ static void test_SHChangeNotify(void)
const
CHAR
root_dirA
[]
=
"C:
\\
shell32_cn_test"
;
const
CHAR
root_dirA
[]
=
"C:
\\
shell32_cn_test"
;
const
WCHAR
root_dirW
[]
=
{
'C'
,
':'
,
'\\'
,
's'
,
'h'
,
'e'
,
'l'
,
'l'
,
'3'
,
'2'
,
'_'
,
'c'
,
'n'
,
'_'
,
't'
,
'e'
,
's'
,
't'
,
0
};
const
WCHAR
root_dirW
[]
=
{
'C'
,
':'
,
'\\'
,
's'
,
'h'
,
'e'
,
'l'
,
'l'
,
'3'
,
'2'
,
'_'
,
'c'
,
'n'
,
'_'
,
't'
,
'e'
,
's'
,
't'
,
0
};
trace
(
"SHChangeNotify tests (%x)
\n
"
,
test_new_delivery
);
CreateDirectoryW
(
NULL
,
NULL
);
CreateDirectoryW
(
NULL
,
NULL
);
has_unicode
=
!
(
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
);
has_unicode
=
!
(
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
);
register_testwindow_class
();
test_new_delivery_flag
=
test_new_delivery
;
if
(
!
test_new_delivery
)
register_testwindow_class
();
wnd
=
CreateWindowExA
(
0
,
testwindow_class
,
testwindow_class
,
0
,
wnd
=
CreateWindowExA
(
0
,
testwindow_class
,
testwindow_class
,
0
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
130
,
105
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
130
,
105
,
...
@@ -4439,7 +4453,7 @@ static void test_SHChangeNotify(void)
...
@@ -4439,7 +4453,7 @@ static void test_SHChangeNotify(void)
ok
(
hr
==
S_OK
,
"SHILCreateFromPath failed: 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"SHILCreateFromPath failed: 0x%08x
\n
"
,
hr
);
entries
[
0
].
fRecursive
=
TRUE
;
entries
[
0
].
fRecursive
=
TRUE
;
notifyID
=
SHChangeNotifyRegister
(
wnd
,
SHCNRF_ShellLevel
,
notifyID
=
SHChangeNotifyRegister
(
wnd
,
!
test_new_delivery
?
SHCNRF_ShellLevel
:
SHCNRF_ShellLevel
|
SHCNRF_NewDelivery
,
SHCNE_ALLEVENTS
,
WM_USER_NOTIFY
,
1
,
entries
);
SHCNE_ALLEVENTS
,
WM_USER_NOTIFY
,
1
,
entries
);
ok
(
notifyID
!=
0
,
"Failed to register a window for change notifications
\n
"
);
ok
(
notifyID
!=
0
,
"Failed to register a window for change notifications
\n
"
);
...
@@ -4595,7 +4609,8 @@ START_TEST(shlfolder)
...
@@ -4595,7 +4609,8 @@ START_TEST(shlfolder)
test_SHGetIDListFromObject
();
test_SHGetIDListFromObject
();
test_SHGetItemFromObject
();
test_SHGetItemFromObject
();
test_ShellItemCompare
();
test_ShellItemCompare
();
test_SHChangeNotify
();
test_SHChangeNotify
(
FALSE
);
test_SHChangeNotify
(
TRUE
);
test_ShellItemBindToHandler
();
test_ShellItemBindToHandler
();
test_ShellItemGetAttributes
();
test_ShellItemGetAttributes
();
test_SHCreateDefaultContextMenu
();
test_SHCreateDefaultContextMenu
();
...
...
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