nih-at / libzip

A C library for reading, creating, and modifying zip archives.
https://libzip.org/
Other
835 stars 271 forks source link

[Windows] error C2065: S_IWUSR #166

Closed OgreTransporter closed 4 years ago

OgreTransporter commented 4 years ago

Compiler Error

zip_source_filep.c(212): error C2065: "S_IWUSR": nichtdeklarierter Bezeichner

libzip Version commit cebe19a66d115c0e8218d8eed6894cf3bf8f0fa8

Operating System and Compiler Windows 10, Visual Studio 2017

Additional context The problem is in line 212 of the file zip_source_filep.c:

https://github.com/nih-at/libzip/blob/066a1b1f9b8e58773ab7d23d8176507f9c866e5e/lib/zip_source_filep.c#L212

The constant S_IWUSR does not exist under Windows. Either the last commit is undone at this position, or the following code is added after the includes at the beginning of the file:

#ifdef _WIN32
#ifndef S_IRUSR
#define S_IRUSR _S_IREAD
#endif
#ifndef S_IWUSR
#define S_IWUSR _S_IWRITE
#endif
#endif
OgreTransporter commented 4 years ago

https://ci.appveyor.com/project/0-wiz-0/libzip/builds/32273199/job/3c8a61c5uawfq1v8

Line 629:

C:\projects\libzip\lib\zip_source_filep.c(212): error C2065: 'S_IWUSR': undeclared identifier [C:\projects\libzip\build\lib\zip.vcxproj]

Maybe it's a good idea to read the AppVeyor error messages?

0-wiz-0 commented 4 years ago

Thanks, fixed in https://github.com/nih-at/libzip/commit/d8b0c3199a1e0beeaa81e17460e34f53bfc59f70

Appyveyor consistently fails because there is one failing test, so we don't notice when it breaks for other reasons. Help in fixing the broken test would be appreciated very much. We don't develop on Windows and are relying on Windows developers for help. Could you please take a look? It's about junk_at_start.test, see e.g. https://ci.appveyor.com/project/0-wiz-0/libzip/builds/32262144/job/63iworih83x2w54g The test can be run with runtest junk_at_start.test, with "-k" it will keep the sandbox used for preparing running the test so the input files are in the right place. The arguments to ziptool_regress are after the args command in the file junk_at_start.test.

OgreTransporter commented 4 years ago

You're welcome!

I looked at the tests. First, CMake is missing a search for Perl:

1>------ Erstellen gestartet: Projekt: RUN_TESTS, Konfiguration: Debug x64 ------
1>Test project D:/workspace/libzip/build
1>        Start   1: add_dir.test
1>Could not find executable perl
1>Looked in the following places:
1>perl
1>perl.exe
1>Debug/perl
1>Debug/perl.exe
1>Debug/perl
1>Debug/perl.exe
1>Unable to find executable: perl

If perl should be used for the tests, CMake should also search for Perl first or display an error message. For example:

find_package(Perl REQUIRED)
set(path "$<TARGET_FILE_DIR:zip>;$ENV{PATH}")
if (TARGET zlib)
  set(path "$<TARGET_FILE_DIR:zlib>;${path}")
endif()
if(WIN32)
  get_filename_component(PERL_DIR ${PERL_EXECUTABLE} DIRECTORY)
  set(path "${PERL_DIR};${path}")
endif()
string(REPLACE ";" "\\;" path "${path}")

