d3dxof: Fix tzip and bzip files tests on all windows platform.

oldstable
Christian Costa 2010-03-08 08:55:52 +01:00 committed by Alexandre Julliard
parent d3369086ed
commit 41fdff866d
1 changed files with 19 additions and 10 deletions

View File

@ -55,8 +55,15 @@ char object[] =
char empty_txt_file[] = "xof 0302txt 0064";
char empty_bin_file[] = "xof 0302bin 0064";
char empty_tzip_file[] = "xof 0302tzip0064";
char empty_bzip_file[] = "xof 0302bzip0064";
/* MSZip data is generated with the command "MAKECAB.EXE /D Compress=ON /D CompressionType=MSZip file packed"
* Data in cab is after the filename (null terminated) and the 32-bit checksum:
* size (16-bit), packed_size (16-bit) and compressed data (with leading 16-bit CK signature)
* Data in x files is preceding by 2 16-bit words: size with xof header (16 bytes) and a 0 value
* It does not seem possible to generate a MSZip data with no byte, so put just 1 byte here */
/* "\n" packed with MSZip => not text */
char empty_tzip_file[] = "xof 0302tzip0064\x11\x00\x00\x00\x01\x00\x05\x00\x43\x4b\xe3\x02\x00";
/* "\n" packed with MSZip => not token (token are 16-bit and there is only 1 byte) */
char empty_bzip_file[] = "xof 0302bzip0064\x11\x00\x00\x00\x01\x00\x05\x00\x43\x4b\xe3\x02\x00";
char empty_cmp_file[] = "xof 0302cmp 0064";
char empty_xxxx_file[] = "xof 0302xxxx0064";
@ -224,11 +231,11 @@ static void test_file_types(void)
hr = IDirectXFile_RegisterTemplates(dxfile, empty_bin_file, strlen(empty_bin_file));
ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
hr = IDirectXFile_RegisterTemplates(dxfile, empty_tzip_file, strlen(empty_tzip_file));
ok(hr == DXFILEERR_BADALLOC, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
hr = IDirectXFile_RegisterTemplates(dxfile, empty_tzip_file, sizeof(empty_tzip_file) - 1);
todo_wine ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
hr = IDirectXFile_RegisterTemplates(dxfile, empty_bzip_file, strlen(empty_bzip_file));
ok(hr == DXFILEERR_BADALLOC, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
hr = IDirectXFile_RegisterTemplates(dxfile, empty_bzip_file, sizeof(empty_bzip_file) - 1);
todo_wine ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
hr = IDirectXFile_RegisterTemplates(dxfile, empty_cmp_file, strlen(empty_cmp_file));
ok(hr == DXFILEERR_BADFILETYPE, "IDirectXFileImpl_RegisterTemplates: %x\n", hr);
@ -249,14 +256,16 @@ static void test_file_types(void)
if (hr == DXFILE_OK) IDirectXFileEnumObject_Release(enum_object);
lminfo.lpMemory = empty_tzip_file;
lminfo.dSize = strlen(empty_tzip_file);
lminfo.dSize = sizeof(empty_tzip_file) - 1;
hr = IDirectXFile_CreateEnumObject(dxfile, &lminfo, DXFILELOAD_FROMMEMORY, &enum_object);
ok(hr == DXFILEERR_BADALLOC, "IDirectXFile_CreateEnumObject: %x\n", hr);
todo_wine ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
if (hr == DXFILE_OK) IDirectXFileEnumObject_Release(enum_object);
lminfo.lpMemory = empty_bzip_file;
lminfo.dSize = strlen(empty_bzip_file);
lminfo.dSize = sizeof(empty_bzip_file) - 1;
hr = IDirectXFile_CreateEnumObject(dxfile, &lminfo, DXFILELOAD_FROMMEMORY, &enum_object);
ok(hr == DXFILEERR_BADALLOC, "IDirectXFile_CreateEnumObject: %x\n", hr);
todo_wine ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr);
if (hr == DXFILE_OK) IDirectXFileEnumObject_Release(enum_object);
lminfo.lpMemory = empty_cmp_file;
lminfo.dSize = strlen(empty_cmp_file);