Detlef Riekenberg : localui/tests: Handle different results from XP.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue May 29 08:05:24 CDT 2007
Module: wine
Branch: master
Commit: 0d1de51a157fae33db64772b76c47835459da416
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0d1de51a157fae33db64772b76c47835459da416
Author: Detlef Riekenberg <wine.dev at web.de>
Date: Mon May 28 00:57:35 2007 +0200
localui/tests: Handle different results from XP.
---
dlls/localui/tests/localui.c | 66 +++++++++++++++++++++++------------------
1 files changed, 37 insertions(+), 29 deletions(-)
diff --git a/dlls/localui/tests/localui.c b/dlls/localui/tests/localui.c
index 7965d3c..cb7a1cf 100644
--- a/dlls/localui/tests/localui.c
+++ b/dlls/localui/tests/localui.c
@@ -137,21 +137,24 @@ static void test_AddPortUI(void)
SetLastError(0xdeadbeef);
res = pAddPortUI(NULL, NULL, NULL, NULL);
- ok( !res && (GetLastError() == ERROR_UNKNOWN_PORT),
- "got %d with %u (expected '0' with ERROR_UNKNOWN_PORT)\n",
- res, GetLastError());
+ ok( !res &&
+ ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)),
+ "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or "
+ "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
SetLastError(0xdeadbeef);
res = pAddPortUI(NULL, NULL, emptyW, NULL);
- ok( !res && (GetLastError() == ERROR_UNKNOWN_PORT),
- "got %d with %u (expected '0' with ERROR_UNKNOWN_PORT)\n",
- res, GetLastError());
+ ok( !res &&
+ ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)),
+ "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or "
+ "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
SetLastError(0xdeadbeef);
res = pAddPortUI(NULL, NULL, does_not_existW, NULL);
- ok( !res && (GetLastError() == ERROR_UNKNOWN_PORT),
- "got %d with %u (expected '0' with ERROR_UNKNOWN_PORT)\n",
- res, GetLastError());
+ ok( !res &&
+ ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)),
+ "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or "
+ "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
if (winetest_interactive) {
SetLastError(0xdeadbeef);
@@ -191,24 +194,25 @@ static void test_ConfigurePortUI(void)
SetLastError(0xdeadbeef);
res = pConfigurePortUI(NULL, NULL, NULL);
- ok( !res && (GetLastError() == ERROR_UNKNOWN_PORT),
- "got %d with %u (expected '0' with ERROR_UNKNOWN_PORT)\n",
- res, GetLastError());
-
+ ok( !res &&
+ ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)),
+ "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or "
+ "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
SetLastError(0xdeadbeef);
res = pConfigurePortUI(NULL, NULL, emptyW);
- ok( !res && (GetLastError() == ERROR_UNKNOWN_PORT),
- "got %d with %u (expected '0' with ERROR_UNKNOWN_PORT)\n",
- res, GetLastError());
+ ok( !res &&
+ ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)),
+ "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or "
+ "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
SetLastError(0xdeadbeef);
res = pConfigurePortUI(NULL, NULL, does_not_existW);
- ok( !res && (GetLastError() == ERROR_UNKNOWN_PORT),
- "got %d with %u (expected '0' with ERROR_UNKNOWN_PORT)\n",
- res, GetLastError());
-
+ ok( !res &&
+ ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)),
+ "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or "
+ "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
if (winetest_interactive && lpt_present) {
SetLastError(0xdeadbeef);
@@ -222,9 +226,10 @@ static void test_ConfigurePortUI(void)
if (lpt_absent) {
SetLastError(0xdeadbeef);
res = pConfigurePortUI(NULL, NULL, lpt_absent);
- ok( !res && (GetLastError() == ERROR_UNKNOWN_PORT),
- "got %d with %u (expected '0' with ERROR_UNKNOWN_PORT)\n",
- res, GetLastError());
+ ok( !res &&
+ ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)),
+ "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or "
+ "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
}
if (winetest_interactive && com_present) {
@@ -239,17 +244,20 @@ static void test_ConfigurePortUI(void)
if (com_absent) {
SetLastError(0xdeadbeef);
res = pConfigurePortUI(NULL, NULL, com_absent);
- ok( !res && (GetLastError() == ERROR_UNKNOWN_PORT),
- "got %d with %u (expected '0' with ERROR_UNKNOWN_PORT)\n",
- res, GetLastError());
+ ok( !res &&
+ ((GetLastError() == ERROR_UNKNOWN_PORT) || (GetLastError() == ERROR_INVALID_PRINTER_NAME)),
+ "got %d with %u (expected '0' with: ERROR_UNKNOWN_PORT or "
+ "ERROR_INVALID_PRINTER_NAME)\n", res, GetLastError());
+
}
if (winetest_interactive && file_present) {
SetLastError(0xdeadbeef);
res = pConfigurePortUI(NULL, NULL, portname_fileW);
- ok( !res && (GetLastError() == ERROR_CANCELLED),
- "got %d with %u (expected '0' with ERROR_CANCELLED)\n",
- res, GetLastError());
+ ok( !res &&
+ ((GetLastError() == ERROR_CANCELLED) || (GetLastError() == ERROR_ACCESS_DENIED)),
+ "got %d with %u (expected '0' with: ERROR_CANCELLED or "
+ "ERROR_ACCESS_DENIED)\n", res, GetLastError());
}
}
More information about the wine-cvs
mailing list