Juan Lang : crypt32: Remove last error checks on success.

Alexandre Julliard julliard at wine.codeweavers.com
Tue May 15 14:02:16 CDT 2007


Module: wine
Branch: master
Commit: d132d1944c8a1572a21e20b5fb7d62e94b5e39b3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d132d1944c8a1572a21e20b5fb7d62e94b5e39b3

Author: Juan Lang <juan_lang at yahoo.com>
Date:   Mon May 14 18:08:03 2007 -0700

crypt32: Remove last error checks on success.

---

 dlls/crypt32/tests/sip.c |   20 +-------------------
 1 files changed, 1 insertions(+), 19 deletions(-)

diff --git a/dlls/crypt32/tests/sip.c b/dlls/crypt32/tests/sip.c
index e34221f..236b3bb 100644
--- a/dlls/crypt32/tests/sip.c
+++ b/dlls/crypt32/tests/sip.c
@@ -85,8 +85,6 @@ static void test_AddRemoveProvider(void)
     SetLastError(0xdeadbeef);
     ret = CryptSIPAddProvider(&newprov);
     ok ( ret, "CryptSIPAddProvider should have succeeded\n");
-    ok ( GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n",
-     GetLastError());
 
     /* Dummy provider will be deleted, but the function still fails because
      * pwszIsFunctionName and pwszIsFunctionNameFmt2 are not present in the
@@ -113,15 +111,11 @@ static void test_AddRemoveProvider(void)
     SetLastError(0xdeadbeef);
     ret = CryptSIPAddProvider(&newprov);
     ok ( ret, "CryptSIPAddProvider should have succeeded\n");
-    ok ( GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n",
-     GetLastError());
 
     /* Dummy provider should be deleted */
     SetLastError(0xdeadbeef);
     ret = CryptSIPRemoveProvider(&actionid);
     ok ( ret, "CryptSIPRemoveProvider should have succeeded\n");
-    ok ( GetLastError() == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n",
-     GetLastError());
 }
 
 static void test_SIPRetrieveSubjectGUID(void)
@@ -176,8 +170,6 @@ static void test_SIPRetrieveSubjectGUID(void)
     memset(&subject, 1, sizeof(GUID));
     ret = CryptSIPRetrieveSubjectGuid(regeditPathW, NULL, &subject);
     ok ( ret, "Expected CryptSIPRetrieveSubjectGuid to succeed\n");
-    ok ( GetLastError() == ERROR_SUCCESS,
-        "Expected ERROR_SUCCESS, got 0x%08x\n", GetLastError());
     ok ( !memcmp(&subject, &unknownGUID, sizeof(GUID)),
         "Expected (%s), got (%s).\n", show_guid(&unknownGUID), show_guid(&subject));
 
@@ -187,8 +179,6 @@ static void test_SIPRetrieveSubjectGUID(void)
     memset(&subject, 1, sizeof(GUID));
     ret = CryptSIPRetrieveSubjectGuid(NULL, file, &subject);
     ok ( ret, "Expected CryptSIPRetrieveSubjectGuid to succeed\n");
-    ok ( GetLastError() == ERROR_SUCCESS,
-        "Expected ERROR_SUCCESS, got 0x%08x\n", GetLastError());
     ok ( !memcmp(&subject, &unknownGUID, sizeof(GUID)),
         "Expected (%s), got (%s).\n", show_guid(&unknownGUID), show_guid(&subject));
     CloseHandle(file);
@@ -199,8 +189,6 @@ static void test_SIPRetrieveSubjectGUID(void)
     memset(&subject, 1, sizeof(GUID));
     ret = CryptSIPRetrieveSubjectGuid(regeditPathW, file, &subject);
     ok ( ret, "Expected CryptSIPRetrieveSubjectGuid to succeed\n");
-    ok ( GetLastError() == ERROR_SUCCESS,
-        "Expected ERROR_SUCCESS, got 0x%08x\n", GetLastError());
     ok ( !memcmp(&subject, &unknownGUID, sizeof(GUID)),
         "Expected (%s), got (%s).\n", show_guid(&unknownGUID), show_guid(&subject));
     CloseHandle(file);
@@ -315,13 +303,11 @@ static void test_SIPLoad(void)
     todo_wine
     {
         ok ( ret, "Expected CryptSIPLoad to succeed\n");
-        /* This error will always be there as native searches for the function DllCanUnloadNow
+        /* On native the last error will always be ERROR_PROC_NOT_FOUND as native searches for the function DllCanUnloadNow
          * in WINTRUST.DLL (in this case). This function is not available in WINTRUST.DLL.
          * For now there's no need to implement this is Wine as I doubt any program will rely on
          * this last error when the call succeeded.
          */
-        ok ( GetLastError() == ERROR_PROC_NOT_FOUND,
-            "Expected ERROR_PROC_NOT_FOUND, got 0x%08x\n", GetLastError());
         ok( sdi.pfGet != (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected a function pointer to be loaded.\n");
     }
 
@@ -356,8 +342,6 @@ static void test_SIPLoad(void)
          * CryptSIPLoad will not try to search for the already mentioned DllCanUnloadNow.
          */
     }
-    ok ( GetLastError() == 0xdeadbeef,
-        "Expected 0xdeadbeef, got 0x%08x\n", GetLastError());
     todo_wine
         ok( sdi.pfGet != (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected a function pointer to be loaded.\n");
 
@@ -376,8 +360,6 @@ static void test_SIPLoad(void)
          */
         todo_wine
         {
-            ok ( GetLastError() == ERROR_PROC_NOT_FOUND,
-                "Expected ERROR_PROC_NOT_FOUND, got 0x%08x\n", GetLastError());
             ok( sdi.pfGet != (pCryptSIPGetSignedDataMsg)0xdeadbeef, "Expected a function pointer to be loaded.\n");
 
             /* This is another SIP but this test proves the function addresses are the same as




More information about the wine-cvs mailing list