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
a1323b6b
Commit
a1323b6b
authored
Oct 19, 2007
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Oct 22, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spoolss/test: Add a test for BuildOtherNamesFromMachineName.
parent
20d9bade
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
spoolss.c
dlls/spoolss/tests/spoolss.c
+33
-0
No files found.
dlls/spoolss/tests/spoolss.c
View file @
a1323b6b
...
...
@@ -33,6 +33,7 @@
static
HMODULE
hwinspool
;
static
HMODULE
hspl
;
static
BOOL
(
WINAPI
*
pBuildOtherNamesFromMachineName
)(
LPWSTR
**
,
LPDWORD
);
static
DWORD
(
WINAPI
*
pSplInitializeWinSpoolDrv
)(
LPVOID
*
);
#define WINSPOOL_TABLESIZE 16
...
...
@@ -51,6 +52,10 @@ static LPCSTR load_functions(void)
hspl
=
LoadLibraryA
(
ptr
);
if
(
!
hspl
)
return
ptr
;
ptr
=
"BuildOtherNamesFromMachineName"
;
pBuildOtherNamesFromMachineName
=
(
void
*
)
GetProcAddress
(
hspl
,
ptr
);
if
(
!
pBuildOtherNamesFromMachineName
)
return
ptr
;
ptr
=
"SplInitializeWinSpoolDrv"
;
pSplInitializeWinSpoolDrv
=
(
void
*
)
GetProcAddress
(
hspl
,
ptr
);
if
(
!
pSplInitializeWinSpoolDrv
)
return
ptr
;
...
...
@@ -90,6 +95,33 @@ static LPCSTR load_functions(void)
/* ########################### */
static
void
test_BuildOtherNamesFromMachineName
(
void
)
{
LPWSTR
*
buffers
;
DWORD
numentries
;
DWORD
res
;
buffers
=
NULL
;
numentries
=
0
;
SetLastError
(
0xdeadbeef
);
res
=
pBuildOtherNamesFromMachineName
(
&
buffers
,
&
numentries
);
/* An array with 3 stringpointer is returned:
entry_#0: "" (empty String)
entry_#1: <hostname> (this is the same as the computernam)
entry_#2: <ip-address> (string with the ip-address of <hostname>)
*/
todo_wine
ok
(
res
&&
(
buffers
!=
NULL
)
&&
(
numentries
==
3
)
&&
(
buffers
[
0
]
!=
NULL
)
&&
(
buffers
[
0
][
0
]
==
'\0'
),
"got %u with %u and %p,%u (%p:%d)
\n
"
,
res
,
GetLastError
(),
buffers
,
numentries
,
((
numentries
>
0
)
&&
buffers
)
?
buffers
[
0
]
:
NULL
,
((
numentries
>
0
)
&&
buffers
&&
buffers
[
0
])
?
lstrlenW
(
buffers
[
0
])
:
-
1
);
}
/* ########################### */
static
void
test_SplInitializeWinSpoolDrv
(
VOID
)
{
DWORD
res
;
...
...
@@ -124,6 +156,7 @@ START_TEST(spoolss)
return
;
}
test_BuildOtherNamesFromMachineName
();
test_SplInitializeWinSpoolDrv
();
}
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