version 2.14, 2005/03/13 12:13:17
|
version 2.15, 2005/03/18 00:28:59
|
|
|
#include <stdio.h> | #include <stdio.h> |
#include <stdlib.h> | #include <stdlib.h> |
#include <string.h> | #include <string.h> |
#include <sys/stat.h> |
|
#include <stdarg.h> | #include <stdarg.h> |
#include <malloc.h> | #include <malloc.h> |
| |
|
|
#include "winerror.h" | #include "winerror.h" |
#include "fdi.h" | #include "fdi.h" |
| |
|
#ifndef WIN_ENV |
|
#include <msvcrt/fcntl.h> |
|
#include <msvcrt/sys/stat.h> |
|
#else |
|
#include <sys/stat.h> |
#include <fcntl.h> | #include <fcntl.h> |
|
#endif |
|
|
|
#define VERBOSE |
| |
#include "tvfs.h" | #include "tvfs.h" |
#include "data.h" |
#include "simplecab.h" |
| |
#ifndef STANDALONE | #ifndef STANDALONE |
#include <wine/test.h> | #include <wine/test.h> |
|
|
ok2 ( cabinfo.hasnext == Thasnext, "FDIIsCabinet,cabinfo %s data did not match! Failed!\n", cabname); | ok2 ( cabinfo.hasnext == Thasnext, "FDIIsCabinet,cabinfo %s data did not match! Failed!\n", cabname); |
} | } |
/* TODO : Message should contain variable values */ | /* TODO : Message should contain variable values */ |
/* TODO : Use ok - is ok in standalone different fron winetest? */ |
|
| |
static HFDI hfdi_unknown; |
static HFDI hfdi_simple; |
/* yes its global and ugly */ | /* yes its global and ugly */ |
| |
/* Is CPU386 or Unknown more commonly used? */ |
|
| |
static void TestCreate(void) { | static void TestCreate(void) { |
| |
ERF error_structure; | ERF error_structure; |
| |
trace("Starting TestCreate()\n"); | trace("Starting TestCreate()\n"); |
|
/* Is CPU386 or Unknown more commonly used? */ |
hfdi_unknown = FDICreate( |
hfdi_simple = FDICreate( |
final_alloc, | final_alloc, |
final_free, | final_free, |
tvfs_open, tvfs_read, tvfs_write, tvfs_close, tvfs_lseek, | tvfs_open, tvfs_read, tvfs_write, tvfs_close, tvfs_lseek, |
|
|
&error_structure | &error_structure |
); | ); |
| |
ok(hfdi_unknown != NULL,"FDICreate (CPU = unknown) (functions=tvfs) failed!\n"); |
ok(hfdi_simple != NULL,"FDICreate (CPU = unknown) (functions=tvfs) failed!\n"); |
| |
trace("Ending TestCreate()\n"); | trace("Ending TestCreate()\n"); |
} | } |
|
|
| |
int fd; | int fd; |
| |
FDICABINETINFO fdi_cabinfo_simple, fdi_cabinfo_complex; |
FDICABINETINFO fdi_cabinfo_simple; |
| |
trace("Starting TestInfo()\n"); | trace("Starting TestInfo()\n"); |
| |
tvfs_create( name_simple_cab, file_simple_cab, size_simple_cab); | tvfs_create( name_simple_cab, file_simple_cab, size_simple_cab); |
fd = tvfs_open( name_simple_cab, _O_BINARY, 0 ); | fd = tvfs_open( name_simple_cab, _O_BINARY, 0 ); |
| |
ok( FDIIsCabinet( hfdi_unknown, fd, &fdi_cabinfo_simple) == TRUE, |
ok( FDIIsCabinet( hfdi_simple, fd, &fdi_cabinfo_simple) == TRUE, |
"FDIIsCabinet (Virtual File = Simple.cab) failed!\n"); | "FDIIsCabinet (Virtual File = Simple.cab) failed!\n"); |
| |
printCabInfo(fdi_cabinfo_simple); | printCabInfo(fdi_cabinfo_simple); |
|
|
trace("---simple.cab\n"); | trace("---simple.cab\n"); |
| |
tvfs_create( name_simple_cab, file_simple_cab, size_simple_cab); | tvfs_create( name_simple_cab, file_simple_cab, size_simple_cab); |
FDICopy(hfdi_unknown, |
FDICopy(hfdi_simple, |
"simple.cab", | "simple.cab", |
"", | "", |
0, | 0, |
|
|
| |
static void TestDestroy(void) { | static void TestDestroy(void) { |
trace("Starting TestDestroy()\n"); | trace("Starting TestDestroy()\n"); |
ok(FDIDestroy(hfdi_unknown), "FDIDestroy (CPU = unknown) (functions=tvfs) failed!\n"); |
ok(FDIDestroy(hfdi_simple), "FDIDestroy (CPU = unknown) (functions=tvfs) failed!\n"); |
trace("Ending TestDestroy()\n"); | trace("Ending TestDestroy()\n"); |
} | } |
| |