cabinet: Added a test for FDICopy with an empty cabinet file.

This commit is contained in:
Vitaly Perov 2008-04-24 18:13:32 +04:00 committed by Alexandre Julliard
parent f51e0e2d26
commit 1077238143
1 changed files with 45 additions and 0 deletions

View File

@ -593,9 +593,54 @@ static void test_FDIIsCabinet(void)
delete_test_files();
}
INT_PTR __cdecl CopyProgress (FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
{
return 0;
}
static void test_FDICopy(void)
{
CCAB cabParams;
HFDI hfdi;
HFCI hfci;
ERF erf;
BOOL ret;
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,
fci_read, fci_write, fci_close, fci_seek,
fci_delete, get_temp_file, &cabParams, NULL);
ret = FCIFlushCabinet(hfci, FALSE, get_next_cabinet, progress);
ok(ret, "Failed to flush the cabinet\n");
FCIDestroy(hfci);
hfdi = FDICreate(fdi_alloc, fdi_free, fdi_open, fdi_read,
fdi_write, fdi_close, fdi_seek,
cpuUNKNOWN, &erf);
ret=FDICopy(hfdi, name, path, 0, CopyProgress, NULL, 0);
todo_wine
{
ok(ret, "Expected FDICopy to succeed\n");
}
FDIDestroy(hfdi);
DeleteFileA(name);
}
START_TEST(fdi)
{
test_FDICreate();
test_FDIDestroy();
test_FDIIsCabinet();
test_FDICopy();
}