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
8db7b9c7
Commit
8db7b9c7
authored
Mar 07, 2007
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Mar 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localspl/tests: Add tests for XcvDataPort_DeletePort.
parent
9827e5d2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
localmon.c
dlls/localspl/tests/localmon.c
+44
-0
No files found.
dlls/localspl/tests/localmon.c
View file @
8db7b9c7
...
@@ -69,6 +69,7 @@ static BOOL (WINAPI *pDeletePortUI)(PCWSTR, HWND, PCWSTR);
...
@@ -69,6 +69,7 @@ static BOOL (WINAPI *pDeletePortUI)(PCWSTR, HWND, PCWSTR);
static
const
WCHAR
cmd_ConfigureLPTPortCommandOKW
[]
=
{
'C'
,
'o'
,
'n'
,
'f'
,
'i'
,
'g'
,
'u'
,
'r'
,
'e'
,
static
const
WCHAR
cmd_ConfigureLPTPortCommandOKW
[]
=
{
'C'
,
'o'
,
'n'
,
'f'
,
'i'
,
'g'
,
'u'
,
'r'
,
'e'
,
'L'
,
'P'
,
'T'
,
'P'
,
'o'
,
'r'
,
't'
,
'L'
,
'P'
,
'T'
,
'P'
,
'o'
,
'r'
,
't'
,
'C'
,
'o'
,
'm'
,
'm'
,
'a'
,
'n'
,
'd'
,
'O'
,
'K'
,
0
};
'C'
,
'o'
,
'm'
,
'm'
,
'a'
,
'n'
,
'd'
,
'O'
,
'K'
,
0
};
static
WCHAR
cmd_DeletePortW
[]
=
{
'D'
,
'e'
,
'l'
,
'e'
,
't'
,
'e'
,
'P'
,
'o'
,
'r'
,
't'
,
0
};
static
WCHAR
cmd_GetTransmissionRetryTimeoutW
[]
=
{
'G'
,
'e'
,
't'
,
static
WCHAR
cmd_GetTransmissionRetryTimeoutW
[]
=
{
'G'
,
'e'
,
't'
,
'T'
,
'r'
,
'a'
,
'n'
,
's'
,
'm'
,
'i'
,
's'
,
's'
,
'i'
,
'o'
,
'n'
,
'T'
,
'r'
,
'a'
,
'n'
,
's'
,
'm'
,
'i'
,
's'
,
's'
,
'i'
,
'o'
,
'n'
,
'R'
,
'e'
,
't'
,
'r'
,
'y'
,
'T'
,
'i'
,
'm'
,
'e'
,
'o'
,
'u'
,
't'
,
0
};
'R'
,
'e'
,
't'
,
'r'
,
'y'
,
'T'
,
'i'
,
'm'
,
'e'
,
'o'
,
'u'
,
't'
,
0
};
...
@@ -483,6 +484,48 @@ static void test_XcvDataPort_ConfigureLPTPortCommandOK(void)
...
@@ -483,6 +484,48 @@ static void test_XcvDataPort_ConfigureLPTPortCommandOK(void)
/* ########################### */
/* ########################### */
static
void
test_XcvDataPort_DeletePort
(
void
)
{
DWORD
res
;
HANDLE
hXcv
;
DWORD
needed
;
if
((
pXcvOpenPort
==
NULL
)
||
(
pXcvDataPort
==
NULL
)
||
(
pXcvClosePort
==
NULL
))
return
;
hXcv
=
(
HANDLE
)
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
res
=
pXcvOpenPort
(
emptyW
,
SERVER_ALL_ACCESS
,
&
hXcv
);
ok
(
res
,
"hXcv: %d with %u and %p (expected '!= 0')
\n
"
,
res
,
GetLastError
(),
hXcv
);
if
(
!
res
)
return
;
/* cleanup: just to make sure */
needed
=
(
DWORD
)
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
res
=
pXcvDataPort
(
hXcv
,
cmd_DeletePortW
,
(
PBYTE
)
tempfileW
,
(
lstrlenW
(
tempfileW
)
+
1
)
*
sizeof
(
WCHAR
),
NULL
,
0
,
&
needed
);
ok
(
!
res
||
(
res
==
ERROR_FILE_NOT_FOUND
),
"returned %d with %u (expected ERROR_SUCCESS or ERROR_FILE_NOT_FOUND)
\n
"
,
res
,
GetLastError
());
/* ToDo: cmd_AddPortW for tempfileW, then cmd_DeletePortW for the existing Port */
/* try to delete a non-existing Port */
needed
=
(
DWORD
)
0xdeadbeef
;
SetLastError
(
0xdeadbeef
);
res
=
pXcvDataPort
(
hXcv
,
cmd_DeletePortW
,
(
PBYTE
)
tempfileW
,
(
lstrlenW
(
tempfileW
)
+
1
)
*
sizeof
(
WCHAR
),
NULL
,
0
,
&
needed
);
ok
(
res
==
ERROR_FILE_NOT_FOUND
,
"returned %d with %u (expected ERROR_FILE_NOT_FOUND)
\n
"
,
res
,
GetLastError
());
/* emptyW as Portname: ERROR_FILE_NOT_FOUND is returned */
/* NULL as Portname: Native localspl.dll crashed */
pXcvClosePort
(
hXcv
);
}
/* ########################### */
static
void
test_XcvDataPort_GetTransmissionRetryTimeout
(
void
)
static
void
test_XcvDataPort_GetTransmissionRetryTimeout
(
void
)
{
{
CHAR
org_value
[
16
];
CHAR
org_value
[
16
];
...
@@ -1039,6 +1082,7 @@ START_TEST(localmon)
...
@@ -1039,6 +1082,7 @@ START_TEST(localmon)
test_EnumPorts
();
test_EnumPorts
();
test_XcvClosePort
();
test_XcvClosePort
();
test_XcvDataPort_ConfigureLPTPortCommandOK
();
test_XcvDataPort_ConfigureLPTPortCommandOK
();
test_XcvDataPort_DeletePort
();
test_XcvDataPort_GetTransmissionRetryTimeout
();
test_XcvDataPort_GetTransmissionRetryTimeout
();
test_XcvDataPort_MonitorUI
();
test_XcvDataPort_MonitorUI
();
test_XcvDataPort_PortIsValid
();
test_XcvDataPort_PortIsValid
();
...
...
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