Nicolas Le Cam : cabinet/tests: Split an incorrect test in two valid ones.

Alexandre Julliard julliard at winehq.org
Mon Jun 29 09:17:40 CDT 2009


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

Author: Nicolas Le Cam <niko.lecam at gmail.com>
Date:   Sat Jun 27 12:18:17 2009 +0200

cabinet/tests: Split an incorrect test in two valid ones.

---

 dlls/cabinet/tests/fdi.c |   35 ++++++++++++++++++++++++++++-------
 1 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/dlls/cabinet/tests/fdi.c b/dlls/cabinet/tests/fdi.c
index 011d94f..5d470fa 100644
--- a/dlls/cabinet/tests/fdi.c
+++ b/dlls/cabinet/tests/fdi.c
@@ -608,8 +608,6 @@ static void test_FDICopy(void)
     char name[] = "extract.cab";
     char path[MAX_PATH + 1];
 
-    GetCurrentDirectoryA(MAX_PATH, path);
-
     set_cab_parameters(&cabParams);
 
     hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
@@ -621,6 +619,31 @@ static void test_FDICopy(void)
 
     FCIDestroy(hfci);
 
+    lstrcpyA(path, CURR_DIR);
+
+    /* path doesn't have a trailing backslash */
+    if (lstrlenA(path) > 2)
+    {
+        hfdi = FDICreate(fdi_alloc, fdi_free, fdi_open, fdi_read,
+                         fdi_write, fdi_close, fdi_seek,
+                         cpuUNKNOWN, &erf);
+
+        SetLastError(0xdeadbeef);
+        ret = FDICopy(hfdi, name, path, 0, CopyProgress, NULL, 0);
+        ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
+        todo_wine
+        {
+            ok(GetLastError() == ERROR_INVALID_HANDLE,
+               "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
+        }
+
+        FDIDestroy(hfdi);
+    }
+    else
+        skip("Running on a root drive directory.\n");
+
+    lstrcatA(path, "\\");
+
     hfdi = FDICreate(fdi_alloc, fdi_free, fdi_open, fdi_read,
                      fdi_write, fdi_close, fdi_seek,
                      cpuUNKNOWN, &erf);
@@ -628,14 +651,12 @@ static void test_FDICopy(void)
     /* cabinet with no files or folders */
     SetLastError(0xdeadbeef);
     ret = FDICopy(hfdi, name, path, 0, CopyProgress, NULL, 0);
-    ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
     todo_wine
-    {
-        ok(GetLastError() == ERROR_INVALID_HANDLE,
-           "Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
-    }
+    ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
+    ok(GetLastError() == 0, "Expected 0f, got %d\n", GetLastError());
 
     FDIDestroy(hfdi);
+
     DeleteFileA(name);
 }
 




More information about the wine-cvs mailing list