I'm testing custom build of minizip, and discovered some issues with the tests in \test\test.c.
The initial creation of zip in memory stream fails if it is opened in read-write mode:
/* Write zip to memory stream */
mz_stream_mem_create(&write_mem_stream);
mz_stream_mem_set_grow_size(write_mem_stream, 128 * 1024);
mz_stream_open(write_mem_stream, NULL, MZ_OPEN_MODE_CREATE);
mz_zip_create(&zip_handle);
err = mz_zip_open(zip_handle, write_mem_stream, MZ_OPEN_MODE_READWRITE);
The error -107 (MZ_EXIST_ERROR) is returned from mz_stream_find_reverse (well, the stream is empty).
Changing MZ_OPEN_MODE_READWRITE to MZ_OPEN_MODE_WRITE solves the issue.
Is the test supposed to work with MZ_OPEN_MODE_READWRITE here?
I'm testing custom build of minizip, and discovered some issues with the tests in
\test\test.c.The initial creation of zip in memory stream fails if it is opened in
read-writemode:The error
-107(MZ_EXIST_ERROR) is returned frommz_stream_find_reverse(well, the stream is empty).Changing
MZ_OPEN_MODE_READWRITEtoMZ_OPEN_MODE_WRITEsolves the issue.Is the test supposed to work with
MZ_OPEN_MODE_READWRITEhere?