8000 test_stream_mem() failures · Issue #417 · zlib-ng/minizip-ng · GitHub
[go: up one dir, main page]

Skip to content

test_stream_mem() failures #417

Closed
Closed

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 iss AE0E ue.

Is the test supposed to work with MZ_OPEN_MODE_READWRITE here?

Activity

  1. nmoinvaz commented on Sep 9, 2019

    @nmoinvaz
    Member

    The open modes on mz_zip_open work a bit differently. READ is for reading an existing zip, so it will try to read from the memory stream a zip file. WRITE would do zip creation to memory stream.

  2. Anton-V-K commented on Sep 9, 2019

    @Anton-V-K
    Author

    Thanks for the reply.
    The test stream is created (as new) for writing. So trying to read from it doesn't make much sense. Actually the test fails there in my build.

  3. nmoinvaz commented on Sep 14, 2019

    @nmoinvaz
    Member

    I have updated the test. Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      0