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
573b3eb4
Commit
573b3eb4
authored
Oct 09, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 09, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/ipaddress: Fix IPM_CLEARADDRESS return value.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
aff59389
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
3 deletions
+47
-3
ipaddress.c
dlls/comctl32/ipaddress.c
+4
-3
ipaddress.c
dlls/comctl32/tests/ipaddress.c
+43
-0
No files found.
dlls/comctl32/ipaddress.c
View file @
573b3eb4
...
...
@@ -354,7 +354,7 @@ static BOOL IPADDRESS_SetRange (IPADDRESS_INFO *infoPtr, int index, WORD range)
}
static
void
IPADDRESS_ClearAddress
(
const
IPADDRESS_INFO
*
infoPtr
)
static
LRESULT
IPADDRESS_ClearAddress
(
const
IPADDRESS_INFO
*
infoPtr
)
{
int
i
;
...
...
@@ -362,6 +362,8 @@ static void IPADDRESS_ClearAddress (const IPADDRESS_INFO *infoPtr)
for
(
i
=
0
;
i
<
4
;
i
++
)
SetWindowTextW
(
infoPtr
->
Part
[
i
].
EditHwnd
,
L""
);
return
1
;
}
...
...
@@ -614,8 +616,7 @@ IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return
0
;
case
IPM_CLEARADDRESS
:
IPADDRESS_ClearAddress
(
infoPtr
);
break
;
return
IPADDRESS_ClearAddress
(
infoPtr
);
case
IPM_SETADDRESS
:
return
IPADDRESS_SetAddress
(
infoPtr
,
(
DWORD
)
lParam
);
...
...
dlls/comctl32/tests/ipaddress.c
View file @
573b3eb4
...
...
@@ -144,6 +144,47 @@ static void test_WM_SETFOCUS(void)
DestroyWindow
(
hwnd
);
}
static
void
test_IPM_CLEARADDRESS
(
void
)
{
struct
child_enum
child_enum
=
{{
0
}};
char
buff
[
16
];
int
i
,
ret
;
HWND
hwnd
;
hwnd
=
create_ipaddress_control
();
ok
(
!!
hwnd
,
"Failed to create control.
\n
"
);
ret
=
SendMessageA
(
hwnd
,
IPM_SETADDRESS
,
0
,
MAKEIPADDRESS
(
0
,
1
,
2
,
3
));
ok
(
ret
==
1
,
"Unexpected return value %d.
\n
"
,
ret
);
EnumChildWindows
(
hwnd
,
test_child_enum_proc
,
(
LPARAM
)
&
child_enum
);
ok
(
child_enum
.
count
==
4
,
"Unexpected child count %u.
\n
"
,
child_enum
.
count
);
ret
=
SendMessageA
(
hwnd
,
IPM_SETADDRESS
,
0
,
MAKEIPADDRESS
(
1
,
2
,
3
,
4
));
ok
(
ret
==
1
,
"Unexpected return value %d.
\n
"
,
ret
);
ret
=
GetWindowTextA
(
hwnd
,
buff
,
ARRAY_SIZE
(
buff
));
ok
(
ret
==
7
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
!
strcmp
(
buff
,
"1.2.3.4"
),
"Unexpected address %s.
\n
"
,
buff
);
ret
=
SendMessageA
(
hwnd
,
IPM_CLEARADDRESS
,
0
,
0
);
ok
(
ret
,
"Unexpected return value %d.
\n
"
,
ret
);
ret
=
GetWindowTextA
(
hwnd
,
buff
,
ARRAY_SIZE
(
buff
));
ok
(
ret
==
7
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
!
strcmp
(
buff
,
"0.0.0.0"
),
"Unexpected address %s.
\n
"
,
buff
);
for
(
i
=
0
;
i
<
4
;
++
i
)
{
buff
[
0
]
=
1
;
ret
=
GetWindowTextA
(
child_enum
.
fields
[
i
],
buff
,
ARRAY_SIZE
(
buff
));
ok
(
ret
==
0
,
"Unexpected return value %d.
\n
"
,
ret
);
ok
(
!*
buff
,
"Unexpected field text %s.
\n
"
,
buff
);
}
DestroyWindow
(
hwnd
);
}
START_TEST
(
ipaddress
)
{
ULONG_PTR
cookie
;
...
...
@@ -152,6 +193,7 @@ START_TEST(ipaddress)
test_get_set_text
();
test_IPM_SETFOCUS
();
test_WM_SETFOCUS
();
test_IPM_CLEARADDRESS
();
if
(
!
load_v6_module
(
&
cookie
,
&
ctxt
))
return
;
...
...
@@ -159,6 +201,7 @@ START_TEST(ipaddress)
test_get_set_text
();
test_IPM_SETFOCUS
();
test_WM_SETFOCUS
();
test_IPM_CLEARADDRESS
();
unload_v6_module
(
cookie
,
ctxt
);
}
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