FOREACH(CASE ${EXTRA_TESTS})
  ADD_TEST(NAME ${CASE} COMMAND ${PERL_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/runtest --bin-sub-directory $<CONFIG> ${CMAKE_CURRENT_SOURCE_DIR}/${CASE})
  SET_TESTS_PROPERTIES(${CASE} PROPERTIES SKIP_RETURN_CODE 77)
  SET_TESTS_PROPERTIES(${CASE} PROPERTIES ENVIRONMENT "PATH=${path}")
ENDFOREACH()

What is Perl needed for anyway? The test system seems to be built very complicated. Some C programs are created, but they are not related to each other. The CTest then apparently calls a Perl script that performs the actual test. Why not a direct C solution like googletest? Then you only need to let CTest do it and it is easier to debug. What are all these programs for? Are they all needed for the tests? Then there is no information in which order they have to be built.

71/134 Test  #71: junk_at_start.test ...............................***Failed    0.15 sec
Unexpected exit status:
-0
+1
Unexpected output:
--- expected
+++ got
-3 entries in archive
Unexpected error output:
--- expected
+++ got
+can't open zip archive 'junk-at-start.zzip': Not a zip archive
junk_at_start -- FAIL: exit status, output, error output

Now to the actual test: can't open zip archive 'junk-at-start.zzip': Not a zip Archive

Yes, a file junk-at-start.zzip does not exist either. The file in the regress directory is called junk-at-start.zip. zip and not zzip. Which program is executed for the test with which parameters (arguments, environment variables)? I can also debug this directly. The Perl script does not help me.

By the way, this is the test result on my computer:

1>------ Erstellen gestartet: Projekt: RUN_TESTS, Konfiguration: Debug x64 ------
1>Test project D:/Jenkins/workspace/libzip/build
1>        Start   1: add_dir.test
1>  1/134 Test   #1: add_dir.test .....................................***Failed    0.17 sec
1>        Start   2: add_from_buffer.test
1>  2/134 Test   #2: add_from_buffer.test .............................***Failed    0.16 sec
1>        Start   3: add_from_file.test
1>  3/134 Test   #3: add_from_file.test ...............................***Failed    0.16 sec
1>        Start   4: add_from_file_duplicate.test
1>  4/134 Test   #4: add_from_file_duplicate.test .....................***Failed    0.16 sec
1>        Start   5: add_from_file_twice_duplicate.test
1>  5/134 Test   #5: add_from_file_twice_duplicate.test ...............***Failed    0.16 sec
1>        Start   6: add_from_filep.test
1>  6/134 Test   #6: add_from_filep.test ..............................***Failed    0.15 sec
1>        Start   7: add_from_stdin.test
1>  7/134 Test   #7: add_from_stdin.test ..............................***Skipped   0.12 sec
1>        Start   8: add_from_zip_closed.test
1>  8/134 Test   #8: add_from_zip_closed.test .........................   Passed    0.15 sec
1>        Start   9: add_from_zip_deflated.test
1>  9/134 Test   #9: add_from_zip_deflated.test .......................***Failed    0.16 sec
1>        Start  10: add_from_zip_deflated2.test
1> 10/134 Test  #10: add_from_zip_deflated2.test ......................***Failed    0.16 sec
1>        Start  11: add_from_zip_partial_deflated.test
1> 11/134 Test  #11: add_from_zip_partial_deflated.test ...............***Failed    0.16 sec
1>        Start  12: add_from_zip_partial_stored.test
1> 12/134 Test  #12: add_from_zip_partial_stored.test .................***Failed    0.16 sec
1>        Start  13: add_from_zip_stored.test
1> 13/134 Test  #13: add_from_zip_stored.test .........................***Failed    0.17 sec
1>        Start  14: add_stored.test
1> 14/134 Test  #14: add_stored.test ..................................***Failed    0.16 sec
1>        Start  15: add_stored_in_memory.test
1> 15/134 Test  #15: add_stored_in_memory.test ........................***Failed    0.16 sec
1>        Start  16: buffer-fragment-read.test
1> 16/134 Test  #16: buffer-fragment-read.test ........................***Failed    0.16 sec
1>        Start  17: buffer-fragment-write.test
1> 17/134 Test  #17: buffer-fragment-write.test .......................***Failed    0.17 sec
1>        Start  18: cancel_45.test
1> 18/134 Test  #18: cancel_45.test ...................................   Passed    0.16 sec
1>        Start  19: cancel_90.test
1> 19/134 Test  #19: cancel_90.test ...................................   Passed    0.16 sec
1>        Start  20: clone-buffer-add.test
1> 20/134 Test  #20: clone-buffer-add.test ............................   Passed    0.16 sec
1>        Start  21: clone-buffer-delete.test
1> 21/134 Test  #21: clone-buffer-delete.test .........................   Passed    0.15 sec
1>        Start  22: clone-buffer-replace.test
1> 22/134 Test  #22: clone-buffer-replace.test ........................   Passed    0.15 sec
1>        Start  23: clone-fs-add.test
1> 23/134 Test  #23: clone-fs-add.test ................................***Skipped   0.13 sec
1>        Start  24: clone-fs-delete.test
1> 24/134 Test  #24: clone-fs-delete.test .............................***Skipped   0.13 sec
1>        Start  25: clone-fs-replace.test
1> 25/134 Test  #25: clone-fs-replace.test ............................***Skipped   0.13 sec
1>        Start  26: cm-default.test
1> 26/134 Test  #26: cm-default.test ..................................***Failed    0.17 sec
1>        Start  27: count_entries.test
1> 27/134 Test  #27: count_entries.test ...............................***Failed    0.12 sec
1>        Start  28: decrypt-correct-password-aes128.test
1> 28/134 Test  #28: decrypt-correct-password-aes128.test .............   Passed    0.15 sec
1>        Start  29: decrypt-correct-password-aes192.test
1> 29/134 Test  #29: decrypt-correct-password-aes192.test .............   Passed    0.15 sec
1>        Start  30: decrypt-correct-password-aes256.test
1> 30/134 Test  #30: decrypt-correct-password-aes256.test .............   Passed    0.15 sec
1>        Start  31: decrypt-correct-password-pkware.test
1> 31/134 Test  #31: decrypt-correct-password-pkware.test .............   Passed    0.15 sec
1>        Start  32: decrypt-no-password-aes256.test
1> 32/134 Test  #32: decrypt-no-password-aes256.test ..................   Passed    0.15 sec
1>        Start  33: decrypt-wrong-password-aes128.test
1> 33/134 Test  #33: decrypt-wrong-password-aes128.test ...............   Passed    0.15 sec
1>        Start  34: decrypt-wrong-password-aes192.test
1> 34/134 Test  #34: decrypt-wrong-password-aes192.test ...............   Passed    0.16 sec
1>        Start  35: decrypt-wrong-password-aes256.test
1> 35/134 Test  #35: decrypt-wrong-password-aes256.test ...............   Passed    0.15 sec
1>        Start  36: decrypt-wrong-password-pkware.test
1> 36/134 Test  #36: decrypt-wrong-password-pkware.test ...............   Passed    0.15 sec
1>        Start  37: delete_add_same.test
1> 37/134 Test  #37: delete_add_same.test .............................***Failed    0.17 sec
1>        Start  38: delete_invalid.test
1> 38/134 Test  #38: delete_invalid.test ..............................   Passed    0.15 sec
1>        Start  39: delete_last.test
1> 39/134 Test  #39: delete_last.test .................................   Passed    0.15 sec
1>        Start  40: delete_multiple_last.test
1> 40/134 Test  #40: delete_multiple_last.test ........................   Passed    0.15 sec
1>        Start  41: delete_multiple_partial.test
1> 41/134 Test  #41: delete_multiple_partial.test .....................***Failed    0.17 sec
1>        Start  42: delete_renamed_rename.test
1> 42/134 Test  #42: delete_renamed_rename.test .......................***Failed    0.17 sec
1>        Start  43: encrypt.test
1> 43/134 Test  #43: encrypt.test .....................................   Passed    0.15 sec
1>        Start  44: encryption-nonrandom-aes128.test
1> 44/134 Test  #44: encryption-nonrandom-aes128.test .................***Failed    0.17 sec
1>        Start  45: encryption-nonrandom-aes192.test
1> 45/134 Test  #45: encryption-nonrandom-aes192.test .................***Failed    0.17 sec
1>        Start  46: encryption-nonrandom-aes256.test
1> 46/134 Test  #46: encryption-nonrandom-aes256.test .................***Failed    0.17 sec
1>        Start  47: encryption-nonrandom-pkware.test
1> 47/134 Test  #47: encryption-nonrandom-pkware.test .................***Failed    0.18 sec
1>        Start  48: encryption-remove.test
1> 48/134 Test  #48: encryption-remove.test ...........................   Passed    0.15 sec
1>        Start  49: extra_add.test
1> 49/134 Test  #49: extra_add.test ...................................***Failed    0.16 sec
1>        Start  50: extra_add_multiple.test
1> 50/134 Test  #50: extra_add_multiple.test ..........................***Failed    0.16 sec
1>        Start  51: extra_count.test
1> 51/134 Test  #51: extra_count.test .................................***Failed    0.16 sec
1>        Start  52: extra_count_by_id.test
1> 52/134 Test  #52: extra_count_by_id.test ...........................***Failed    0.16 sec
1>        Start  53: extra_count_ignore_zip64.test
1> 53/134 Test  #53: extra_count_ignore_zip64.test ....................***Failed    0.13 sec
1>        Start  54: extra_delete.test
1> 54/134 Test  #54: extra_delete.test ................................***Failed    0.16 sec
1>        Start  55: extra_delete_by_id.test
1> 55/134 Test  #55: extra_delete_by_id.test ..........................***Failed    0.16 sec
1>        Start  56: extra_field_align.test
1> 56/134 Test  #56: extra_field_align.test ...........................***Failed    0.21 sec
1>        Start  57: extra_get.test
1> 57/134 Test  #57: extra_get.test ...................................***Failed    0.16 sec
1>        Start  58: extra_get_by_id.test
1> 58/134 Test  #58: extra_get_by_id.test .............................***Failed    0.16 sec
1>        Start  59: extra_set.test
1> 59/134 Test  #59: extra_set.test ...................................   Passed    0.15 sec
1>        Start  60: extra_set_modify_c.test
1> 60/134 Test  #60: extra_set_modify_c.test ..........................***Failed    0.16 sec
1>        Start  61: extra_set_modify_l.test
1> 61/134 Test  #61: extra_set_modify_l.test ..........................***Failed    0.16 sec
1>        Start  62: fdopen_ok.test
1> 62/134 Test  #62: fdopen_ok.test ...................................***Skipped   0.13 sec
1>        Start  63: file_comment_encmismatch.test
1> 63/134 Test  #63: file_comment_encmismatch.test ....................***Failed    0.17 sec
1>        Start  64: fopen_unchanged.test
1> 64/134 Test  #64: fopen_unchanged.test .............................***Failed    0.15 sec
1>        Start  65: fread.test
1> 65/134 Test  #65: fread.test .......................................***Failed    0.16 sec
1>        Start  66: fseek_deflated.test
1> 66/134 Test  #66: fseek_deflated.test ..............................***Failed    0.16 sec
1>        Start  67: fseek_fail.test
1> 67/134 Test  #67: fseek_fail.test ..................................***Failed    0.16 sec
1>        Start  68: fseek_ok.test
1> 68/134 Test  #68: fseek_ok.test ....................................***Failed    0.16 sec
1>        Start  69: get_comment.test
1> 69/134 Test  #69: get_comment.test .................................***Failed    0.16 sec
1>        Start  70: junk_at_end.test
1> 70/134 Test  #70: junk_at_end.test .................................   Passed    0.15 sec
1>        Start  71: junk_at_start.test
1> 71/134 Test  #71: junk_at_start.test ...............................***Failed    0.14 sec
1>        Start  72: name_locate.test
1> 72/134 Test  #72: name_locate.test .................................***Failed    0.16 sec
1>        Start  73: open_cons_extrabytes.test
1> 73/134 Test  #73: open_cons_extrabytes.test ........................***Failed    0.16 sec
1>        Start  74: open_empty.test
1> 74/134 Test  #74: open_empty.test ..................................***Failed    0.16 sec
1>        Start  75: open_empty_2.test
1> 75/134 Test  #75: open_empty_2.test ................................***Failed    0.15 sec
1>        Start  76: open_extrabytes.test
1> 76/134 Test  #76: open_extrabytes.test .............................***Failed    0.15 sec
1>        Start  77: open_file_count.test
1> 77/134 Test  #77: open_file_count.test .............................***Failed    0.17 sec
1>        Start  78: open_filename_duplicate.test
1> 78/134 Test  #78: open_filename_duplicate.test .....................***Failed    0.16 sec
1>        Start  79: open_filename_duplicate_consistency.test
1> 79/134 Test  #79: open_filename_duplicate_consistency.test .........***Failed    0.15 sec
1>        Start  80: open_filename_duplicate_empty.test
1> 80/134 Test  #80: open_filename_duplicate_empty.test ...............***Failed    0.15 sec
1>        Start  81: open_filename_duplicate_empty_consistency.test
1> 81/134 Test  #81: open_filename_duplicate_empty_consistency.test ...***Failed    0.15 sec
1>        Start  82: open_filename_empty.test
1> 82/134 Test  #82: open_filename_empty.test .........................***Failed    0.16 sec
1>        Start  83: open_incons.test
1> 83/134 Test  #83: open_incons.test .................................***Failed    0.29 sec
1>        Start  84: open_many_fail.test
1> 84/134 Test  #84: open_many_fail.test ..............................***Failed    0.12 sec
1>        Start  85: open_many_ok.test
1> 85/134 Test  #85: open_many_ok.test ................................***Failed    0.13 sec
1>        Start  86: open_multidisk.test
1> 86/134 Test  #86: open_multidisk.test ..............................***Failed    0.15 sec
1>        Start  87: open_new_but_exists.test
1> 87/134 Test  #87: open_new_but_exists.test .........................***Failed    0.16 sec
1>        Start  88: open_new_ok.test
1> 88/134 Test  #88: open_new_ok.test .................................***Failed    0.15 sec
1>        Start  89: open_nonarchive.test
1> 89/134 Test  #89: open_nonarchive.test .............................***Failed    0.16 sec
1>        Start  90: open_nosuchfile.test
1> 90/134 Test  #90: open_nosuchfile.test .............................***Failed    0.15 sec
1>        Start  91: open_ok.test
1> 91/134 Test  #91: open_ok.test .....................................***Failed    0.16 sec
1>        Start  92: open_too_short.test
1> 92/134 Test  #92: open_too_short.test ..............................***Failed    0.15 sec
1>        Start  93: open_truncate.test
1> 93/134 Test  #93: open_truncate.test ...............................***Failed    0.15 sec
1>        Start  94: open_zip64_3mf.test
1> 94/134 Test  #94: open_zip64_3mf.test ..............................***Failed    0.16 sec
1>        Start  95: open_zip64_ok.test
1> 95/134 Test  #95: open_zip64_ok.test ...............................***Failed    0.16 sec
1>        Start  96: preload.test
1> 96/134 Test  #96: preload.test .....................................   Passed    0.15 sec
1>        Start  97: progress.test
1> 97/134 Test  #97: progress.test ....................................***Failed    0.17 sec
1>        Start  98: rename_ascii.test
1> 98/134 Test  #98: rename_ascii.test ................................   Passed    0.16 sec
1>        Start  99: rename_cp437.test
1> 99/134 Test  #99: rename_cp437.test ................................***Failed    0.16 sec
1>        Start 100: rename_deleted.test
1>100/134 Test #100: rename_deleted.test ..............................***Failed    0.16 sec
1>        Start 101: rename_fail.test
1>101/134 Test #101: rename_fail.test .................................***Failed    0.16 sec
1>        Start 102: rename_ok.test
1>102/134 Test #102: rename_ok.test ...................................***Failed    0.16 sec
1>        Start 103: rename_utf8.test
1>103/134 Test #103: rename_utf8.test .................................   Passed    0.15 sec
1>        Start 104: rename_utf8_encmismatch.test
1>104/134 Test #104: rename_utf8_encmismatch.test .....................   Passed    0.15 sec
1>        Start 105: set_comment_all.test
1>105/134 Test #105: set_comment_all.test .............................***Failed    0.16 sec
1>        Start 106: set_comment_localonly.test
1>106/134 Test #106: set_comment_localonly.test .......................***Failed    0.16 sec
1>        Start 107: set_comment_removeglobal.test
1>107/134 Test #107: set_comment_removeglobal.test ....................***Failed    0.17 sec
1>        Start 108: set_comment_revert.test
1>108/134 Test #108: set_comment_revert.test ..........................***Failed    0.16 sec
1>        Start 109: set_compression_bzip2_to_deflate.test
1>109/134 Test #109: set_compression_bzip2_to_deflate.test ............***Failed    0.17 sec
1>        Start 110: set_compression_deflate_to_bzip2.test
1>110/134 Test #110: set_compression_deflate_to_bzip2.test ............***Failed    0.17 sec
1>        Start 111: set_compression_deflate_to_deflate.test
1>111/134 Test #111: set_compression_deflate_to_deflate.test ..........***Failed    0.16 sec
1>        Start 112: set_compression_deflate_to_store.test
1>112/134 Test #112: set_compression_deflate_to_store.test ............***Failed    0.17 sec
1>        Start 113: set_compression_store_to_bzip2.test
1>113/134 Test #113: set_compression_store_to_bzip2.test ..............***Failed    0.17 sec
1>        Start 114: set_compression_store_to_deflate.test
1>114/134 Test #114: set_compression_store_to_deflate.test ............***Failed    0.16 sec
1>        Start 115: set_compression_store_to_store.test
1>115/134 Test #115: set_compression_store_to_store.test ..............***Failed    0.16 sec
1>        Start 116: set_compression_store_to_xz.test
1>116/134 Test #116: set_compression_store_to_xz.test .................***Failed    0.17 sec
1>        Start 117: set_compression_unknown.test
1>117/134 Test #117: set_compression_unknown.test .....................***Failed    0.16 sec
1>        Start 118: set_compression_xz_to_store.test
1>118/134 Test #118: set_compression_xz_to_store.test .................***Failed    0.17 sec
1>        Start 119: set_file_dostime.test
1>119/134 Test #119: set_file_dostime.test ............................   Passed    0.15 sec
1>        Start 120: stat_index_cp437_guess.test
1>120/134 Test #120: stat_index_cp437_guess.test ......................***Failed    0.16 sec
1>        Start 121: stat_index_cp437_raw.test
1>121/134 Test #121: stat_index_cp437_raw.test ........................***Failed    0.16 sec
1>        Start 122: stat_index_cp437_strict.test
1>122/134 Test #122: stat_index_cp437_strict.test .....................***Failed    0.16 sec
1>        Start 123: stat_index_fileorder.test
1>123/134 Test #123: stat_index_fileorder.test ........................   Passed    0.15 sec
1>        Start 124: stat_index_streamed.test
1>124/134 Test #124: stat_index_streamed.test .........................   Passed    0.15 sec
1>        Start 125: stat_index_streamed_zip64.test
1>125/134 Test #125: stat_index_streamed_zip64.test ...................   Passed    0.15 sec
1>        Start 126: stat_index_utf8_guess.test
1>126/134 Test #126: stat_index_utf8_guess.test .......................***Failed    0.16 sec
1>        Start 127: stat_index_utf8_raw.test
1>127/134 Test #127: stat_index_utf8_raw.test .........................***Failed    0.15 sec
1>        Start 128: stat_index_utf8_strict.test
1>128/134 Test #128: stat_index_utf8_strict.test ......................***Failed    0.16 sec
1>        Start 129: stat_index_utf8_unmarked_strict.test
1>129/134 Test #129: stat_index_utf8_unmarked_strict.test .............***Failed    0.16 sec
1>        Start 130: stat_index_zip64.test
1>130/134 Test #130: stat_index_zip64.test ............................***Failed    0.12 sec
1>        Start 131: utf-8-standardization.test
1>131/134 Test #131: utf-8-standardization.test .......................   Passed    0.15 sec
1>        Start 132: zip-in-archive-comment.test
1>132/134 Test #132: zip-in-archive-comment.test ......................***Failed    0.16 sec
1>        Start 133: zip64_creation.test
1>133/134 Test #133: zip64_creation.test ..............................***Failed   83.42 sec
1>        Start 134: zip64_stored_creation.test
1>134/134 Test #134: zip64_stored_creation.test .......................   Passed   13.42 sec
1>
1>28% tests passed, 97 tests failed out of 134
1>
1>Total Test time (real) = 118.15 sec
1>
1>The following tests did not run:
1>    7 - add_from_stdin.test (Skipped)
1>   23 - clone-fs-add.test (Skipped)
1>   24 - clone-fs-delete.test (Skipped)
1>   25 - clone-fs-replace.test (Skipped)
1>   62 - fdopen_ok.test (Skipped)
1>
1>The following tests FAILED:
1>    1 - add_dir.test (Failed)
1>    2 - add_from_buffer.test (Failed)
1>    3 - add_from_file.test (Failed)
1>    4 - add_from_file_duplicate.test (Failed)
1>    5 - add_from_file_twice_duplicate.test (Failed)
1>    6 - add_from_filep.test (Failed)
1>    9 - add_from_zip_deflated.test (Failed)
1>   10 - add_from_zip_deflated2.test (Failed)
1>   11 - add_from_zip_partial_deflated.test (Failed)
1>   12 - add_from_zip_partial_stored.test (Failed)
1>   13 - add_from_zip_stored.test (Failed)
1>   14 - add_stored.test (Failed)
1>   15 - add_stored_in_memory.test (Failed)
1>   16 - buffer-fragment-read.test (Failed)
1>   17 - buffer-fragment-write.test (Failed)
1>   26 - cm-default.test (Failed)
1>   27 - count_entries.test (Failed)
1>   37 - delete_add_same.test (Failed)
1>   41 - delete_multiple_partial.test (Failed)
1>   42 - delete_renamed_rename.test (Failed)
1>   44 - encryption-nonrandom-aes128.test (Failed)
1>   45 - encryption-nonrandom-aes192.test (Failed)
1>   46 - encryption-nonrandom-aes256.test (Failed)
1>   47 - encryption-nonrandom-pkware.test (Failed)
1>   49 - extra_add.test (Failed)
1>   50 - extra_add_multiple.test (Failed)
1>   51 - extra_count.test (Failed)
1>   52 - extra_count_by_id.test (Failed)
1>   53 - extra_count_ignore_zip64.test (Failed)
1>   54 - extra_delete.test (Failed)
1>   55 - extra_delete_by_id.test (Failed)
1>   56 - extra_field_align.test (Failed)
1>   57 - extra_get.test (Failed)
1>   58 - extra_get_by_id.test (Failed)
1>   60 - extra_set_modify_c.test (Failed)
1>   61 - extra_set_modify_l.test (Failed)
1>   63 - file_comment_encmismatch.test (Failed)
1>   64 - fopen_unchanged.test (Failed)
1>   65 - fread.test (Failed)
1>   66 - fseek_deflated.test (Failed)
1>   67 - fseek_fail.test (Failed)
1>   68 - fseek_ok.test (Failed)
1>   69 - get_comment.test (Failed)
1>   71 - junk_at_start.test (Failed)
1>   72 - name_locate.test (Failed)
1>   73 - open_cons_extrabytes.test (Failed)
1>   74 - open_empty.test (Failed)
1>   75 - open_empty_2.test (Failed)
1>   76 - open_extrabytes.test (Failed)
1>   77 - open_file_count.test (Failed)
1>   78 - open_filename_duplicate.test (Failed)
1>   79 - open_filename_duplicate_consistency.test (Failed)
1>   80 - open_filename_duplicate_empty.test (Failed)
1>   81 - open_filename_duplicate_empty_consistency.test (Failed)
1>   82 - open_filename_empty.test (Failed)
1>   83 - open_incons.test (Failed)
1>   84 - open_many_fail.test (Failed)
1>   85 - open_many_ok.test (Failed)
1>   86 - open_multidisk.test (Failed)
1>   87 - open_new_but_exists.test (Failed)
1>   88 - open_new_ok.test (Failed)
1>   89 - open_nonarchive.test (Failed)
1>   90 - open_nosuchfile.test (Failed)
1>   91 - open_ok.test (Failed)
1>   92 - open_too_short.test (Failed)
1>   93 - open_truncate.test (Failed)
1>   94 - open_zip64_3mf.test (Failed)
1>   95 - open_zip64_ok.test (Failed)
1>   97 - progress.test (Failed)
1>   99 - rename_cp437.test (Failed)
1>  100 - rename_deleted.test (Failed)
1>  101 - rename_fail.test (Failed)
1>  102 - rename_ok.test (Failed)
1>  105 - set_comment_all.test (Failed)
1>  106 - set_comment_localonly.test (Failed)
1>  107 - set_comment_removeglobal.test (Failed)
1>  108 - set_comment_revert.test (Failed)
1>  109 - set_compression_bzip2_to_deflate.test (Failed)
1>  110 - set_compression_deflate_to_bzip2.test (Failed)
1>  111 - set_compression_deflate_to_deflate.test (Failed)
1>  112 - set_compression_deflate_to_store.test (Failed)
1>  113 - set_compression_store_to_bzip2.test (Failed)
1>  114 - set_compression_store_to_deflate.test (Failed)
1>  115 - set_compression_store_to_store.test (Failed)
1>  116 - set_compression_store_to_xz.test (Failed)
1>  117 - set_compression_unknown.test (Failed)
1>  118 - set_compression_xz_to_store.test (Failed)
1>  120 - stat_index_cp437_guess.test (Failed)
1>  121 - stat_index_cp437_raw.test (Failed)
1>  122 - stat_index_cp437_strict.test (Failed)
1>  126 - stat_index_utf8_guess.test (Failed)
1>  127 - stat_index_utf8_raw.test (Failed)
1>  128 - stat_index_utf8_strict.test (Failed)
1>  129 - stat_index_utf8_unmarked_strict.test (Failed)
1>  130 - stat_index_zip64.test (Failed)
1>  132 - zip-in-archive-comment.test (Failed)
1>  133 - zip64_creation.test (Failed)
1>Errors while running CTest
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: Der Befehl "setlocal
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: D:\dev\Tools\cmake-3.16.5-win64-x64\bin\ctest.exe --force-new-ctest-process -C Debug
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmEnd
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmErrorLevel
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: exit /b %1
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmDone
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :VCEnd" wurde mit dem Code 8 beendet.
1>Die Erstellung des Projekts "RUN_TESTS.vcxproj" ist abgeschlossen -- FEHLER.
========== Erstellen: 0 erfolgreich, 1 fehlerhaft, 1 aktuell, 0 übersprungen ==========
0-wiz-0 commented 4 years ago

We have a language in which we describe our test cases, and a perl program is used as interpreter.

The one for this case is:

# test archive with junk at start of file
args -o 4 junk-at-start.zzip get_num_entries 0
return 0
file junk-at-start.zzip junk-at-start.zip junk-at-start.zip
stdout 3 entries in archive

I could explain the details, but it's probably not necessary.

The case we need help with can be reduced to this recipe:

Run ziptool_regress that's built in the regress subdirectory on one zip archive that's included in the repository in the regress subdirectory:

ziptool_regress -o 4  junk-at-start.zip get_num_entries 0 

This should print 3 entries in archive to the standard output and exit with return code 0 (no error).

OgreTransporter commented 4 years ago
can't open zip archive 'D:\workspace\libzip\src\regress\junk-at-start.zip': Not a zip Archive

Return code 1

The call to _zip_open(zip_source_t *src, unsigned int flags, zip_error_t *error) fails. In line 168 (len = st.size;) the length is set to 0. According to this the call of _zip_find_central_dir(zip_t *za, zip_uint64_t len) does not work, because 0 is smaller than EOCDLEN (22): if (len < EOCDLEN) {.

0-wiz-0 commented 4 years ago

Ok, so the next step is to find out why st.size is zero. Can you please try if this diff improves the situation?

diff --git a/lib/zip_source_win32handle.c b/lib/zip_source_win32handle.c
index 538601b..5a50451 100644
--- a/lib/zip_source_win32handle.c
+++ b/lib/zip_source_win32handle.c
@@ -95,7 +95,7 @@ _zip_source_win32_handle_or_name(const void *fname, HANDLE h, zip_uint64_t start
     ctx->ops = ops;
     ctx->h = h;
     ctx->start = start;
-    ctx->end = (len < 0 ? 0 : start + (zip_uint64_t)len);
+    ctx->end = (len <= 0 ? 0 : start + (zip_uint64_t)len);
     ctx->closep = ctx->fname ? 1 : closep;
     if (st) {
        memcpy(&ctx->st, st, sizeof(ctx->st));
OgreTransporter commented 4 years ago

Much better! struct zip_stat st now strores the right size. The result of the test is now: can't open zip archive 'D:\workspace\test3\src\regress\junk-at-start.zip': Invalid argument

zip_source_win32handle.c (301):

        zip_error_set(&ctx->error, ZIP_ER_INVAL, 0);
        return -1;
    }

new_current = 0 ctx->start = 4

0-wiz-0 commented 4 years ago

Thanks! I noticed that the Windows backend was still using absolute values for the current and end members of ctx. I tried making it more similar to the Unix backend (which uses relative values, based on start), but it still fails. Can you please tell me where?

OgreTransporter commented 4 years ago

_zip_find_central_dir > zip_source_seek

args.offset = -416;
args.whence = 2;

_zip_source_call > _win32_read_file (len=16, cmd=ZIP_SOURCE_SEEK)

Function _zip_seek_win32 is working, but then

        new_current = new_offset.QuadPart;
        new_current -= (zip_int64_t)ctx->start;

new_offset.QuadPart is 0, ctx->start is 4 which ends up in new_current = -4.

zip_source_win32handle.c in line 379 fails!

    if (new_current < 0 || (ctx->end != 0 && (zip_uint64_t)new_current > ctx->end) || (zip_uint64_t)new_current + ctx->start < ctx->start) {
        zip_error_set(&ctx->error, ZIP_ER_INVAL, 0);
        return -1;
    }
dillof commented 4 years ago

Thanks for the detailed analysis, I've just committed a fix for it.

(The corresponding code path is not used in the Unix file source (since we always set ctx->end), so we didn't notice it, even though the bug was present there too.)

OgreTransporter commented 4 years ago

can't open zip archive 'D:\workspace\libzip\src\regress\junk-at-start.zip': Not a zip Archive

_zip_find_central_dir > _zip_read_cdir > _zip_dirent_read

if (memcmp(_zip_buffer_get(buffer, 4), (local ? LOCAL_MAGIC : CENTRAL_MAGIC), 4) != 0)

local=false buffer = 0x000002495f034a10 {ok=true free_data=false data=0x000002495f0376dc "est\nPK\x1\x2\x17\x3\n" ...}

memcmp returns 1, so the function returns -1

dillof commented 4 years ago

Thanks for the quick analysis, I see the problem: the buffer should be shifted 4 bytes to the left. That means the seek did not correctly account for ctx->start.

I'll take a look at it.

OgreTransporter commented 4 years ago

Thank you very much for taking care of this problem! I will continue to test until all tests work under Windows.

dillof commented 4 years ago

Thank you for your continued debugging support. Your bug reports are excellent.

We are currently refactoring the whole file source implementation. We'll let you know when it's in a stable state again.

dillof commented 4 years ago

We have completed the restructuring and all tests now pass.

However, we still have a few open questions:

  1. I'm now using GetFileAttributesExA / GetFileAttributesExW to get information about a file by its name, but I don't see how to get the file type (wether its a regular file). For a HANDLE the code uses GetFileType.

  2. The build on UWP does not find the test executables. It is built via cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 Could you take a look and see where they are located and why rundest doesn't find them?

thanks, dillo

OgreTransporter commented 4 years ago

Excellent! ziptool_regress -o 4 junk-at-start.zip get_num_entries 0 is working now.

  1. There are several ways to test whether a path is a file or not. With GetFileAttributesEx you can check it by checking the bit FILE_ATTRIBUTE_ARCHIVE in the value dwFileAttributes. ARCHIVE is normally set for all files. Another method is to search for the file with FindFirstFile. FindFirstFile only works with files and directories. You can combine both functions and first check with FindFirstFile if the path exists and then test if the attribute FILE_ATTRIBUTE_DIRECTORY is not set to exclude directories. Alternatively you can open the path with CreateFile, then apply GetFileType and close the handle again.
  2. I normally do not use a UWP. I can't get UWP running either. Apparently there are still bugs under VS2017 (https://github.com/Microsoft/react-native-windows/issues/2031).
  3. In my comment https://github.com/nih-at/libzip/issues/166#issuecomment-616160069 above I pointed out the problem with Perl. If Perl is used, Perl should be searched and integrated properly. For example, Perl is not part of the path environment variable on this computer.

Here is the result of the tests (not UWP, 10da88f79a72107fb22c4994106ce666fe6cd506):

1>        Start   1: add_dir.test
1>  1/134 Test   #1: add_dir.test .....................................   Passed    0.36 sec
1>        Start   2: add_from_buffer.test
1>  2/134 Test   #2: add_from_buffer.test .............................   Passed    0.16 sec
1>        Start   3: add_from_file.test
1>  3/134 Test   #3: add_from_file.test ...............................   Passed    0.15 sec
1>        Start   4: add_from_file_duplicate.test
1>  4/134 Test   #4: add_from_file_duplicate.test .....................   Passed    0.16 sec
1>        Start   5: add_from_file_twice_duplicate.test
1>  5/134 Test   #5: add_from_file_twice_duplicate.test ...............   Passed    0.15 sec
1>        Start   6: add_from_filep.test
1>  6/134 Test   #6: add_from_filep.test ..............................   Passed    0.17 sec
1>        Start   7: add_from_stdin.test
1>  7/134 Test   #7: add_from_stdin.test ..............................***Skipped   0.12 sec
1>        Start   8: add_from_zip_closed.test
1>  8/134 Test   #8: add_from_zip_closed.test .........................   Passed    0.15 sec
1>        Start   9: add_from_zip_deflated.test
1>  9/134 Test   #9: add_from_zip_deflated.test .......................   Passed    0.16 sec
1>        Start  10: add_from_zip_deflated2.test
1> 10/134 Test  #10: add_from_zip_deflated2.test ......................   Passed    0.16 sec
1>        Start  11: add_from_zip_partial_deflated.test
1> 11/134 Test  #11: add_from_zip_partial_deflated.test ...............   Passed    0.16 sec
1>        Start  12: add_from_zip_partial_stored.test
1> 12/134 Test  #12: add_from_zip_partial_stored.test .................   Passed    0.16 sec
1>        Start  13: add_from_zip_stored.test
1> 13/134 Test  #13: add_from_zip_stored.test .........................   Passed    0.16 sec
1>        Start  14: add_stored.test
1> 14/134 Test  #14: add_stored.test ..................................   Passed    0.15 sec
1>        Start  15: add_stored_in_memory.test
1> 15/134 Test  #15: add_stored_in_memory.test ........................   Passed    0.15 sec
1>        Start  16: buffer-fragment-read.test
1> 16/134 Test  #16: buffer-fragment-read.test ........................   Passed    0.16 sec
1>        Start  17: buffer-fragment-write.test
1> 17/134 Test  #17: buffer-fragment-write.test .......................   Passed    0.16 sec
1>        Start  18: cancel_45.test
1> 18/134 Test  #18: cancel_45.test ...................................   Passed    0.15 sec
1>        Start  19: cancel_90.test
1> 19/134 Test  #19: cancel_90.test ...................................   Passed    0.15 sec
1>        Start  20: clone-buffer-add.test
1> 20/134 Test  #20: clone-buffer-add.test ............................   Passed    0.15 sec
1>        Start  21: clone-buffer-delete.test
1> 21/134 Test  #21: clone-buffer-delete.test .........................   Passed    0.15 sec
1>        Start  22: clone-buffer-replace.test
1> 22/134 Test  #22: clone-buffer-replace.test ........................   Passed    0.15 sec
1>        Start  23: clone-fs-add.test
1> 23/134 Test  #23: clone-fs-add.test ................................***Skipped   0.13 sec
1>        Start  24: clone-fs-delete.test
1> 24/134 Test  #24: clone-fs-delete.test .............................***Skipped   0.13 sec
1>        Start  25: clone-fs-replace.test
1> 25/134 Test  #25: clone-fs-replace.test ............................***Skipped   0.13 sec
1>        Start  26: cm-default.test
1> 26/134 Test  #26: cm-default.test ..................................   Passed    0.16 sec
1>        Start  27: count_entries.test
1> 27/134 Test  #27: count_entries.test ...............................***Failed    0.12 sec
1>        Start  28: decrypt-correct-password-aes128.test
1> 28/134 Test  #28: decrypt-correct-password-aes128.test .............   Passed    0.15 sec
1>        Start  29: decrypt-correct-password-aes192.test
1> 29/134 Test  #29: decrypt-correct-password-aes192.test .............   Passed    0.15 sec
1>        Start  30: decrypt-correct-password-aes256.test
1> 30/134 Test  #30: decrypt-correct-password-aes256.test .............   Passed    0.15 sec
1>        Start  31: decrypt-correct-password-pkware.test
1> 31/134 Test  #31: decrypt-correct-password-pkware.test .............   Passed    0.15 sec
1>        Start  32: decrypt-no-password-aes256.test
1> 32/134 Test  #32: decrypt-no-password-aes256.test ..................   Passed    0.14 sec
1>        Start  33: decrypt-wrong-password-aes128.test
1> 33/134 Test  #33: decrypt-wrong-password-aes128.test ...............   Passed    0.15 sec
1>        Start  34: decrypt-wrong-password-aes192.test
1> 34/134 Test  #34: decrypt-wrong-password-aes192.test ...............   Passed    0.15 sec
1>        Start  35: decrypt-wrong-password-aes256.test
1> 35/134 Test  #35: decrypt-wrong-password-aes256.test ...............   Passed    0.15 sec
1>        Start  36: decrypt-wrong-password-pkware.test
1> 36/134 Test  #36: decrypt-wrong-password-pkware.test ...............   Passed    0.14 sec
1>        Start  37: delete_add_same.test
1> 37/134 Test  #37: delete_add_same.test .............................   Passed    0.16 sec
1>        Start  38: delete_invalid.test
1> 38/134 Test  #38: delete_invalid.test ..............................   Passed    0.14 sec
1>        Start  39: delete_last.test
1> 39/134 Test  #39: delete_last.test .................................   Passed    0.16 sec
1>        Start  40: delete_multiple_last.test
1> 40/134 Test  #40: delete_multiple_last.test ........................   Passed    0.14 sec
1>        Start  41: delete_multiple_partial.test
1> 41/134 Test  #41: delete_multiple_partial.test .....................   Passed    0.17 sec
1>        Start  42: delete_renamed_rename.test
1> 42/134 Test  #42: delete_renamed_rename.test .......................   Passed    0.16 sec
1>        Start  43: encrypt.test
1> 43/134 Test  #43: encrypt.test .....................................   Passed    0.14 sec
1>        Start  44: encryption-nonrandom-aes128.test
1> 44/134 Test  #44: encryption-nonrandom-aes128.test .................***Failed    0.15 sec
1>        Start  45: encryption-nonrandom-aes192.test
1> 45/134 Test  #45: encryption-nonrandom-aes192.test .................***Failed    0.15 sec
1>        Start  46: encryption-nonrandom-aes256.test
1> 46/134 Test  #46: encryption-nonrandom-aes256.test .................***Failed    0.15 sec
1>        Start  47: encryption-nonrandom-pkware.test
1> 47/134 Test  #47: encryption-nonrandom-pkware.test .................***Failed    0.15 sec
1>        Start  48: encryption-remove.test
1> 48/134 Test  #48: encryption-remove.test ...........................   Passed    0.15 sec
1>        Start  49: extra_add.test
1> 49/134 Test  #49: extra_add.test ...................................   Passed    0.15 sec
1>        Start  50: extra_add_multiple.test
1> 50/134 Test  #50: extra_add_multiple.test ..........................   Passed    0.15 sec
1>        Start  51: extra_count.test
1> 51/134 Test  #51: extra_count.test .................................   Passed    0.15 sec
1>        Start  52: extra_count_by_id.test
1> 52/134 Test  #52: extra_count_by_id.test ...........................   Passed    0.16 sec
1>        Start  53: extra_count_ignore_zip64.test
1> 53/134 Test  #53: extra_count_ignore_zip64.test ....................***Failed    0.12 sec
1>        Start  54: extra_delete.test
1> 54/134 Test  #54: extra_delete.test ................................   Passed    0.15 sec
1>        Start  55: extra_delete_by_id.test
1> 55/134 Test  #55: extra_delete_by_id.test ..........................   Passed    0.15 sec
1>        Start  56: extra_field_align.test
1> 56/134 Test  #56: extra_field_align.test ...........................   Passed    0.21 sec
1>        Start  57: extra_get.test
1> 57/134 Test  #57: extra_get.test ...................................   Passed    0.15 sec
1>        Start  58: extra_get_by_id.test
1> 58/134 Test  #58: extra_get_by_id.test .............................   Passed    0.15 sec
1>        Start  59: extra_set.test
1> 59/134 Test  #59: extra_set.test ...................................   Passed    0.15 sec
1>        Start  60: extra_set_modify_c.test
1> 60/134 Test  #60: extra_set_modify_c.test ..........................   Passed    0.16 sec
1>        Start  61: extra_set_modify_l.test
1> 61/134 Test  #61: extra_set_modify_l.test ..........................   Passed    0.16 sec
1>        Start  62: fdopen_ok.test
1> 62/134 Test  #62: fdopen_ok.test ...................................***Skipped   0.12 sec
1>        Start  63: file_comment_encmismatch.test
1> 63/134 Test  #63: file_comment_encmismatch.test ....................   Passed    0.16 sec
1>        Start  64: fopen_unchanged.test
1> 64/134 Test  #64: fopen_unchanged.test .............................   Passed    0.15 sec
1>        Start  65: fread.test
1> 65/134 Test  #65: fread.test .......................................   Passed    0.17 sec
1>        Start  66: fseek_deflated.test
1> 66/134 Test  #66: fseek_deflated.test ..............................   Passed    0.16 sec
1>        Start  67: fseek_fail.test
1> 67/134 Test  #67: fseek_fail.test ..................................   Passed    0.15 sec
1>        Start  68: fseek_ok.test
1> 68/134 Test  #68: fseek_ok.test ....................................   Passed    0.15 sec
1>        Start  69: get_comment.test
1> 69/134 Test  #69: get_comment.test .................................   Passed    0.15 sec
1>        Start  70: junk_at_end.test
1> 70/134 Test  #70: junk_at_end.test .................................   Passed    0.15 sec
1>        Start  71: junk_at_start.test
1> 71/134 Test  #71: junk_at_start.test ...............................   Passed    0.15 sec
1>        Start  72: name_locate.test
1> 72/134 Test  #72: name_locate.test .................................   Passed    0.15 sec
1>        Start  73: open_cons_extrabytes.test
1> 73/134 Test  #73: open_cons_extrabytes.test ........................   Passed    0.15 sec
1>        Start  74: open_empty.test
1> 74/134 Test  #74: open_empty.test ..................................   Passed    0.15 sec
1>        Start  75: open_empty_2.test
1> 75/134 Test  #75: open_empty_2.test ................................   Passed    0.14 sec
1>        Start  76: open_extrabytes.test
1> 76/134 Test  #76: open_extrabytes.test .............................   Passed    0.14 sec
1>        Start  77: open_file_count.test
1> 77/134 Test  #77: open_file_count.test .............................   Passed    0.16 sec
1>        Start  78: open_filename_duplicate.test
1> 78/134 Test  #78: open_filename_duplicate.test .....................   Passed    0.15 sec
1>        Start  79: open_filename_duplicate_consistency.test
1> 79/134 Test  #79: open_filename_duplicate_consistency.test .........   Passed    0.14 sec
1>        Start  80: open_filename_duplicate_empty.test
1> 80/134 Test  #80: open_filename_duplicate_empty.test ...............   Passed    0.15 sec
1>        Start  81: open_filename_duplicate_empty_consistency.test
1> 81/134 Test  #81: open_filename_duplicate_empty_consistency.test ...   Passed    0.14 sec
1>        Start  82: open_filename_empty.test
1> 82/134 Test  #82: open_filename_empty.test .........................   Passed    0.15 sec
1>        Start  83: open_incons.test
1> 83/134 Test  #83: open_incons.test .................................   Passed    0.27 sec
1>        Start  84: open_many_fail.test
1> 84/134 Test  #84: open_many_fail.test ..............................***Failed    0.12 sec
1>        Start  85: open_many_ok.test
1> 85/134 Test  #85: open_many_ok.test ................................***Failed    0.12 sec
1>        Start  86: open_multidisk.test
1> 86/134 Test  #86: open_multidisk.test ..............................   Passed    0.15 sec
1>        Start  87: open_new_but_exists.test
1> 87/134 Test  #87: open_new_but_exists.test .........................   Passed    0.15 sec
1>        Start  88: open_new_ok.test
1> 88/134 Test  #88: open_new_ok.test .................................   Passed    0.14 sec
1>        Start  89: open_nonarchive.test
1> 89/134 Test  #89: open_nonarchive.test .............................   Passed    0.15 sec
1>        Start  90: open_nosuchfile.test
1> 90/134 Test  #90: open_nosuchfile.test .............................   Passed    0.14 sec
1>        Start  91: open_ok.test
1> 91/134 Test  #91: open_ok.test .....................................   Passed    0.15 sec
1>        Start  92: open_too_short.test
1> 92/134 Test  #92: open_too_short.test ..............................   Passed    0.15 sec
1>        Start  93: open_truncate.test
1> 93/134 Test  #93: open_truncate.test ...............................   Passed    0.14 sec
1>        Start  94: open_zip64_3mf.test
1> 94/134 Test  #94: open_zip64_3mf.test ..............................   Passed    0.15 sec
1>        Start  95: open_zip64_ok.test
1> 95/134 Test  #95: open_zip64_ok.test ...............................   Passed    0.15 sec
1>        Start  96: preload.test
1> 96/134 Test  #96: preload.test .....................................***Failed    0.16 sec
1>        Start  97: progress.test
1> 97/134 Test  #97: progress.test ....................................   Passed    0.16 sec
1>        Start  98: rename_ascii.test
1> 98/134 Test  #98: rename_ascii.test ................................   Passed    0.15 sec
1>        Start  99: rename_cp437.test
1> 99/134 Test  #99: rename_cp437.test ................................   Passed    0.16 sec
1>        Start 100: rename_deleted.test
1>100/134 Test #100: rename_deleted.test ..............................   Passed    0.16 sec
1>        Start 101: rename_fail.test
1>101/134 Test #101: rename_fail.test .................................   Passed    0.15 sec
1>        Start 102: rename_ok.test
1>102/134 Test #102: rename_ok.test ...................................   Passed    0.15 sec
1>        Start 103: rename_utf8.test
1>103/134 Test #103: rename_utf8.test .................................   Passed    0.15 sec
1>        Start 104: rename_utf8_encmismatch.test
1>104/134 Test #104: rename_utf8_encmismatch.test .....................   Passed    0.15 sec
1>        Start 105: set_comment_all.test
1>105/134 Test #105: set_comment_all.test .............................   Passed    0.16 sec
1>        Start 106: set_comment_localonly.test
1>106/134 Test #106: set_comment_localonly.test .......................   Passed    0.16 sec
1>        Start 107: set_comment_removeglobal.test
1>107/134 Test #107: set_comment_removeglobal.test ....................   Passed    0.16 sec
1>        Start 108: set_comment_revert.test
1>108/134 Test #108: set_comment_revert.test ..........................   Passed    0.15 sec
1>        Start 109: set_compression_bzip2_to_deflate.test
1>109/134 Test #109: set_compression_bzip2_to_deflate.test ............   Passed    0.16 sec
1>        Start 110: set_compression_deflate_to_bzip2.test
1>110/134 Test #110: set_compression_deflate_to_bzip2.test ............   Passed    0.16 sec
1>        Start 111: set_compression_deflate_to_deflate.test
1>111/134 Test #111: set_compression_deflate_to_deflate.test ..........   Passed    0.15 sec
1>        Start 112: set_compression_deflate_to_store.test
1>112/134 Test #112: set_compression_deflate_to_store.test ............   Passed    0.16 sec
1>        Start 113: set_compression_store_to_bzip2.test
1>113/134 Test #113: set_compression_store_to_bzip2.test ..............   Passed    0.16 sec
1>        Start 114: set_compression_store_to_deflate.test
1>114/134 Test #114: set_compression_store_to_deflate.test ............   Passed    0.15 sec
1>        Start 115: set_compression_store_to_store.test
1>115/134 Test #115: set_compression_store_to_store.test ..............   Passed    0.15 sec
1>        Start 116: set_compression_store_to_xz.test
1>116/134 Test #116: set_compression_store_to_xz.test .................   Passed    0.16 sec
1>        Start 117: set_compression_unknown.test
1>117/134 Test #117: set_compression_unknown.test .....................   Passed    0.15 sec
1>        Start 118: set_compression_xz_to_store.test
1>118/134 Test #118: set_compression_xz_to_store.test .................   Passed    0.16 sec
1>        Start 119: set_file_dostime.test
1>119/134 Test #119: set_file_dostime.test ............................   Passed    0.15 sec
1>        Start 120: stat_index_cp437_guess.test
1>120/134 Test #120: stat_index_cp437_guess.test ......................   Passed    0.16 sec
1>        Start 121: stat_index_cp437_raw.test
1>121/134 Test #121: stat_index_cp437_raw.test ........................   Passed    0.15 sec
1>        Start 122: stat_index_cp437_strict.test
1>122/134 Test #122: stat_index_cp437_strict.test .....................   Passed    0.15 sec
1>        Start 123: stat_index_fileorder.test
1>123/134 Test #123: stat_index_fileorder.test ........................   Passed    0.15 sec
1>        Start 124: stat_index_streamed.test
1>124/134 Test #124: stat_index_streamed.test .........................   Passed    0.15 sec
1>        Start 125: stat_index_streamed_zip64.test
1>125/134 Test #125: stat_index_streamed_zip64.test ...................   Passed    0.15 sec
1>        Start 126: stat_index_utf8_guess.test
1>126/134 Test #126: stat_index_utf8_guess.test .......................   Passed    0.15 sec
1>        Start 127: stat_index_utf8_raw.test
1>127/134 Test #127: stat_index_utf8_raw.test .........................   Passed    0.15 sec
1>        Start 128: stat_index_utf8_strict.test
1>128/134 Test #128: stat_index_utf8_strict.test ......................   Passed    0.15 sec
1>        Start 129: stat_index_utf8_unmarked_strict.test
1>129/134 Test #129: stat_index_utf8_unmarked_strict.test .............   Passed    0.15 sec
1>        Start 130: stat_index_zip64.test
1>130/134 Test #130: stat_index_zip64.test ............................***Failed    0.12 sec
1>        Start 131: utf-8-standardization.test
1>131/134 Test #131: utf-8-standardization.test .......................   Passed    0.15 sec
1>        Start 132: zip-in-archive-comment.test
1>132/134 Test #132: zip-in-archive-comment.test ......................   Passed    0.15 sec
1>        Start 133: zip64_creation.test
1>133/134 Test #133: zip64_creation.test ..............................***Failed   69.31 sec
1>        Start 134: zip64_stored_creation.test
1>134/134 Test #134: zip64_stored_creation.test .......................   Passed   11.33 sec
1>
1>92% tests passed, 11 tests failed out of 134
1>
1>Total Test time (real) = 101.37 sec
1>
1>The following tests did not run:
1>    7 - add_from_stdin.test (Skipped)
1>   23 - clone-fs-add.test (Skipped)
1>   24 - clone-fs-delete.test (Skipped)
1>   25 - clone-fs-replace.test (Skipped)
1>   62 - fdopen_ok.test (Skipped)
1>
1>The following tests FAILED:
1>   27 - count_entries.test (Failed)
1>   44 - encryption-nonrandom-aes128.test (Failed)
1>   45 - encryption-nonrandom-aes192.test (Failed)
1>   46 - encryption-nonrandom-aes256.test (Failed)
1>   47 - encryption-nonrandom-pkware.test (Failed)
1>   53 - extra_count_ignore_zip64.test (Failed)
1>   84 - open_many_fail.test (Failed)
1>   85 - open_many_ok.test (Failed)
1>   96 - preload.test (Failed)
1>  130 - stat_index_zip64.test (Failed)
1>  133 - zip64_creation.test (Failed)
1>Errors while running CTest
dillof commented 4 years ago

Where did you run those tests? Could you run them with the environment variable VERBOSE set to YES, so we see what's going wrong?

Thanks.

0-wiz-0 commented 4 years ago

Please let me know if https://github.com/nih-at/libzip/commit/223c57e0d4ae0f93b7f9f839d6196be3981d6f0f improves the situation for you.

OgreTransporter commented 4 years ago

223c57e works, thank you very much! I have completely deleted everything and cloned it again to make sure I have applied all changes. I noticed a few more problems, which I worked on in PR #175.

I'll run the tests again right away.

OgreTransporter commented 4 years ago

Hm, would it be possible to include more queries in CMake? The test system drives me crazy, because there are always some programs/commands being executed which are assumed to be present without testing if the assumption is correct. Example:

3/134 Testing: add_from_file.test
3/134 Test: add_from_file.test
Command: "D:/dev/Tools/strawberry-perl-5.30.2.1-64bit-PDL/perl/bin/perl.exe" "D:/libziptest/build/regress/runtest" "--bin-sub-directory" "Debug" "D:/libziptest/src/regress/add_from_file.test"
Directory: D:/libziptest/build/regress
"add_from_file.test" start time: May 18 16:45 Mitteleuropäische Sommerzeit
Output:
----------------------------------------------------------
Der Befehl "diff" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
add_from_file -- FAIL: files
<end of output>
Test time =   0.17 sec
----------------------------------------------------------
Test Failed.
"add_from_file.test" end time: May 18 16:45 Mitteleuropäische Sommerzeit
"add_from_file.test" time elapsed: 00:00:00
----------------------------------------------------------

Why does DIFF suddenly appear here? Why does CMake not check if DIFF is present? Yes, under Linux this is found on 90% of all installations, but not under Windows.

OgreTransporter commented 4 years ago
1>Test project D:/libziptest/build
1>        Start   1: add_dir.test
1>  1/134 Test   #1: add_dir.test .....................................   Passed    0.15 sec
1>        Start   2: add_from_buffer.test
1>  2/134 Test   #2: add_from_buffer.test .............................   Passed    0.15 sec
1>        Start   3: add_from_file.test
1>  3/134 Test   #3: add_from_file.test ...............................   Passed    0.21 sec
1>        Start   4: add_from_file_duplicate.test
1>  4/134 Test   #4: add_from_file_duplicate.test .....................   Passed    0.18 sec
1>        Start   5: add_from_file_twice_duplicate.test
1>  5/134 Test   #5: add_from_file_twice_duplicate.test ...............   Passed    0.18 sec
1>        Start   6: add_from_filep.test
1>  6/134 Test   #6: add_from_filep.test ..............................***Failed    0.18 sec
1>        Start   7: add_from_stdin.test
1>  7/134 Test   #7: add_from_stdin.test ..............................***Skipped   0.12 sec
1>        Start   8: add_from_zip_closed.test
1>  8/134 Test   #8: add_from_zip_closed.test .........................   Passed    0.18 sec
1>        Start   9: add_from_zip_deflated.test
1>  9/134 Test   #9: add_from_zip_deflated.test .......................   Passed    0.19 sec
1>        Start  10: add_from_zip_deflated2.test
1> 10/134 Test  #10: add_from_zip_deflated2.test ......................   Passed    0.19 sec
1>        Start  11: add_from_zip_partial_deflated.test
1> 11/134 Test  #11: add_from_zip_partial_deflated.test ...............   Passed    0.18 sec
1>        Start  12: add_from_zip_partial_stored.test
1> 12/134 Test  #12: add_from_zip_partial_stored.test .................   Passed    0.18 sec
1>        Start  13: add_from_zip_stored.test
1> 13/134 Test  #13: add_from_zip_stored.test .........................   Passed    0.17 sec
1>        Start  14: add_stored.test
1> 14/134 Test  #14: add_stored.test ..................................   Passed    0.15 sec
1>        Start  15: add_stored_in_memory.test
1> 15/134 Test  #15: add_stored_in_memory.test ........................   Passed    0.15 sec
1>        Start  16: buffer-fragment-read.test
1> 16/134 Test  #16: buffer-fragment-read.test ........................   Passed    0.16 sec
1>        Start  17: buffer-fragment-write.test
1> 17/134 Test  #17: buffer-fragment-write.test .......................   Passed    0.16 sec
1>        Start  18: cancel_45.test
1> 18/134 Test  #18: cancel_45.test ...................................   Passed    0.18 sec
1>        Start  19: cancel_90.test
1> 19/134 Test  #19: cancel_90.test ...................................   Passed    0.17 sec
1>        Start  20: clone-buffer-add.test
1> 20/134 Test  #20: clone-buffer-add.test ............................   Passed    0.18 sec
1>        Start  21: clone-buffer-delete.test
1> 21/134 Test  #21: clone-buffer-delete.test .........................   Passed    0.18 sec
1>        Start  22: clone-buffer-replace.test
1> 22/134 Test  #22: clone-buffer-replace.test ........................   Passed    0.18 sec
1>        Start  23: clone-fs-add.test
1> 23/134 Test  #23: clone-fs-add.test ................................***Skipped   0.13 sec
1>        Start  24: clone-fs-delete.test
1> 24/134 Test  #24: clone-fs-delete.test .............................***Skipped   0.13 sec
1>        Start  25: clone-fs-replace.test
1> 25/134 Test  #25: clone-fs-replace.test ............................***Skipped   0.13 sec
1>        Start  26: cm-default.test
1> 26/134 Test  #26: cm-default.test ..................................   Passed    0.19 sec
1>        Start  27: count_entries.test
1> 27/134 Test  #27: count_entries.test ...............................   Passed    2.60 sec
1>        Start  28: decrypt-correct-password-aes128.test
1> 28/134 Test  #28: decrypt-correct-password-aes128.test .............   Passed    0.17 sec
1>        Start  29: decrypt-correct-password-aes192.test
1> 29/134 Test  #29: decrypt-correct-password-aes192.test .............   Passed    0.16 sec
1>        Start  30: decrypt-correct-password-aes256.test
1> 30/134 Test  #30: decrypt-correct-password-aes256.test .............   Passed    0.18 sec
1>        Start  31: decrypt-correct-password-pkware.test
1> 31/134 Test  #31: decrypt-correct-password-pkware.test .............   Passed    0.17 sec
1>        Start  32: decrypt-no-password-aes256.test
1> 32/134 Test  #32: decrypt-no-password-aes256.test ..................   Passed    0.17 sec
1>        Start  33: decrypt-wrong-password-aes128.test
1> 33/134 Test  #33: decrypt-wrong-password-aes128.test ...............   Passed    0.18 sec
1>        Start  34: decrypt-wrong-password-aes192.test
1> 34/134 Test  #34: decrypt-wrong-password-aes192.test ...............   Passed    0.18 sec
1>        Start  35: decrypt-wrong-password-aes256.test
1> 35/134 Test  #35: decrypt-wrong-password-aes256.test ...............   Passed    0.18 sec
1>        Start  36: decrypt-wrong-password-pkware.test
1> 36/134 Test  #36: decrypt-wrong-password-pkware.test ...............   Passed    0.16 sec
1>        Start  37: delete_add_same.test
1> 37/134 Test  #37: delete_add_same.test .............................   Passed    0.16 sec
1>        Start  38: delete_invalid.test
1> 38/134 Test  #38: delete_invalid.test ..............................   Passed    0.16 sec
1>        Start  39: delete_last.test
1> 39/134 Test  #39: delete_last.test .................................   Passed    0.14 sec
1>        Start  40: delete_multiple_last.test
1> 40/134 Test  #40: delete_multiple_last.test ........................   Passed    0.14 sec
1>        Start  41: delete_multiple_partial.test
1> 41/134 Test  #41: delete_multiple_partial.test .....................   Passed    0.16 sec
1>        Start  42: delete_renamed_rename.test
1> 42/134 Test  #42: delete_renamed_rename.test .......................   Passed    0.16 sec
1>        Start  43: encrypt.test
1> 43/134 Test  #43: encrypt.test .....................................   Passed    0.16 sec
1>        Start  44: encryption-nonrandom-aes128.test
1> 44/134 Test  #44: encryption-nonrandom-aes128.test .................***Failed    0.18 sec
1>        Start  45: encryption-nonrandom-aes192.test
1> 45/134 Test  #45: encryption-nonrandom-aes192.test .................***Failed    0.17 sec
1>        Start  46: encryption-nonrandom-aes256.test
1> 46/134 Test  #46: encryption-nonrandom-aes256.test .................***Failed    0.18 sec
1>        Start  47: encryption-nonrandom-pkware.test
1> 47/134 Test  #47: encryption-nonrandom-pkware.test .................***Failed    0.18 sec
1>        Start  48: encryption-remove.test
1> 48/134 Test  #48: encryption-remove.test ...........................   Passed    0.17 sec
1>        Start  49: extra_add.test
1> 49/134 Test  #49: extra_add.test ...................................   Passed    0.16 sec
1>        Start  50: extra_add_multiple.test
1> 50/134 Test  #50: extra_add_multiple.test ..........................   Passed    0.15 sec
1>        Start  51: extra_count.test
1> 51/134 Test  #51: extra_count.test .................................   Passed    0.15 sec
1>        Start  52: extra_count_by_id.test
1> 52/134 Test  #52: extra_count_by_id.test ...........................   Passed    0.15 sec
1>        Start  53: extra_count_ignore_zip64.test
1> 53/134 Test  #53: extra_count_ignore_zip64.test ....................   Passed    0.16 sec
1>        Start  54: extra_delete.test
1> 54/134 Test  #54: extra_delete.test ................................   Passed    0.15 sec
1>        Start  55: extra_delete_by_id.test
1> 55/134 Test  #55: extra_delete_by_id.test ..........................   Passed    0.15 sec
1>        Start  56: extra_field_align.test
1> 56/134 Test  #56: extra_field_align.test ...........................   Passed    0.52 sec
1>        Start  57: extra_get.test
1> 57/134 Test  #57: extra_get.test ...................................   Passed    0.17 sec
1>        Start  58: extra_get_by_id.test
1> 58/134 Test  #58: extra_get_by_id.test .............................   Passed    0.17 sec
1>        Start  59: extra_set.test
1> 59/134 Test  #59: extra_set.test ...................................   Passed    0.17 sec
1>        Start  60: extra_set_modify_c.test
1> 60/134 Test  #60: extra_set_modify_c.test ..........................   Passed    0.16 sec
1>        Start  61: extra_set_modify_l.test
1> 61/134 Test  #61: extra_set_modify_l.test ..........................   Passed    0.16 sec
1>        Start  62: fdopen_ok.test
1> 62/134 Test  #62: fdopen_ok.test ...................................***Skipped   0.12 sec
1>        Start  63: file_comment_encmismatch.test
1> 63/134 Test  #63: file_comment_encmismatch.test ....................   Passed    0.15 sec
1>        Start  64: fopen_unchanged.test
1> 64/134 Test  #64: fopen_unchanged.test .............................   Passed    0.14 sec
1>        Start  65: fread.test
1> 65/134 Test  #65: fread.test .......................................   Passed    0.16 sec
1>        Start  66: fseek_deflated.test
1> 66/134 Test  #66: fseek_deflated.test ..............................   Passed    0.15 sec
1>        Start  67: fseek_fail.test
1> 67/134 Test  #67: fseek_fail.test ..................................   Passed    0.15 sec
1>        Start  68: fseek_ok.test
1> 68/134 Test  #68: fseek_ok.test ....................................   Passed    0.15 sec
1>        Start  69: get_comment.test
1> 69/134 Test  #69: get_comment.test .................................   Passed    0.15 sec
1>        Start  70: junk_at_end.test
1> 70/134 Test  #70: junk_at_end.test .................................   Passed    0.17 sec
1>        Start  71: junk_at_start.test
1> 71/134 Test  #71: junk_at_start.test ...............................   Passed    0.17 sec
1>        Start  72: name_locate.test
1> 72/134 Test  #72: name_locate.test .................................   Passed    0.15 sec
1>        Start  73: open_cons_extrabytes.test
1> 73/134 Test  #73: open_cons_extrabytes.test ........................   Passed    0.18 sec
1>        Start  74: open_empty.test
1> 74/134 Test  #74: open_empty.test ..................................   Passed    0.15 sec
1>        Start  75: open_empty_2.test
1> 75/134 Test  #75: open_empty_2.test ................................   Passed    0.17 sec
1>        Start  76: open_extrabytes.test
1> 76/134 Test  #76: open_extrabytes.test .............................   Passed    0.17 sec
1>        Start  77: open_file_count.test
1> 77/134 Test  #77: open_file_count.test .............................   Passed    0.24 sec
1>        Start  78: open_filename_duplicate.test
1> 78/134 Test  #78: open_filename_duplicate.test .....................   Passed    0.18 sec
1>        Start  79: open_filename_duplicate_consistency.test
1> 79/134 Test  #79: open_filename_duplicate_consistency.test .........   Passed    0.17 sec
1>        Start  80: open_filename_duplicate_empty.test
1> 80/134 Test  #80: open_filename_duplicate_empty.test ...............   Passed    0.18 sec
1>        Start  81: open_filename_duplicate_empty_consistency.test
1> 81/134 Test  #81: open_filename_duplicate_empty_consistency.test ...   Passed    0.16 sec
1>        Start  82: open_filename_empty.test
1> 82/134 Test  #82: open_filename_empty.test .........................   Passed    0.15 sec
1>        Start  83: open_incons.test
1> 83/134 Test  #83: open_incons.test .................................   Passed    1.12 sec
1>        Start  84: open_many_fail.test
1> 84/134 Test  #84: open_many_fail.test ..............................   Passed    1.20 sec
1>        Start  85: open_many_ok.test
1> 85/134 Test  #85: open_many_ok.test ................................   Passed   11.74 sec
1>        Start  86: open_multidisk.test
1> 86/134 Test  #86: open_multidisk.test ..............................   Passed    0.17 sec
1>        Start  87: open_new_but_exists.test
1> 87/134 Test  #87: open_new_but_exists.test .........................   Passed    0.15 sec
1>        Start  88: open_new_ok.test
1> 88/134 Test  #88: open_new_ok.test .................................   Passed    0.14 sec
1>        Start  89: open_nonarchive.test
1> 89/134 Test  #89: open_nonarchive.test .............................   Passed    0.17 sec
1>        Start  90: open_nosuchfile.test
1> 90/134 Test  #90: open_nosuchfile.test .............................   Passed    0.14 sec
1>        Start  91: open_ok.test
1> 91/134 Test  #91: open_ok.test .....................................   Passed    0.15 sec
1>        Start  92: open_too_short.test
1> 92/134 Test  #92: open_too_short.test ..............................   Passed    0.18 sec
1>        Start  93: open_truncate.test
1> 93/134 Test  #93: open_truncate.test ...............................   Passed    0.14 sec
1>        Start  94: open_zip64_3mf.test
1> 94/134 Test  #94: open_zip64_3mf.test ..............................   Passed    0.15 sec
1>        Start  95: open_zip64_ok.test
1> 95/134 Test  #95: open_zip64_ok.test ...............................   Passed    0.16 sec
1>        Start  96: preload.test
1> 96/134 Test  #96: preload.test .....................................***Failed    0.14 sec
1>        Start  97: progress.test
1> 97/134 Test  #97: progress.test ....................................   Passed    0.19 sec
1>        Start  98: rename_ascii.test
1> 98/134 Test  #98: rename_ascii.test ................................   Passed    0.18 sec
1>        Start  99: rename_cp437.test
1> 99/134 Test  #99: rename_cp437.test ................................   Passed    0.15 sec
1>        Start 100: rename_deleted.test
1>100/134 Test #100: rename_deleted.test ..............................   Passed    0.16 sec
1>        Start 101: rename_fail.test
1>101/134 Test #101: rename_fail.test .................................   Passed    0.15 sec
1>        Start 102: rename_ok.test
1>102/134 Test #102: rename_ok.test ...................................   Passed    0.15 sec
1>        Start 103: rename_utf8.test
1>103/134 Test #103: rename_utf8.test .................................   Passed    0.16 sec
1>        Start 104: rename_utf8_encmismatch.test
1>104/134 Test #104: rename_utf8_encmismatch.test .....................   Passed    0.17 sec
1>        Start 105: set_comment_all.test
1>105/134 Test #105: set_comment_all.test .............................   Passed    0.16 sec
1>        Start 106: set_comment_localonly.test
1>106/134 Test #106: set_comment_localonly.test .......................   Passed    0.15 sec
1>        Start 107: set_comment_removeglobal.test
1>107/134 Test #107: set_comment_removeglobal.test ....................   Passed    0.16 sec
1>        Start 108: set_comment_revert.test
1>108/134 Test #108: set_comment_revert.test ..........................   Passed    0.15 sec
1>        Start 109: set_compression_bzip2_to_deflate.test
1>109/134 Test #109: set_compression_bzip2_to_deflate.test ............   Passed    0.16 sec
1>        Start 110: set_compression_deflate_to_bzip2.test
1>110/134 Test #110: set_compression_deflate_to_bzip2.test ............   Passed    0.16 sec
1>        Start 111: set_compression_deflate_to_deflate.test
1>111/134 Test #111: set_compression_deflate_to_deflate.test ..........   Passed    0.15 sec
1>        Start 112: set_compression_deflate_to_store.test
1>112/134 Test #112: set_compression_deflate_to_store.test ............   Passed    0.16 sec
1>        Start 113: set_compression_store_to_bzip2.test
1>113/134 Test #113: set_compression_store_to_bzip2.test ..............   Passed    0.16 sec
1>        Start 114: set_compression_store_to_deflate.test
1>114/134 Test #114: set_compression_store_to_deflate.test ............   Passed    0.15 sec
1>        Start 115: set_compression_store_to_store.test
1>115/134 Test #115: set_compression_store_to_store.test ..............   Passed    0.15 sec
1>        Start 116: set_compression_store_to_xz.test
1>116/134 Test #116: set_compression_store_to_xz.test .................   Passed    0.16 sec
1>        Start 117: set_compression_unknown.test
1>117/134 Test #117: set_compression_unknown.test .....................   Passed    0.15 sec
1>        Start 118: set_compression_xz_to_store.test
1>118/134 Test #118: set_compression_xz_to_store.test .................   Passed    0.16 sec
1>        Start 119: set_file_dostime.test
1>119/134 Test #119: set_file_dostime.test ............................   Passed    0.17 sec
1>        Start 120: stat_index_cp437_guess.test
1>120/134 Test #120: stat_index_cp437_guess.test ......................   Passed    0.15 sec
1>        Start 121: stat_index_cp437_raw.test
1>121/134 Test #121: stat_index_cp437_raw.test ........................   Passed    0.15 sec
1>        Start 122: stat_index_cp437_strict.test
1>122/134 Test #122: stat_index_cp437_strict.test .....................   Passed    0.15 sec
1>        Start 123: stat_index_fileorder.test
1>123/134 Test #123: stat_index_fileorder.test ........................   Passed    0.17 sec
1>        Start 124: stat_index_streamed.test
1>124/134 Test #124: stat_index_streamed.test .........................   Passed    0.16 sec
1>        Start 125: stat_index_streamed_zip64.test
1>125/134 Test #125: stat_index_streamed_zip64.test ...................   Passed    0.17 sec
1>        Start 126: stat_index_utf8_guess.test
1>126/134 Test #126: stat_index_utf8_guess.test .......................   Passed    0.15 sec
1>        Start 127: stat_index_utf8_raw.test
1>127/134 Test #127: stat_index_utf8_raw.test .........................   Passed    0.15 sec
1>        Start 128: stat_index_utf8_strict.test
1>128/134 Test #128: stat_index_utf8_strict.test ......................   Passed    0.15 sec
1>        Start 129: stat_index_utf8_unmarked_strict.test
1>129/134 Test #129: stat_index_utf8_unmarked_strict.test .............   Passed    0.15 sec
1>        Start 130: stat_index_zip64.test
1>130/134 Test #130: stat_index_zip64.test ............................   Passed    0.18 sec
1>        Start 131: utf-8-standardization.test
1>131/134 Test #131: utf-8-standardization.test .......................   Passed    0.18 sec
1>        Start 132: zip-in-archive-comment.test
1>132/134 Test #132: zip-in-archive-comment.test ......................   Passed    0.15 sec
1>        Start 133: zip64_creation.test
1>133/134 Test #133: zip64_creation.test ..............................   Passed   73.37 sec
1>        Start 134: zip64_stored_creation.test
1>134/134 Test #134: zip64_stored_creation.test .......................   Passed   11.15 sec
1>
1>96% tests passed, 6 tests failed out of 134
1>
1>Total Test time (real) = 122.87 sec
1>
1>The following tests did not run:
1>    7 - add_from_stdin.test (Skipped)
1>   23 - clone-fs-add.test (Skipped)
1>   24 - clone-fs-delete.test (Skipped)
1>   25 - clone-fs-replace.test (Skipped)
1>   62 - fdopen_ok.test (Skipped)
1>
1>The following tests FAILED:
1>    6 - add_from_filep.test (Failed)
1>   44 - encryption-nonrandom-aes128.test (Failed)
1>   45 - encryption-nonrandom-aes192.test (Failed)
1>   46 - encryption-nonrandom-aes256.test (Failed)
1>   47 - encryption-nonrandom-pkware.test (Failed)
1>   96 - preload.test (Failed)
1>Errors while running CTest

Details:

6/134 Testing: add_from_filep.test
6/134 Test: add_from_filep.test
Command: "D:/dev/Tools/strawberry-perl-5.30.2.1-64bit-PDL/perl/bin/perl.exe" "D:/libziptest/build/regress/runtest" "--bin-sub-directory" "Debug" "D:/libziptest/src/regress/add_from_filep.test"
Directory: D:/libziptest/build/regress
"add_from_filep.test" start time: May 18 17:19 Mitteleuropäische Sommerzeit
Output:
----------------------------------------------------------
Unexpected exit status:
-0
+1
Unexpected error output:
--- expected
+++ got
+Der Befehl """" ist entweder falsch geschrieben oder
+konnte nicht gefunden werden.
Unexpected files:
--- expected
+++ got
 testfile.txt
-testfile.zip
add_from_filep -- FAIL: exit status, error output, files
<end of output>
Test time =   0.18 sec
----------------------------------------------------------
Test Failed.
"add_from_filep.test" end time: May 18 17:19 Mitteleuropäische Sommerzeit
"add_from_filep.test" time elapsed: 00:00:00
----------------------------------------------------------
7/134 Testing: add_from_stdin.test
7/134 Test: add_from_stdin.test
Command: "D:/dev/Tools/strawberry-perl-5.30.2.1-64bit-PDL/perl/bin/perl.exe" "D:/libziptest/build/regress/runtest" "--bin-sub-directory" "Debug" "D:/libziptest/src/regress/add_from_stdin.test"
Directory: D:/libziptest/build/regress
"add_from_stdin.test" start time: May 18 17:19 Mitteleuropäische Sommerzeit
Output:
----------------------------------------------------------
<end of output>
Test time =   0.12 sec
----------------------------------------------------------
Test Passed.
"add_from_stdin.test" end time: May 18 17:19 Mitteleuropäische Sommerzeit
"add_from_stdin.test" time elapsed: 00:00:00
----------------------------------------------------------
23/134 Testing: clone-fs-add.test
23/134 Test: clone-fs-add.test
Command: "D:/dev/Tools/strawberry-perl-5.30.2.1-64bit-PDL/perl/bin/perl.exe" "D:/libziptest/build/regress/runtest" "--bin-sub-directory" "Debug" "D:/libziptest/src/regress/clone-fs-add.test"
Directory: D:/libziptest/build/regress
"clone-fs-add.test" start time: May 18 17:19 Mitteleuropäische Sommerzeit
Output:
----------------------------------------------------------
Der Befehl "." ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
clone-fs-add (SKIP) -- precheck failed
<end of output>
Test time =   0.13 sec
----------------------------------------------------------
Test Passed.
"clone-fs-add.test" end time: May 18 17:19 Mitteleuropäische Sommerzeit
"clone-fs-add.test" time elapsed: 00:00:00
----------------------------------------------------------
24/134 Testing: clone-fs-delete.test
24/134 Test: clone-fs-delete.test
Command: "D:/dev/Tools/strawberry-perl-5.30.2.1-64bit-PDL/perl/bin/perl.exe" "D:/libziptest/build/regress/runtest" "--bin-sub-directory" "Debug" "D:/libziptest/src/regress/clone-fs-delete.test"
Directory: D:/libziptest/build/regress
"clone-fs-delete.test" start time: May 18 17:19 Mitteleuropäische Sommerzeit
Output:
----------------------------------------------------------
Der Befehl "." ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
clone-fs-delete (SKIP) -- precheck failed
<end of output>
Test time =   0.13 sec
----------------------------------------------------------
Test Passed.
"clone-fs-delete.test" end time: May 18 17:19 Mitteleuropäische Sommerzeit
"clone-fs-delete.test" time elapsed: 00:00:00
----------------------------------------------------------
25/134 Testing: clone-fs-replace.test
25/134 Test: clone-fs-replace.test
Command: "D:/dev/Tools/strawberry-perl-5.30.2.1-64bit-PDL/perl/bin/perl.exe" "D:/libziptest/build/regress/runtest" "--bin-sub-directory" "Debug" "D:/libziptest/src/regress/clone-fs-replace.test"
Directory: D:/libziptest/build/regress
"clone-fs-replace.test" start time: May 18 17:19 Mitteleuropäische Sommerzeit
Output:
----------------------------------------------------------
Der Befehl "." ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
clone-fs-replace (SKIP) -- precheck failed
<end of output>
Test time =   0.13 sec
----------------------------------------------------------
Test Passed.
"clone-fs-replace.test" end time: May 18 17:19 Mitteleuropäische Sommerzeit
"clone-fs-replace.test" time elapsed: 00:00:00
----------------------------------------------------------
44/134 Testing: encryption-nonrandom-aes128.test
44/134 Test: encryption-nonrandom-aes128.test
Command: "D:/dev/Tools/strawberry-perl-5.30.2.1-64bit-PDL/perl/bin/perl.exe" "D:/libziptest/build/regress/runtest" "--bin-sub-directory" "Debug" "D:/libziptest/src/regress/encryption-nonrandom-aes128.test"
Directory: D:/libziptest/build/regress
"encryption-nonrandom-aes128.test" start time: May 18 17:19 Mitteleuropäische Sommerzeit
Output:
----------------------------------------------------------
Binary files D:/libziptest/src/regress/encrypt-aes128-noentropy.zip and encrypt.zzip differ
encryption-nonrandom-aes128 -- FAIL: files
<end of output>
Test time =   0.18 sec
----------------------------------------------------------
Test Failed.
"encryption-nonrandom-aes128.test" end time: May 18 17:19 Mitteleuropäische Sommerzeit
"encryption-nonrandom-aes128.test" time elapsed: 00:00:00
----------------------------------------------------------
45/134 Testing: encryption-nonrandom-aes192.test
45/134 Test: encryption-nonrandom-aes192.test
Command: "D:/dev/Tools/strawberry-perl-5.30.2.1-64bit-PDL/perl/bin/perl.exe" "D:/libziptest/build/regress/runtest" "--bin-sub-directory" "Debug" "D:/libziptest/src/regress/encryption-nonrandom-aes192.test"
Directory: D:/libziptest/build/regress
"encryption-nonrandom-aes192.test" start time: May 18 17:19 Mitteleuropäische Sommerzeit
Output:
----------------------------------------------------------
Binary files D:/libziptest/src/regress/encrypt-aes192-noentropy.zip and encrypt.zzip differ
encryption-nonrandom-aes192 -- FAIL: files
<end of output>
Test time =   0.17 sec
----------------------------------------------------------
Test Failed.
"encryption-nonrandom-aes192.test" end time: May 18 17:19 Mitteleuropäische Sommerzeit
"encryption-nonrandom-aes192.test" time elapsed: 00:00:00
----------------------------------------------------------
46/134 Testing: encryption-nonrandom-aes256.test
46/134 Test: encryption-nonrandom-aes256.test
Command: "D:/dev/Tools/strawberry-perl-5.30.2.1-64bit-PDL/perl/bin/perl.exe" "D:/libziptest/build/regress/runtest" "--bin-sub-directory" "Debug" "D:/libziptest/src/regress/encryption-nonrandom-aes256.test"
Directory: D:/libziptest/build/regress
"encryption-nonrandom-aes256.test" start time: May 18 17:19 Mitteleuropäische Sommerzeit
Output:
----------------------------------------------------------
Binary files D:/libziptest/src/regress/encrypt-aes256-noentropy.zip and encrypt.zzip differ
encryption-nonrandom-aes256 -- FAIL: files
<end of output>
Test time =   0.18 sec
----------------------------------------------------------
Test Failed.
"encryption-nonrandom-aes256.test" end time: May 18 17:19 Mitteleuropäische Sommerzeit
"encryption-nonrandom-aes256.test" time elapsed: 00:00:00
----------------------------------------------------------
47/134 Testing: encryption-nonrandom-pkware.test
47/134 Test: encryption-nonrandom-pkware.test
Command: "D:/dev/Tools/strawberry-perl-5.30.2.1-64bit-PDL/perl/bin/perl.exe" "D:/libziptest/build/regress/runtest" "--bin-sub-directory" "Debug" "D:/libziptest/src/regress/encryption-nonrandom-pkware.test"
Directory: D:/libziptest/build/regress
"encryption-nonrandom-pkware.test" start time: May 18 17:19 Mitteleuropäische Sommerzeit
Output:
----------------------------------------------------------
Binary files D:/libziptest/src/regress/encrypt-pkware-noentropy.zip and encrypt.zzip differ
encryption-nonrandom-pkware -- FAIL: files
<end of output>
Test time =   0.18 sec
----------------------------------------------------------
Test Failed.
"encryption-nonrandom-pkware.test" end time: May 18 17:19 Mitteleuropäische Sommerzeit
"encryption-nonrandom-pkware.test" time elapsed: 00:00:00
----------------------------------------------------------
62/134 Testing: fdopen_ok.test
62/134 Test: fdopen_ok.test
Command: "D:/dev/Tools/strawberry-perl-5.30.2.1-64bit-PDL/perl/bin/perl.exe" "D:/libziptest/build/regress/runtest" "--bin-sub-directory" "Debug" "D:/libziptest/src/regress/fdopen_ok.test"
Directory: D:/libziptest/build/regress
"fdopen_ok.test" start time: May 18 17:19 Mitteleuropäische Sommerzeit
Output:
----------------------------------------------------------
<end of output>
Test time =   0.12 sec
----------------------------------------------------------
Test Passed.
"fdopen_ok.test" end time: May 18 17:19 Mitteleuropäische Sommerzeit
"fdopen_ok.test" time elapsed: 00:00:00
----------------------------------------------------------
96/134 Testing: preload.test
96/134 Test: preload.test
Command: "D:/dev/Tools/strawberry-perl-5.30.2.1-64bit-PDL/perl/bin/perl.exe" "D:/libziptest/build/regress/runtest" "--bin-sub-directory" "Debug" "D:/libziptest/src/regress/preload.test"
Directory: D:/libziptest/build/regress
"preload.test" start time: May 18 17:19 Mitteleuropäische Sommerzeit
Output:
----------------------------------------------------------
Unexpected exit status:
-0
+1
Unexpected error output:
--- expected
+++ got
+non-zero byte found
preload -- FAIL: exit status, error output
<end of output>
Test time =   0.14 sec
----------------------------------------------------------
Test Failed.
"preload.test" end time: May 18 17:19 Mitteleuropäische Sommerzeit
"preload.test" time elapsed: 00:00:00
----------------------------------------------------------
OgreTransporter commented 4 years ago

Ok, adding the path with diff to the environment variable PATH does not work. You have to write the complete path directly into NiHTest.pm (585). This test environment is really annoying.

0-wiz-0 commented 4 years ago

Comparing your run to https://ci.appveyor.com/project/nih-at/libzip/builds/32952563/job/ilh90kry997qy4dy I wonder why

44 - encryption-nonrandom-aes128.test (Skipped)
45 - encryption-nonrandom-aes192.test (Skipped)
46 - encryption-nonrandom-aes256.test (Skipped)
47 - encryption-nonrandom-pkware.test (Skipped)
96 - preload.test (Skipped)

are run for you but not in appveyor. Any ideas?

(They need to preload a shared object to get rid of the randomness so we can test the encryption module.)

fd_open.ok should not run because we don't expect to be able to provide pipes on Windows. Is that assumption wrong?

The *clone* tests can not run because you'd need a file system with file cloning support, and the API to access it, and if that even exists on Windows we definitely don't have the code for it.

OgreTransporter commented 4 years ago

These are good questions. There are also pipes under Windows (https://docs.microsoft.com/en-us/windows/win32/ipc/pipes). I would suggest to exclude the tests that do not work under Windows, so that in case of success CTest returns a positive result.

The encryption tests are running but return an error:

    if (idx >= za->nentry) {
    zip_error_set(&za->error, ZIP_ER_INVAL, 0);
    return -1;
    }

The construct to load a library in Perl to overwrite a function in another program does not work under Windows. Under Windows, the library must be loaded in the same program. I am a little bit surprised that it works under Linux. Isn't that actually a security hole?

0-wiz-0 commented 4 years ago

I think this issue is now resolved. Thanks.