Commit 387e415f authored by Nicolas Le Cam's avatar Nicolas Le Cam Committed by Alexandre Julliard

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

parent 027bc810
...@@ -608,8 +608,6 @@ static void test_FDICopy(void) ...@@ -608,8 +608,6 @@ static void test_FDICopy(void)
char name[] = "extract.cab"; char name[] = "extract.cab";
char path[MAX_PATH + 1]; char path[MAX_PATH + 1];
GetCurrentDirectoryA(MAX_PATH, path);
set_cab_parameters(&cabParams); set_cab_parameters(&cabParams);
hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open, hfci = FCICreate(&erf, file_placed, mem_alloc, mem_free, fci_open,
...@@ -621,6 +619,31 @@ static void test_FDICopy(void) ...@@ -621,6 +619,31 @@ static void test_FDICopy(void)
FCIDestroy(hfci); 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, hfdi = FDICreate(fdi_alloc, fdi_free, fdi_open, fdi_read,
fdi_write, fdi_close, fdi_seek, fdi_write, fdi_close, fdi_seek,
cpuUNKNOWN, &erf); cpuUNKNOWN, &erf);
...@@ -628,14 +651,12 @@ static void test_FDICopy(void) ...@@ -628,14 +651,12 @@ static void test_FDICopy(void)
/* cabinet with no files or folders */ /* cabinet with no files or folders */
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
ret = FDICopy(hfdi, name, path, 0, CopyProgress, NULL, 0); ret = FDICopy(hfdi, name, path, 0, CopyProgress, NULL, 0);
ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
todo_wine todo_wine
{ ok(ret == TRUE, "Expected TRUE, got %d\n", ret);
ok(GetLastError() == ERROR_INVALID_HANDLE, ok(GetLastError() == 0, "Expected 0f, got %d\n", GetLastError());
"Expected ERROR_INVALID_HANDLE, got %d\n", GetLastError());
}
FDIDestroy(hfdi); FDIDestroy(hfdi);
DeleteFileA(name); DeleteFileA(name);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment