[ruby/zlib] Revert "Workaround: Fix test failures on Ubuntu jammy s390x."

This reverts commit https://github.com/ruby/zlib/commit/9f3b9c470c05 because we will
fix the issue on alternative way.

https://github.com/ruby/zlib/commit/3dfe3f9110
This commit is contained in:
Jun Aruga 2023-09-29 11:29:32 +02:00 committed by git
parent 49d3bbe13b
commit 7278747d08

View File

@ -12,10 +12,6 @@ rescue LoadError
end
if defined? Zlib
child_env = {}
child_env['DFLTCC'] = '0' if RUBY_PLATFORM =~ /s390x/
Zlib::CHILD_ENV = child_env.freeze
class TestZlibDeflate < Test::Unit::TestCase
def test_initialize
z = Zlib::Deflate.new
@ -48,7 +44,6 @@ if defined? Zlib
end
def test_deflate_chunked
assert_separately([Zlib::CHILD_ENV, '-rzlib'], <<~'end;')
original = ''.dup
chunks = []
r = Random.new 0
@ -76,11 +71,9 @@ if defined? Zlib
inflated = Zlib.inflate all
assert_equal original, inflated
end;
end
def test_deflate_chunked_break
assert_separately([Zlib::CHILD_ENV, '-rzlib'], <<~'end;')
chunks = []
r = Random.new 0
@ -104,7 +97,6 @@ if defined? Zlib
original = Zlib.inflate all
assert_equal input, original
end;
end
def test_addstr
@ -960,7 +952,6 @@ if defined? Zlib
end
def test_unused2
assert_separately([Zlib::CHILD_ENV, '-rzlib', '-rstringio'], <<~'end;')
zio = StringIO.new
io = Zlib::GzipWriter.new zio
@ -985,7 +976,6 @@ if defined? Zlib
assert_equal('bbbb', io.read)
assert_equal(nil, io.unused)
io.finish
end;
end
def test_read
@ -1412,7 +1402,6 @@ if defined? Zlib
end
def test_deflate_stream
assert_separately([Zlib::CHILD_ENV, '-rzlib'], <<~'end;')
r = Random.new 0
deflated = ''.dup
@ -1422,36 +1411,27 @@ if defined? Zlib
end
assert_equal 20016, deflated.length
end;
end
def test_gzip
assert_separately([Zlib::CHILD_ENV, '-rzlib'], <<~'end;')
actual = Zlib.gzip("foo".freeze)
actual[4, 4] = "\x00\x00\x00\x00" # replace mtime
actual[9] = "\xff" # replace OS
expected = %w[1f8b08000000000000ff4bcbcf07002165738c03000000].pack("H*")
assert_equal expected, actual
end;
end
def test_gzip_level_0
actual = Zlib.gzip("foo".freeze, level: 0)
actual[4, 4] = "\x00\x00\x00\x00" # replace mtime
actual[9] = "\xff" # replace OS
expected = %w[1f8b08000000000000ff010300fcff666f6f2165738c03000000].pack("H*")
assert_equal expected, actual
end
def test_gzip_level_9
actual = Zlib.gzip("foo".freeze, level: 9)
actual[4, 4] = "\x00\x00\x00\x00" # replace mtime
actual[9] = "\xff" # replace OS
expected = %w[1f8b08000000000002ff4bcbcf07002165738c03000000].pack("H*")
assert_equal expected, actual
end
def test_gzip_level_9_filtered
actual = Zlib.gzip("foo".freeze, level: 9, strategy: Zlib::FILTERED)
actual[4, 4] = "\x00\x00\x00\x00" # replace mtime
actual[9] = "\xff" # replace OS