[PATCH 3/3] Cleanup after SetupCopyOEMInf() tests

Paul Vriens Paul.Vriens.Wine at gmail.com
Wed Oct 7 08:35:43 CDT 2009


---
 dlls/setupapi/tests/misc.c |   23 ++++++++++++++++++++---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/dlls/setupapi/tests/misc.c b/dlls/setupapi/tests/misc.c
index 848f64c..586ac22 100644
--- a/dlls/setupapi/tests/misc.c
+++ b/dlls/setupapi/tests/misc.c
@@ -209,9 +209,8 @@ static void test_SetupCopyOEMInf(void)
        return;
     }
 
-    ok(GetLastError() == ERROR_FILE_NOT_FOUND ||
-       GetLastError() == ERROR_FILE_EXISTS, /* Win98 */
-       "Expected ERROR_FILE_NOT_FOUND or ERROR_FILE_EXISTS, got %d\n", GetLastError());
+    ok(GetLastError() == ERROR_FILE_NOT_FOUND,
+       "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError());
     ok(file_exists(tmpfile), "Expected tmpfile to exist\n");
 
     /* try SP_COPY_REPLACEONLY, dest does not exist */
@@ -307,6 +306,24 @@ static void test_SetupCopyOEMInf(void)
     ok(res == TRUE, "Expected TRUE, got %d\n", res);
     ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError());
     ok(!file_exists(path), "Expected source inf to not exist\n");
+
+    if (pSetupUninstallOEMInfA)
+    {
+        char *destfile = strrchr(dest, '\\') + 1;
+
+        SetLastError(0xdeadbeef);
+        ok(pSetupUninstallOEMInfA(destfile, 0, NULL), "Failed to uninstall '%s' : %d\n", destfile, GetLastError());;
+    }
+    else
+    {
+        /* Win9x/WinMe */
+        SetLastError(0xdeadbeef);
+        ok(DeleteFileA(dest), "Failed to delete file '%s' : %d\n", dest, GetLastError());
+
+        /* On WinMe we also need to remove the .pnf file */
+        *(strrchr(dest, '.') + 1) = 'p';
+        DeleteFileA(dest);
+    }
 }
 
 static void create_source_file(LPSTR filename, const BYTE *data, DWORD size)
-- 
1.6.2.5


--------------080506090800020504030504--



More information about the wine-patches mailing list