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
2aa94008
Commit
2aa94008
authored
Nov 27, 2022
by
Piotr Caban
Committed by
Alexandre Julliard
Nov 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
localspl: Add FILE: port tests.
parent
bdd561cf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
1 deletion
+71
-1
Makefile.in
dlls/localspl/tests/Makefile.in
+1
-1
localmon.c
dlls/localspl/tests/localmon.c
+70
-0
No files found.
dlls/localspl/tests/Makefile.in
View file @
2aa94008
TESTDLL
=
localspl.dll
TESTDLL
=
localspl.dll
IMPORTS
=
advapi32
IMPORTS
=
advapi32
winspool
C_SRCS
=
\
C_SRCS
=
\
localmon.c
localmon.c
dlls/localspl/tests/localmon.c
View file @
2aa94008
...
@@ -874,6 +874,75 @@ static void test_OpenPort(void)
...
@@ -874,6 +874,75 @@ static void test_OpenPort(void)
}
}
static
void
test_file_port
(
void
)
{
WCHAR
printer_name
[
256
];
DOC_INFO_1W
doc_info
;
HANDLE
hport
,
hf
;
BYTE
buf
[
16
];
DWORD
no
;
BOOL
res
;
if
((
!
pOpenPort
&&
!
pOpenPort2
)
||
!
pClosePort
||
!
pStartDocPort
||
!
pWritePort
||
!
pEndDocPort
)
{
win_skip
(
"FILE: port
\n
"
);
return
;
}
no
=
ARRAY_SIZE
(
printer_name
);
if
(
!
GetDefaultPrinterW
(
printer_name
,
&
no
))
{
skip
(
"no default printer
\n
"
);
return
;
}
SetLastError
(
0xdeadbeef
);
res
=
call_OpenPort
(
tempfileW
,
&
hport
);
ok
(
!
res
,
"OpenPort succeeded
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GetLastError() = %lu
\n
"
,
GetLastError
());
res
=
call_OpenPort
((
WCHAR
*
)
L"FILE"
,
&
hport
);
ok
(
!
res
,
"OpenPort succeeded
\n
"
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"GetLastError() = %lu
\n
"
,
GetLastError
());
res
=
call_OpenPort
((
WCHAR
*
)
L"FILE:"
,
&
hport
);
ok
(
res
,
"OpenPort failed (%lu)
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
res
=
pWritePort
(
hport
,
(
BYTE
*
)
"test"
,
4
,
&
no
);
ok
(
!
res
,
"WritePort succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"GetLastError() = %lu
\n
"
,
GetLastError
());
doc_info
.
pDocName
=
(
WCHAR
*
)
L"not used"
;
doc_info
.
pOutputFile
=
tempfileW
;
doc_info
.
pDatatype
=
(
WCHAR
*
)
L"not used"
;
res
=
pStartDocPort
(
hport
,
printer_name
,
1
,
1
,
(
BYTE
*
)
&
doc_info
);
ok
(
res
,
"StartDocPort failed (%lu)
\n
"
,
GetLastError
());
res
=
pStartDocPort
(
hport
,
printer_name
,
1
,
1
,
(
BYTE
*
)
&
doc_info
);
ok
(
res
,
"StartDocPort failed (%lu)
\n
"
,
GetLastError
());
res
=
pWritePort
(
hport
,
(
BYTE
*
)
"test"
,
4
,
&
no
);
ok
(
res
,
"WritePort failed (%lu)
\n
"
,
GetLastError
());
ok
(
no
==
4
,
"no = %ld
\n
"
,
no
);
res
=
pEndDocPort
(
hport
);
ok
(
res
,
"EndDocPort failed (%lu)
\n
"
,
GetLastError
());
res
=
pEndDocPort
(
hport
);
ok
(
res
,
"EndDocPort failed (%lu)
\n
"
,
GetLastError
());
hf
=
CreateFileW
(
tempfileW
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
ok
(
hf
!=
INVALID_HANDLE_VALUE
,
"CreateFile failed (%lu)
\n
"
,
GetLastError
());
res
=
ReadFile
(
hf
,
buf
,
sizeof
(
buf
),
&
no
,
NULL
);
ok
(
res
,
"ReadFile failed (%lu)
\n
"
,
GetLastError
());
ok
(
no
==
4
,
"no = %ld
\n
"
,
no
);
CloseHandle
(
hf
);
res
=
pClosePort
(
hport
);
ok
(
res
,
"ClosePort failed (%lu)
\n
"
,
GetLastError
());
}
/* ########################### */
/* ########################### */
static
void
test_XcvClosePort
(
void
)
static
void
test_XcvClosePort
(
void
)
...
@@ -1611,6 +1680,7 @@ START_TEST(localmon)
...
@@ -1611,6 +1680,7 @@ START_TEST(localmon)
test_DeletePort
();
test_DeletePort
();
test_EnumPorts
();
test_EnumPorts
();
test_OpenPort
();
test_OpenPort
();
test_file_port
();
if
(
!
hXcv
)
{
if
(
!
hXcv
)
{
skip
(
"Xcv not supported
\n
"
);
skip
(
"Xcv not supported
\n
"
);
...
...
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