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
ad7a1a0e
Commit
ad7a1a0e
authored
Feb 19, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/tests: Some tests for property page initialization.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e1023765
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
143 additions
and
0 deletions
+143
-0
propsheet.c
dlls/comctl32/tests/propsheet.c
+142
-0
prsht.h
include/prsht.h
+1
-0
No files found.
dlls/comctl32/tests/propsheet.c
View file @
ad7a1a0e
...
...
@@ -987,6 +987,147 @@ if (0)
DestroyWindow
(
hdlg
);
}
struct
custom_proppage
{
union
{
PROPSHEETPAGEA
pageA
;
PROPSHEETPAGEW
pageW
;
}
u
;
unsigned
int
addref_called
;
unsigned
int
release_called
;
};
static
UINT
CALLBACK
proppage_callback_a
(
HWND
hwnd
,
UINT
msg
,
PROPSHEETPAGEA
*
psp
)
{
struct
custom_proppage
*
cpage
=
(
struct
custom_proppage
*
)
psp
->
lParam
;
PROPSHEETPAGEA
*
psp_orig
=
&
cpage
->
u
.
pageA
;
ok
(
hwnd
==
NULL
,
"Expected NULL hwnd, got %p
\n
"
,
hwnd
);
ok
(
psp
->
lParam
&&
psp
->
lParam
!=
(
LPARAM
)
psp
,
"Expected newly allocated page description, got %lx, %p
\n
"
,
psp
->
lParam
,
psp
);
ok
(
psp_orig
->
pszTitle
==
psp
->
pszTitle
,
"Expected same page title pointer
\n
"
);
ok
(
!
lstrcmpA
(
psp_orig
->
pszTitle
,
psp
->
pszTitle
),
"Expected same page title string
\n
"
);
switch
(
msg
)
{
case
PSPCB_ADDREF
:
ok
(
psp
->
dwSize
>
PROPSHEETPAGEA_V1_SIZE
,
"Expected ADDREF for V2+ only, got size %u
\n
"
,
psp
->
dwSize
);
cpage
->
addref_called
++
;
break
;
case
PSPCB_RELEASE
:
ok
(
psp
->
dwSize
>=
PROPSHEETPAGEA_V1_SIZE
,
"Unexpected RELEASE, got size %u
\n
"
,
psp
->
dwSize
);
cpage
->
release_called
++
;
break
;
default:
ok
(
0
,
"Unexpected message %u
\n
"
,
msg
);
}
return
1
;
}
static
UINT
CALLBACK
proppage_callback_w
(
HWND
hwnd
,
UINT
msg
,
PROPSHEETPAGEW
*
psp
)
{
struct
custom_proppage
*
cpage
=
(
struct
custom_proppage
*
)
psp
->
lParam
;
PROPSHEETPAGEW
*
psp_orig
=
&
cpage
->
u
.
pageW
;
ok
(
hwnd
==
NULL
,
"Expected NULL hwnd, got %p
\n
"
,
hwnd
);
ok
(
psp
->
lParam
&&
psp
->
lParam
!=
(
LPARAM
)
psp
,
"Expected newly allocated page description, got %lx, %p
\n
"
,
psp
->
lParam
,
psp
);
ok
(
psp_orig
->
pszTitle
==
psp
->
pszTitle
,
"Expected same page title pointer
\n
"
);
ok
(
!
lstrcmpW
(
psp_orig
->
pszTitle
,
psp
->
pszTitle
),
"Expected same page title string
\n
"
);
switch
(
msg
)
{
case
PSPCB_ADDREF
:
ok
(
psp
->
dwSize
>
PROPSHEETPAGEW_V1_SIZE
,
"Expected ADDREF for V2+ only, got size %u
\n
"
,
psp
->
dwSize
);
cpage
->
addref_called
++
;
break
;
case
PSPCB_RELEASE
:
ok
(
psp
->
dwSize
>=
PROPSHEETPAGEW_V1_SIZE
,
"Unexpected RELEASE, got size %u
\n
"
,
psp
->
dwSize
);
cpage
->
release_called
++
;
break
;
default:
ok
(
0
,
"Unexpected message %u
\n
"
,
msg
);
}
return
1
;
}
static
void
test_CreatePropertySheetPage
(
void
)
{
static
const
WCHAR
titleW
[]
=
{
'T'
,
'i'
,
't'
,
'l'
,
'e'
,
0
};
struct
custom_proppage
page
;
HPROPSHEETPAGE
hpsp
;
BOOL
ret
;
memset
(
&
page
.
u
.
pageA
,
0
,
sizeof
(
page
.
u
.
pageA
));
page
.
u
.
pageA
.
dwFlags
=
PSP_USECALLBACK
;
page
.
u
.
pageA
.
pfnDlgProc
=
page_dlg_proc_messages
;
page
.
u
.
pageA
.
pfnCallback
=
proppage_callback_a
;
page
.
u
.
pageA
.
lParam
=
(
LPARAM
)
&
page
;
page
.
u
.
pageA
.
pszTitle
=
"Title"
;
/* Only minimal size validation is performed */
for
(
page
.
u
.
pageA
.
dwSize
=
PROPSHEETPAGEA_V1_SIZE
-
1
;
page
.
u
.
pageA
.
dwSize
<=
PROPSHEETPAGEA_V4_SIZE
+
1
;
page
.
u
.
pageA
.
dwSize
++
)
{
page
.
addref_called
=
0
;
hpsp
=
CreatePropertySheetPageA
(
&
page
.
u
.
pageA
);
if
(
page
.
u
.
pageA
.
dwSize
<
PROPSHEETPAGEA_V1_SIZE
)
todo_wine
ok
(
hpsp
==
NULL
,
"Expected failure, size %u
\n
"
,
page
.
u
.
pageA
.
dwSize
);
else
{
ok
(
hpsp
!=
NULL
,
"Failed to create a page, size %u
\n
"
,
page
.
u
.
pageA
.
dwSize
);
todo_wine_if
(
page
.
u
.
pageA
.
dwSize
>
PROPSHEETPAGEA_V1_SIZE
)
ok
(
page
.
addref_called
==
(
page
.
u
.
pageA
.
dwSize
>
PROPSHEETPAGEA_V1_SIZE
)
?
1
:
0
,
"Expected ADDREF callback message
\n
"
);
}
if
(
hpsp
)
{
page
.
release_called
=
0
;
ret
=
DestroyPropertySheetPage
(
hpsp
);
ok
(
ret
,
"Failed to destroy a page
\n
"
);
todo_wine
ok
(
page
.
release_called
==
1
,
"Expected RELEASE callback message
\n
"
);
}
}
memset
(
&
page
.
u
.
pageW
,
0
,
sizeof
(
page
.
u
.
pageW
));
page
.
u
.
pageW
.
dwFlags
=
PSP_USECALLBACK
;
page
.
u
.
pageW
.
pfnDlgProc
=
page_dlg_proc_messages
;
page
.
u
.
pageW
.
pfnCallback
=
proppage_callback_w
;
page
.
u
.
pageW
.
lParam
=
(
LPARAM
)
&
page
;
page
.
u
.
pageW
.
pszTitle
=
titleW
;
for
(
page
.
u
.
pageW
.
dwSize
=
PROPSHEETPAGEW_V1_SIZE
-
1
;
page
.
u
.
pageW
.
dwSize
<=
PROPSHEETPAGEW_V4_SIZE
+
1
;
page
.
u
.
pageW
.
dwSize
++
)
{
page
.
addref_called
=
0
;
hpsp
=
CreatePropertySheetPageW
(
&
page
.
u
.
pageW
);
if
(
page
.
u
.
pageW
.
dwSize
<
PROPSHEETPAGEW_V1_SIZE
)
todo_wine
ok
(
hpsp
==
NULL
,
"Expected failure, size %u
\n
"
,
page
.
u
.
pageW
.
dwSize
);
else
{
ok
(
hpsp
!=
NULL
,
"Failed to create a page, size %u
\n
"
,
page
.
u
.
pageW
.
dwSize
);
todo_wine_if
(
page
.
u
.
pageW
.
dwSize
>
PROPSHEETPAGEW_V1_SIZE
)
ok
(
page
.
addref_called
==
(
page
.
u
.
pageW
.
dwSize
>
PROPSHEETPAGEW_V1_SIZE
)
?
1
:
0
,
"Expected ADDREF callback message
\n
"
);
}
if
(
hpsp
)
{
page
.
release_called
=
0
;
ret
=
DestroyPropertySheetPage
(
hpsp
);
ok
(
ret
,
"Failed to destroy a page
\n
"
);
todo_wine
ok
(
page
.
release_called
==
1
,
"Expected RELEASE callback message
\n
"
);
}
}
}
START_TEST
(
propsheet
)
{
test_title
();
...
...
@@ -998,4 +1139,5 @@ START_TEST(propsheet)
test_messages
();
test_PSM_ADDPAGE
();
test_PSM_INSERTPAGE
();
test_CreatePropertySheetPage
();
}
include/prsht.h
View file @
ad7a1a0e
...
...
@@ -293,6 +293,7 @@ DECL_PRSHT_TYPE_AW(LPCPROPSHEETPAGE, LATEST)
#define PSP_USEFUSIONCONTEXT 0x00004000
#define PSP_COMMANDLINKS 0x00040000
#define PSPCB_ADDREF 0
#define PSPCB_RELEASE 1
#define PSPCB_CREATE 2
...
...
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