test/file_extract_test.rb: fix test_extract_incorrect_size in s390x arch #445
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using the current pack directives makes test_extract_incorrect_size fail
in s390x architecture because of the endian probably. This is the output
of the command executed by the test in amd64:
irb(main):001:0> [501, 500000, 1].pack('LLS')
=> "\xF5\x01\x00\x00 \xA1\a\x00\x01\x00"
And the output of the same command in s390x:
irb(main):001:0> [501, 500000, 1].pack('LLS')
=> "\x00\x00\x01\xF5\x00\a\xA1 \x00\x01"
Changing to 'V' pack directive like is used in
lib/zib/central_directory.rb fixes the test in s390x and does not add a
regression in amd64.
FTR I've faced this issue in ruby-zip Debian package in Ubuntu, here is the log: https://objectstorage.prodstack4-5.canonical.com/v1/AUTH_77e2ada1e7a84929a74ba3b87153c0ac/autopkgtest-focal/focal/s390x/r/ruby-zip/20200323_152440_d8d79@/log.gz