version 2.1, 2005/02/15 02:07:20
|
version 2.2, 2005/02/15 07:11:25
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
*/ | */ |
| |
|
//#include <windows.h> |
#include <stdlib.h> | #include <stdlib.h> |
|
#include <string.h> |
|
//#include <io.h> |
|
//#include <fcntl.h> |
|
//#include <dos.h> |
|
#include <sys/stat.h> |
| |
#ifndef STANDALONE | #ifndef STANDALONE |
#include <wine/test.h> | #include <wine/test.h> |
|
|
| |
FNFDINOTIFY(notification_function) | FNFDINOTIFY(notification_function) |
{ | { |
printf(" FNFDINOTIFY just called with %d, %d \n",fdint,pfdin); |
printf(" FNFDINOTIFY real just called with %d, %d \n",fdint,pfdin); |
switch (fdint) | switch (fdint) |
{ | { |
case fdintCABINET_INFO: | case fdintCABINET_INFO: |
|
{ |
printf("fdintCABINET_INFO\n"); | printf("fdintCABINET_INFO\n"); |
return 0; | return 0; |
|
} |
case fdintPARTIAL_FILE: | case fdintPARTIAL_FILE: |
|
{ |
printf("dintPARTIAL_FILE\n"); | printf("dintPARTIAL_FILE\n"); |
return 0; | return 0; |
|
} |
case fdintCOPY_FILE: | case fdintCOPY_FILE: |
|
{ |
|
int fih = 0; |
|
char target[256]; |
|
|
printf("fdintCOPY_FILE\n"); | printf("fdintCOPY_FILE\n"); |
return 0; |
printf(" file name: %s\n", pfdin->psz1); |
|
sprintf(target, "./%s",pfdin->psz1); |
|
printf("%s\n",target); |
|
|
|
fih = real_open( |
|
target, |
|
_O_BINARY | _O_CREAT | _O_WRONLY | _O_SEQUENTIAL, |
|
_S_IREAD | _S_IWRITE |
|
); |
|
|
|
return fih; |
|
} |
|
|
| |
case fdintCLOSE_FILE_INFO: | case fdintCLOSE_FILE_INFO: |
|
{ |
|
|
printf("fdintCLOSE_FILE_INFO\n"); | printf("fdintCLOSE_FILE_INFO\n"); |
return 0; | return 0; |
|
} |
case fdintNEXT_CABINET: | case fdintNEXT_CABINET: |
|
{ |
|
|
printf("fdintNEXT_CABINET\n"); | printf("fdintNEXT_CABINET\n"); |
return 0; | return 0; |
} | } |
|
case fdintENUMERATE: |
|
{ |
|
printf("fdintENUMERATE\n"); |
|
return 0; |
|
} |
|
} |
return 0; | return 0; |
} | } |
| |
|
|
cabinfo.hasnext ); | cabinfo.hasnext ); |
} | } |
| |
static void CheckCabInfo(FDICABINETINFO cabinfo, |
static void CheckCabInfo(char * cabname, |
|
FDICABINETINFO cabinfo, |
long TcbCabinet, | long TcbCabinet, |
USHORT TcFolders, | USHORT TcFolders, |
USHORT TcFiles, | USHORT TcFiles, |
|
|
BOOL Thasprev, | BOOL Thasprev, |
BOOL Thasnext){ | BOOL Thasnext){ |
| |
ok ( cabinfo.cbCabinet == TcbCabinet, "FDIIsCabinet,cabinfo (FakeFile = Cabinet) data did not match! Failed!\n"); |
ok2 ( cabinfo.cbCabinet == TcbCabinet, "FDIIsCabinet,cabinfo %s data did not match! Failed!\n", cabname); |
ok ( cabinfo.cFolders == TcFolders, "FDIIsCabinet,cabinfo (FakeFile = Cabinet) data did not match! Failed!\n"); |
ok2 ( cabinfo.cFolders == TcFolders, "FDIIsCabinet,cabinfo %s data did not match! Failed!\n", cabname); |
ok ( cabinfo.cFiles == TcFiles, "FDIIsCabinet,cabinfo (FakeFile = Cabinet) data did not match! Failed!\n"); |
ok2 ( cabinfo.cFiles == TcFiles, "FDIIsCabinet,cabinfo %s data did not match! Failed!\n", cabname); |
ok ( cabinfo.setID == TsetID, "FDIIsCabinet,cabinfo (FakeFile = Cabinet) data did not match! Failed!\n"); |
ok2 ( cabinfo.setID == TsetID, "FDIIsCabinet,cabinfo %s data did not match! Failed!\n", cabname); |
ok ( cabinfo.iCabinet == TiCabinet, "FDIIsCabinet,cabinfo (FakeFile = Cabinet) data did not match! Failed!\n"); |
ok2 ( cabinfo.iCabinet == TiCabinet, "FDIIsCabinet,cabinfo %s data did not match! Failed!\n", cabname); |
ok ( cabinfo.fReserve == TfReserve, "FDIIsCabinet,cabinfo (FakeFile = Cabinet) data did not match! Failed!\n"); |
ok2 ( cabinfo.fReserve == TfReserve, "FDIIsCabinet,cabinfo %s data did not match! Failed!\n", cabname); |
ok ( cabinfo.hasprev == Thasprev, "FDIIsCabinet,cabinfo (FakeFile = Cabinet) data did not match! Failed!\n"); |
ok2 ( cabinfo.hasprev == Thasprev, "FDIIsCabinet,cabinfo %s data did not match! Failed!\n", cabname); |
ok ( cabinfo.hasnext == Thasnext, "FDIIsCabinet,cabinfo (FakeFile = Cabinet) data did not match! Failed!\n"); |
ok2 ( cabinfo.hasnext == Thasnext, "FDIIsCabinet,cabinfo %s data did not match! Failed!\n", cabname); |
} | } |
| |
| |
|
|
ok ( FDIIsCabinet( hfdi_unknown_fake, fakeFD, &fdi_cabinfo_simple) == TRUE, | ok ( FDIIsCabinet( hfdi_unknown_fake, fakeFD, &fdi_cabinfo_simple) == TRUE, |
"FDIIsCabinet (FakeFile = Cabinet) failed!\n"); | "FDIIsCabinet (FakeFile = Cabinet) failed!\n"); |
| |
CheckCabInfo(fdi_cabinfo_simple,117,1,1,12345,0,0,0,0); |
CheckCabInfo("simple.cab",fdi_cabinfo_simple,117,1,1,12345,0,0,0,0); |
| |
/* simply this with macros? | /* simply this with macros? |
yes, make one macro with inputs (cabname, testname, [expected values] ) --- using lambda notation | yes, make one macro with inputs (cabname, testname, [expected values] ) --- using lambda notation |
|
|
printf("---simple.cab\n"); | printf("---simple.cab\n"); |
FDICopy(hfdi_unknown_real, | FDICopy(hfdi_unknown_real, |
"simple.cab", | "simple.cab", |
"C:\\cygwin\\home\\Administrator\\group3\\wine\\dlls\\cabinet\\tests\\", |
"./", |
|
//"C:\\cygwin\\home\\Administrator\\group3\\wine\\dlls\\cabinet\\tests\\", |
0, | 0, |
notification_function, | notification_function, |
NULL, | NULL, |
NULL); | NULL); |
printf("---complex_none.cab\n"); |
/*printf("---complex_none.cab\n"); |
FDICopy(hfdi_unknown_real, | FDICopy(hfdi_unknown_real, |
"complex_none.cab", | "complex_none.cab", |
"C:\\cygwin\\home\\Administrator\\group3\\wine\\dlls\\cabinet\\tests\\", | "C:\\cygwin\\home\\Administrator\\group3\\wine\\dlls\\cabinet\\tests\\", |
|
|
notification_function, | notification_function, |
NULL, | NULL, |
NULL); | NULL); |
|
*/ |
| |
printf("Ending TestCopy()\n"); | printf("Ending TestCopy()\n"); |
} | } |