Detlef Riekenberg : localspl/tests: Add test for ConfigurePortW.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Nov 17 04:54:10 CST 2006
Module: wine
Branch: master
Commit: 01ab25e4fe969e9cf1c462c6b1dbb9828b6af1d1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=01ab25e4fe969e9cf1c462c6b1dbb9828b6af1d1
Author: Detlef Riekenberg <wine.dev at web.de>
Date: Wed Nov 15 00:20:58 2006 +0100
localspl/tests: Add test for ConfigurePortW.
---
dlls/localspl/tests/localmon.c | 47 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 46 insertions(+), 1 deletions(-)
diff --git a/dlls/localspl/tests/localmon.c b/dlls/localspl/tests/localmon.c
index 766b553..e8e3b08 100644
--- a/dlls/localspl/tests/localmon.c
+++ b/dlls/localspl/tests/localmon.c
@@ -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();
}
More information about the wine-cvs
mailing list