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
cf122bab
Commit
cf122bab
authored
Oct 03, 2007
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Oct 04, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spoolss/tests: Add tests for SplInitializeWinSpoolDrv.
parent
a2b70095
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
157 additions
and
0 deletions
+157
-0
.gitignore
.gitignore
+4
-0
Makefile.in
Makefile.in
+2
-0
configure
configure
+3
-0
configure.ac
configure.ac
+1
-0
Makefile.in
dlls/Makefile.in
+1
-0
Makefile.in
dlls/spoolss/tests/Makefile.in
+13
-0
spoolss.c
dlls/spoolss/tests/spoolss.c
+129
-0
Makefile.in
programs/winetest/Makefile.in
+3
-0
winetest.rc
programs/winetest/winetest.rc
+1
-0
No files found.
.gitignore
View file @
cf122bab
...
...
@@ -437,6 +437,9 @@ dlls/snmpapi/tests/snmpapi_crosstest.exe
dlls/snmpapi/tests/testlist.c
dlls/sound.drv16
dlls/spoolss/libspoolss.def
dlls/spoolss/tests/*.ok
dlls/spoolss/tests/spoolss_crosstest.exe
dlls/spoolss/tests/testlist.c
dlls/stdole2.tlb/rsrc.res
dlls/stdole2.tlb/std_ole_v2.tlb
dlls/stdole32.tlb/rsrc.res
...
...
@@ -728,6 +731,7 @@ programs/winetest/shdocvw_test.exe
programs/winetest/shell32_test.exe
programs/winetest/shlwapi_test.exe
programs/winetest/snmpapi_test.exe
programs/winetest/spoolss_test.exe
programs/winetest/urlmon_test.exe
programs/winetest/user32_test.exe
programs/winetest/usp10_test.exe
...
...
Makefile.in
View file @
cf122bab
...
...
@@ -385,6 +385,7 @@ ALL_MAKEFILES = \
dlls/snmpapi/Makefile
\
dlls/snmpapi/tests/Makefile
\
dlls/spoolss/Makefile
\
dlls/spoolss/tests/Makefile
\
dlls/stdole2.tlb/Makefile
\
dlls/stdole32.tlb/Makefile
\
dlls/sti/Makefile
\
...
...
@@ -754,6 +755,7 @@ dlls/shlwapi/tests/Makefile: dlls/shlwapi/tests/Makefile.in dlls/Maketest.rules
dlls/snmpapi/Makefile
:
dlls/snmpapi/Makefile.in dlls/Makedll.rules
dlls/snmpapi/tests/Makefile
:
dlls/snmpapi/tests/Makefile.in dlls/Maketest.rules
dlls/spoolss/Makefile
:
dlls/spoolss/Makefile.in dlls/Makedll.rules
dlls/spoolss/tests/Makefile
:
dlls/spoolss/tests/Makefile.in dlls/Maketest.rules
dlls/stdole2.tlb/Makefile
:
dlls/stdole2.tlb/Makefile.in dlls/Makedll.rules
dlls/stdole32.tlb/Makefile
:
dlls/stdole32.tlb/Makefile.in dlls/Makedll.rules
dlls/sti/Makefile
:
dlls/sti/Makefile.in dlls/Makedll.rules
...
...
configure
View file @
cf122bab
...
...
@@ -20726,6 +20726,8 @@ ac_config_files="$ac_config_files dlls/snmpapi/tests/Makefile"
ac_config_files
=
"
$ac_config_files
dlls/spoolss/Makefile"
ac_config_files
=
"
$ac_config_files
dlls/spoolss/tests/Makefile"
ac_config_files
=
"
$ac_config_files
dlls/stdole2.tlb/Makefile"
ac_config_files
=
"
$ac_config_files
dlls/stdole32.tlb/Makefile"
...
...
@@ -21773,6 +21775,7 @@ do
"dlls/snmpapi/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/snmpapi/Makefile" ;;
"dlls/snmpapi/tests/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/snmpapi/tests/Makefile" ;;
"dlls/spoolss/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/spoolss/Makefile" ;;
"dlls/spoolss/tests/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/spoolss/tests/Makefile" ;;
"dlls/stdole2.tlb/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/stdole2.tlb/Makefile" ;;
"dlls/stdole32.tlb/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/stdole32.tlb/Makefile" ;;
"dlls/sti/Makefile") CONFIG_FILES="
$CONFIG_FILES
dlls/sti/Makefile" ;;
...
...
configure.ac
View file @
cf122bab
...
...
@@ -1783,6 +1783,7 @@ AC_CONFIG_FILES([dlls/shlwapi/tests/Makefile])
AC_CONFIG_FILES([dlls/snmpapi/Makefile])
AC_CONFIG_FILES([dlls/snmpapi/tests/Makefile])
AC_CONFIG_FILES([dlls/spoolss/Makefile])
AC_CONFIG_FILES([dlls/spoolss/tests/Makefile])
AC_CONFIG_FILES([dlls/stdole2.tlb/Makefile])
AC_CONFIG_FILES([dlls/stdole32.tlb/Makefile])
AC_CONFIG_FILES([dlls/sti/Makefile])
...
...
dlls/Makefile.in
View file @
cf122bab
...
...
@@ -299,6 +299,7 @@ TESTSUBDIRS = \
shell32/tests
\
shlwapi/tests
\
snmpapi/tests
\
spoolss/tests
\
urlmon/tests
\
user32/tests
\
usp10/tests
\
...
...
dlls/spoolss/tests/Makefile.in
0 → 100644
View file @
cf122bab
TOPSRCDIR
=
@top_srcdir@
TOPOBJDIR
=
../../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
TESTDLL
=
spoolss.dll
IMPORTS
=
kernel32
CTESTS
=
\
spoolss.c
@MAKE_TEST_RULES@
@DEPENDENCIES@
# everything below this line is overwritten by make depend
dlls/spoolss/tests/spoolss.c
0 → 100644
View file @
cf122bab
/*
* Unit test suite for the Spooler-Service helper DLL
*
* Copyright 2007 Detlef Riekenberg
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*
*/
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "wine/test.h"
/* ##### */
static
HMODULE
hwinspool
;
static
HMODULE
hspl
;
static
DWORD
(
WINAPI
*
pSplInitializeWinSpoolDrv
)(
LPVOID
*
);
#define WINSPOOL_TABLESIZE 16
static
LPVOID
fn_spl
[
WINSPOOL_TABLESIZE
];
static
LPVOID
fn_w2k
[
WINSPOOL_TABLESIZE
];
static
LPVOID
fn_xp
[
WINSPOOL_TABLESIZE
];
/* ########################### */
static
LPCSTR
load_functions
(
void
)
{
LPCSTR
ptr
;
ptr
=
"spoolss.dll"
;
hspl
=
LoadLibraryA
(
ptr
);
if
(
!
hspl
)
return
ptr
;
ptr
=
"SplInitializeWinSpoolDrv"
;
pSplInitializeWinSpoolDrv
=
(
void
*
)
GetProcAddress
(
hspl
,
ptr
);
if
(
!
pSplInitializeWinSpoolDrv
)
return
ptr
;
ptr
=
"winspool.drv"
;
hwinspool
=
LoadLibraryA
(
ptr
);
if
(
!
hwinspool
)
return
ptr
;
memset
(
fn_w2k
,
0xff
,
sizeof
(
fn_w2k
));
fn_w2k
[
0
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
"OpenPrinterW"
);
fn_w2k
[
1
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
"ClosePrinter"
);
fn_w2k
[
2
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
"SpoolerDevQueryPrintW"
);
fn_w2k
[
3
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
"SpoolerPrinterEvent"
);
fn_w2k
[
4
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
"DocumentPropertiesW"
);
fn_w2k
[
5
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
(
LPSTR
)
212
);
/* LoadPrinterDriver */
fn_w2k
[
6
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
"SetDefaultPrinterW"
);
fn_w2k
[
7
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
"GetDefaultPrinterW"
);
fn_w2k
[
8
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
(
LPSTR
)
213
);
/* RefCntLoadDriver */
fn_w2k
[
9
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
(
LPSTR
)
214
);
/* RefCntUnloadDriver */
fn_w2k
[
10
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
(
LPSTR
)
215
);
/* ForceUnloadDriver */
memset
(
fn_xp
,
0xff
,
sizeof
(
fn_xp
));
fn_xp
[
0
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
"OpenPrinterW"
);
fn_xp
[
1
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
"ClosePrinter"
);
fn_xp
[
2
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
"SpoolerDevQueryPrintW"
);
fn_xp
[
3
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
"SpoolerPrinterEvent"
);
fn_xp
[
4
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
"DocumentPropertiesW"
);
fn_xp
[
5
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
(
LPSTR
)
212
);
/* LoadPrinterDriver */
fn_xp
[
6
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
(
LPSTR
)
213
);
/* RefCntLoadDriver */
fn_xp
[
7
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
(
LPSTR
)
214
);
/* RefCntUnloadDriver */
fn_xp
[
8
]
=
(
void
*
)
GetProcAddress
(
hwinspool
,
(
LPSTR
)
215
);
/* ForceUnloadDriver */
return
NULL
;
}
/* ########################### */
static
void
test_SplInitializeWinSpoolDrv
(
VOID
)
{
DWORD
res
;
LONG
id
;
BOOL
is_xp
;
memset
(
fn_spl
,
0xff
,
sizeof
(
fn_spl
));
SetLastError
(
0xdeadbeef
);
res
=
pSplInitializeWinSpoolDrv
(
fn_spl
);
ok
(
res
,
"got %u with %u (expected '!= 0')
\n
"
,
res
,
GetLastError
());
/* functions 0 to 5 are the same with "spoolss.dll" from w2k and xp */
is_xp
=
(
fn_spl
[
6
]
==
fn_xp
[
6
]);
id
=
0
;
while
(
id
<
WINSPOOL_TABLESIZE
)
{
ok
(
fn_spl
[
id
]
==
(
is_xp
?
fn_xp
[
id
]
:
fn_w2k
[
id
]),
"(#%02u) spoolss: %p, xp: %p, w2k: %p
\n
"
,
id
,
fn_spl
[
id
],
fn_xp
[
id
],
fn_w2k
[
id
]);
id
++
;
}
}
/* ########################### */
START_TEST
(
spoolss
)
{
LPCSTR
ptr
;
/* spoolss.dll does not exist on win9x */
ptr
=
load_functions
();
if
(
ptr
)
{
skip
(
"%s not found
\n
"
,
ptr
);
return
;
}
test_SplInitializeWinSpoolDrv
();
}
programs/winetest/Makefile.in
View file @
cf122bab
...
...
@@ -77,6 +77,7 @@ TESTBINS = \
shell32_test.exe
\
shlwapi_test.exe
\
snmpapi_test.exe
\
spoolss_test.exe
\
urlmon_test.exe
\
user32_test.exe
\
usp10_test.exe
\
...
...
@@ -202,6 +203,8 @@ shlwapi_test.exe: $(DLLDIR)/shlwapi/tests/shlwapi_test.exe$(DLLEXT)
cp
$(DLLDIR)
/shlwapi/tests/shlwapi_test.exe
$(DLLEXT)
$@
&&
$(STRIP)
$@
snmpapi_test.exe
:
$(DLLDIR)/snmpapi/tests/snmpapi_test.exe$(DLLEXT)
cp
$(DLLDIR)
/snmpapi/tests/snmpapi_test.exe
$(DLLEXT)
$@
&&
$(STRIP)
$@
spoolss_test.exe
:
$(DLLDIR)/spoolss/tests/spoolss_test.exe$(DLLEXT)
cp
$(DLLDIR)
/spoolss/tests/spoolss_test.exe
$(DLLEXT)
$@
&&
$(STRIP)
$@
urlmon_test.exe
:
$(DLLDIR)/urlmon/tests/urlmon_test.exe$(DLLEXT)
cp
$(DLLDIR)
/urlmon/tests/urlmon_test.exe
$(DLLEXT)
$@
&&
$(STRIP)
$@
user32_test.exe
:
$(DLLDIR)/user32/tests/user32_test.exe$(DLLEXT)
...
...
programs/winetest/winetest.rc
View file @
cf122bab
...
...
@@ -135,6 +135,7 @@ shdocvw_test.exe TESTRES "shdocvw_test.exe"
shell32_test.exe TESTRES "shell32_test.exe"
shlwapi_test.exe TESTRES "shlwapi_test.exe"
snmpapi_test.exe TESTRES "snmpapi_test.exe"
spoolss_test.exe TESTRES "spoolss_test.exe"
urlmon_test.exe TESTRES "urlmon_test.exe"
user32_test.exe TESTRES "user32_test.exe"
usp10_test.exe TESTRES "usp10_test.exe"
...
...
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