Paul Vriens : setupapi/tests: Cleanup after SetupCopyOEMInf() tests.

Alexandre Julliard julliard at winehq.org
Wed Oct 7 09:46:07 CDT 2009


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

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Wed Oct  7 15:35:43 2009 +0200

setupapi/tests: Cleanup after SetupCopyOEMInf() tests.

---

 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..f7ac6d1 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)




More information about the wine-cvs mailing list