Added additional files to unit tests.

Fixed compiler warnings.
This commit is contained in:
Nathan Moinvaziri 2018-11-21 23:14:22 -08:00
parent e9ae46ba27
commit 9897259b04
6 changed files with 8 additions and 9 deletions

View File

@ -672,22 +672,22 @@ if(BUILD_UNIT_TEST)
list(GET COMPRESS_METHOD_ARGS ${INDEX} COMPRESS_METHOD_ARG)
add_test(NAME ${COMPRESS_METHOD_NAME}-zip-${EXTRA_NAME}
COMMAND minizip ${COMPRESS_METHOD_ARG} -o ${EXTRA_ARGS}
test.zip test.c test.h empty.txt fuzz
result.zip test.c test.h empty.txt random.bin uniform.bin fuzz
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
add_test(NAME ${COMPRESS_METHOD_NAME}-list-${EXTRA_NAME}
COMMAND minizip -l ${EXTRA_ARGS} test.zip
COMMAND minizip -l ${EXTRA_ARGS} result.zip
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
if(NOT COMPRESS_ONLY)
add_test(NAME ${COMPRESS_METHOD_NAME}-unzip-${EXTRA_NAME}
COMMAND minizip -x -o ${EXTRA_ARGS} -d out test.zip
COMMAND minizip -x -o ${EXTRA_ARGS} -d out result.zip
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
endif()
endforeach()
endfunction()
if(NOT COMPRESS_ONLY)
add_test(NAME empty-unzip
COMMAND minizip -x -o ${EXTRA_ARGS} -d out empty.zip
add_test(NAME tiny-unzip
COMMAND minizip -x -o ${EXTRA_ARGS} -d out tiny.zip
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/test)
endif()
create_compress_tests("generic" "")

View File

@ -245,7 +245,7 @@ int32_t mz_stream_pkcrypt_write(void *stream, const void *buf, int32_t size)
do
{
if (bytes_to_write > (size - total_written));
if (bytes_to_write > (size - total_written))
bytes_to_write = (size - total_written);
for (i = 0; i < bytes_to_write; i += 1)

View File

@ -238,15 +238,13 @@ int32_t mz_stream_wzaes_write(void *stream, const void *buf, int32_t size)
int32_t bytes_to_write = sizeof(wzaes->buffer);
int32_t total_written = 0;
int32_t written = 0;
int32_t i = 0;
uint16_t t = 0;
if (size < 0)
return MZ_PARAM_ERROR;
do
{
if (bytes_to_write > (size - total_written));
if (bytes_to_write > (size - total_written))
bytes_to_write = (size - total_written);
memcpy(wzaes->buffer, buf_ptr, bytes_to_write);

BIN
test/random.bin Normal file

Binary file not shown.

1
test/uniform.bin Normal file

File diff suppressed because one or more lines are too long