Hi Detlef,
Some test failures are shown on boxes with long printernames, for example:
http://test.winehq.org/data/17b7ee13fb55e872902be3156610e583e4cd324b/vista_test-on-vista/winspool.drv:info.html
http://test.winehq.org/data/17b7ee13fb55e872902be3156610e583e4cd324b/win7_153/winspool.drv:info.html
And indeed if I create a local printer with a very long name the cutoff
is one bigger than what the test is currently doing.
The attached patch fixes that.
I don't think this is enough though. Our implementation cuts of at '-1'
from the looks of it. The best test would probably to add a printer in
the tests and check for the size of the name in the strcut but I don't
know how easy/intrusive that is.
Any thoughts?
--
Cheers,
Paul.
diff --git a/dlls/winspool.drv/tests/info.c b/dlls/winspool.drv/tests/info.c
index ef726f4..d40ee1e 100644
--- a/dlls/winspool.drv/tests/info.c
+++ b/dlls/winspool.drv/tests/info.c
@@ -2412,7 +2412,7 @@ static void test_DEVMODE(const DEVMODE *dm, LONG dmSize,
LPCSTR exp_prn_name)
We skip the Tests on this Platform */
if (dm->dmSpecVersion || dm->dmDriverVersion || dm->dmDriverExtra) {
/* The 0-terminated Printername can be larger (MAX_PATH) than
CCHDEVICENAME */
- ok(!strncmp(exp_prn_name, (LPCSTR)dm->dmDeviceName, CCHDEVICENAME -1),
+ ok(!strncmp(exp_prn_name, (LPCSTR)dm->dmDeviceName, CCHDEVICENAME -2),
"expected '%s', got '%s'\n", exp_prn_name, dm->dmDeviceName);
ok(dm->dmSize + dm->dmDriverExtra == dmSize,
"%u != %d\n", dm->dmSize + dm->dmDriverExtra, dmSize);