Vitaly Perov : cabinet: Added a test for FDICopy with an empty cabinet file .
Alexandre Julliard
julliard at winehq.org
Fri Apr 25 08:11:21 CDT 2008
Module: wine
Branch: master
Commit: 1077238143911d10650eb6ee9f0fa3e269ae7eb4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1077238143911d10650eb6ee9f0fa3e269ae7eb4
Author: Vitaly Perov <vitperov at etersoft.ru>
Date: Thu Apr 24 18:13:32 2008 +0400
cabinet: Added a test for FDICopy with an empty cabinet file.
---
dlls/cabinet/tests/fdi.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/dlls/cabinet/tests/fdi.c b/dlls/cabinet/tests/fdi.c
index 18745f2..bedcfa6 100644
--- a/dlls/cabinet/tests/fdi.c
+++ b/dlls/cabinet/tests/fdi.c
@@ -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();
}
More information about the wine-cvs
mailing list