[PATCH 2/2] wininet: Remove most GetLastError tests for IsDomainLegalCookieDomainW

Detlef Riekenberg wine.dev at web.de
Fri Jan 25 07:26:20 CST 2013


A different option for fixing the IE10 failures:

IsDomainLegalCookieDomain returns many different lasterror codes.
across multiple windows/ie versions and the function ois not documented.

Using lasterror might be the wrong asumption, so ignoring GetLastError()
is also an option to fix the IE10 test failures.

--
By by ... Detlef
---
 dlls/wininet/tests/internet.c |   50 +----------------------------------------
 1 files changed, 1 insertions(+), 49 deletions(-)

diff --git a/dlls/wininet/tests/internet.c b/dlls/wininet/tests/internet.c
index e9e2239..3dc2233 100644
--- a/dlls/wininet/tests/internet.c
+++ b/dlls/wininet/tests/internet.c
@@ -878,7 +878,6 @@ static void InternetTimeToSystemTimeW_test(void)
 static void test_IsDomainLegalCookieDomainW(void)
 {
     BOOL ret;
-    DWORD error;
     static const WCHAR empty[]          = {0};
     static const WCHAR dot[]            = {'.',0};
     static const WCHAR uk[]             = {'u','k',0};
@@ -895,8 +894,7 @@ static void test_IsDomainLegalCookieDomainW(void)
 
     SetLastError(0xdeadbeef);
     ret = pIsDomainLegalCookieDomainW(NULL, NULL);
-    error = GetLastError();
-    if (!ret && error == ERROR_CALL_NOT_IMPLEMENTED)
+    if (!ret && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED))
     {
         win_skip("IsDomainLegalCookieDomainW is not implemented\n");
         return;
@@ -904,82 +902,46 @@ static void test_IsDomainLegalCookieDomainW(void)
     ok(!ret ||
         broken(ret), /* IE6 */
         "IsDomainLegalCookieDomainW succeeded\n");
-    ok(error == ERROR_INVALID_PARAMETER, "got %u expected ERROR_INVALID_PARAMETER\n", error);
 
     SetLastError(0xdeadbeef);
     ret = pIsDomainLegalCookieDomainW(com, NULL);
-    error = GetLastError();
     ok(!ret, "IsDomainLegalCookieDomainW succeeded\n");
-    ok(error == ERROR_INVALID_PARAMETER, "got %u expected ERROR_INVALID_PARAMETER\n", error);
 
     SetLastError(0xdeadbeef);
     ret = pIsDomainLegalCookieDomainW(NULL, gmail_com);
-    error = GetLastError();
     ok(!ret, "IsDomainLegalCookieDomainW succeeded\n");
-    ok(error == ERROR_INVALID_PARAMETER, "got %u expected ERROR_INVALID_PARAMETER\n", error);
 
     SetLastError(0xdeadbeef);
     ret = pIsDomainLegalCookieDomainW(empty, gmail_com);
-    error = GetLastError();
     ok(!ret, "IsDomainLegalCookieDomainW succeeded\n");
-    ok(error == ERROR_INVALID_NAME ||
-        broken(error == ERROR_INVALID_PARAMETER), /* IE6 */
-        "got %u expected ERROR_INVALID_NAME\n", error);
 
     SetLastError(0xdeadbeef);
     ret = pIsDomainLegalCookieDomainW(com, empty);
-    error = GetLastError();
     ok(!ret, "IsDomainLegalCookieDomainW succeeded\n");
-    ok(error == ERROR_INVALID_NAME ||
-        broken(error == ERROR_INVALID_PARAMETER), /* IE6 */
-        "got %u expected ERROR_INVALID_NAME\n", error);
 
     SetLastError(0xdeadbeef);
     ret = pIsDomainLegalCookieDomainW(gmail_com, dot);
-    error = GetLastError();
     ok(!ret, "IsDomainLegalCookieDomainW succeeded\n");
-    ok(error == ERROR_INVALID_NAME ||
-        broken(error == 0xdeadbeef), /* IE6 */
-        "got %u expected ERROR_INVALID_NAME\n", error);
 
     SetLastError(0xdeadbeef);
     ret = pIsDomainLegalCookieDomainW(dot, gmail_com);
-    error = GetLastError();
     ok(!ret, "IsDomainLegalCookieDomainW succeeded\n");
-    ok(error == ERROR_INVALID_NAME ||
-        broken(error == 0xdeadbeef), /* IE6 */
-        "got %u expected ERROR_INVALID_NAME\n", error);
 
     SetLastError(0xdeadbeef);
     ret = pIsDomainLegalCookieDomainW(com, com);
-    error = GetLastError();
     ok(!ret, "IsDomainLegalCookieDomainW succeeded\n");
-    ok(error == 0xdeadbeef, "got %u expected 0xdeadbeef\n", error);
 
     SetLastError(0xdeadbeef);
     ret = pIsDomainLegalCookieDomainW(com, dot_com);
-    error = GetLastError();
     ok(!ret, "IsDomainLegalCookieDomainW succeeded\n");
-    ok(error == ERROR_INVALID_NAME ||
-        broken(error == 0xdeadbeef), /* IE6 */
-        "got %u expected ERROR_INVALID_NAME\n", error);
 
     SetLastError(0xdeadbeef);
     ret = pIsDomainLegalCookieDomainW(dot_com, com);
-    error = GetLastError();
     ok(!ret, "IsDomainLegalCookieDomainW succeeded\n");
-    ok(error == ERROR_INVALID_NAME ||
-        broken(error == 0xdeadbeef), /* IE6 */
-        "got %u expected ERROR_INVALID_NAME\n", error);
 
     SetLastError(0xdeadbeef);
     ret = pIsDomainLegalCookieDomainW(com, gmail_com);
-    error = GetLastError();
     ok(!ret, "IsDomainLegalCookieDomainW succeeded\n");
-    ok(error == ERROR_SXS_KEY_NOT_FOUND ||
-        error == ERROR_SUCCESS || /* IE8 on W2K3 */
-        error == 0xdeadbeef, /* up to IE7 */
-        "unexpected error: %u\n", error);
 
     ret = pIsDomainLegalCookieDomainW(gmail_com, gmail_com);
     ok(ret, "IsDomainLegalCookieDomainW failed\n");
@@ -992,13 +954,7 @@ static void test_IsDomainLegalCookieDomainW(void)
 
     SetLastError(0xdeadbeef);
     ret = pIsDomainLegalCookieDomainW(gmail_co_uk, co_uk);
-    error = GetLastError();
     ok(!ret, "IsDomainLegalCookieDomainW succeeded\n");
-    ok(error == ERROR_SXS_KEY_NOT_FOUND || /* IE8 on XP */
-        error == ERROR_FILE_NOT_FOUND ||   /* IE8 on Vista */
-        error == ERROR_SUCCESS || /* IE8 on W2K3 */
-        error == 0xdeadbeef, /* up to IE7 */
-        "unexpected error: %u\n", error);
 
     ret = pIsDomainLegalCookieDomainW(uk, co_uk);
     ok(!ret, "IsDomainLegalCookieDomainW succeeded\n");
@@ -1017,11 +973,7 @@ static void test_IsDomainLegalCookieDomainW(void)
 
     SetLastError(0xdeadbeef);
     ret = pIsDomainLegalCookieDomainW(dot_gmail_com, mail_gmail_com);
-    error = GetLastError();
     ok(!ret, "IsDomainLegalCookieDomainW succeeded\n");
-    ok(error == ERROR_INVALID_NAME ||
-        broken(error == 0xdeadbeef), /* IE6 */
-        "got %u expected ERROR_INVALID_NAME\n", error);
 
     ret = pIsDomainLegalCookieDomainW(gmail_com, mail_gmail_com);
     ok(ret, "IsDomainLegalCookieDomainW failed\n");
-- 
1.7.5.4




More information about the wine-patches mailing list