Skip to content

test_stream_mem() failures #417

@Anton-V-K

Description

@Anton-V-K

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion about something

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions