localspl/tests: Add test for ConfigurePortW.

This commit is contained in:
Detlef Riekenberg 2006-11-15 00:20:58 +01:00 committed by Alexandre Julliard
parent b8a2e3b8a4
commit 01ab25e4fe
1 changed files with 46 additions and 1 deletions

View File

@ -67,8 +67,51 @@ static WCHAR Monitors_LocalPortW[] = { \
'P','r','i','n','t','\\',
'M','o','n','i','t','o','r','s','\\',
'L','o','c','a','l',' ','P','o','r','t',0};
static WCHAR portname_com1W[] = {'C','O','M','1',':',0};
static WCHAR portname_fileW[] = {'F','I','L','E',':',0};
static WCHAR portname_lpt1W[] = {'L','P','T','1',':',0};
/* ########################### */
/* ##### */
static void test_ConfigurePort(void)
{
DWORD res;
if (!pConfigurePort) return;
#if 0
/* NT4 crash on this test */
res = pConfigurePort(NULL, 0, NULL);
#endif
/* Testing-Results (localmon.dll from NT4.0):
- Case of Portname is ignored
- "COM1:" and "COM01:" are the same (Compared by value)
- Portname without ":" => Dialog "Nothing to configure" comes up; Success
- "LPT1:", "LPT0:" and "LPT:" are the same (Numbers in "LPT:" are ignored)
- Empty Servername (LPT1:) => Dialog comes up (Servername is ignored)
- "FILE:" => Dialog "Nothing to configure" comes up; Success
- Empty Portname => => Dialog "Nothing to configure" comes up; Success
- Port "does_not_exist" => Dialog "Nothing to configure" comes up; Success
*/
if (winetest_interactive > 0) {
SetLastError(0xdeadbeef);
res = pConfigurePort(NULL, 0, portname_com1W);
trace("returned %d with %d\n", res, GetLastError());
SetLastError(0xdeadbeef);
res = pConfigurePort(NULL, 0, portname_lpt1W);
trace("returned %d with %d\n", res, GetLastError());
SetLastError(0xdeadbeef);
res = pConfigurePort(NULL, 0, portname_fileW);
trace("returned %d with %d\n", res, GetLastError());
}
}
/* ########################### */
static void test_EnumPorts(void)
{
@ -241,5 +284,7 @@ START_TEST(localmon)
GET_MONITOR_FUNC(XcvClosePort);
}
test_InitializePrintMonitor();
test_ConfigurePort();
test_EnumPorts();
}