aboutsummaryrefslogtreecommitdiffstats
path: root/test/zlib
Commit message (Collapse)AuthorAgeFilesLines
* * test/zlib/test_zlib.rb (test_adler32_combine, test_crc32_combine):odaira2016-03-041-0/+10
| | | | | | | | Skip two tests on AIX because zconf.h in zlib does not correctly recognize _LARGE_FILES in AIX. The problem was already reported to zlib, and skip these tests until it is fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use assert_raisenobu2015-06-021-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (rb_gzreader_external_encoding):glass2015-05-101-1/+4
| | | | | | | | | define GzipReader#external_encoding. [Bug #10900] * test/zlib/test_zlib.rb: test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (rb_gzfile_close): Don't raise on doubleakr2015-03-081-0/+22
| | | | | | | | close for consistent to IO#close. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49893 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * io.c (rb_io_close_m): Don't raise when the IO object is closed.akr2015-01-151-1/+1
| | | | | | | | [ruby-core:67444] [Feature #10718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* zlib: GzipReader#rewind preserves ZSTREAM_FLAG_GZFILEnormal2014-08-301-0/+5
| | | | | | | | | | | | | | | | | | | | * ext/zlib/zlib.c (gzfile_reset): preserve ZSTREAM_FLAG_GZFILE [Bug #10101] * test/zlib/test_zlib.rb (test_rewind): test each_byte We must preserve the ZSTREAM_FLAG_GZFILE flag to prevent zstream_detach_buffer from: a) returning Qnil and breaking out of the `each_byte' loop b) yielding a large string to each_byte Note: the test case in bug report takes a long time. I found this bug because I noticed the massive time descrepancy between `each_byte' and `readbyte' loop before this patch. With this patch, `each_byte' and `readbyte' both take very long. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb: remove commented out code.hsbt2014-02-281-2/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/socket/test_addrinfo.rb: remove unused variables.hsbt2014-02-181-4/+1
| | | | | | | | | | | | * test/socket/test_nonblock.rb: ditto. * test/socket/test_socket.rb: ditto. * test/socket/test_unix.rb: ditto. * test/testunit/test_parallel.rb: ditto. * test/webrick/test_filehandler.rb: ditto. * test/xmlrpc/test_features.rb: ditto. * test/zlib/test_zlib.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (zstream_run): Fix handling of deflate streams thatdrbrain2013-08-281-0/+6
| | | | | | | | | | need a dictionary but are being decompressed by Zlib::Inflate.inflate (which has no option to set a dictionary). Now Zlib::NeedDict is raised instead of crashing. [ruby-trunk - Bug #8829] * test/zlib/test_zlib.rb (TestZlibInflate): Test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* zlib.c: check EOFnobu2013-05-311-0/+6
| | | | | | | * ext/zlib/zlib.c (gzfile_read, gzfile_read_all, gzfile_getc), (gzreader_gets): check EOF. [ruby-core:55220] [Bug #8467] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/csv/test_features.rb, test/logger/test_logger.rbakr2013-04-201-371/+368
| | | | | | | | | | | | | | | | | | test/mkmf/test_have_macro.rb, test/net/http/test_http.rb, test/openssl/test_config.rb, test/psych/test_encoding.rb, test/psych/test_exception.rb, test/psych/test_psych.rb, test/psych/test_tainted.rb, test/readline/test_readline.rb, test/rexml/test_contrib.rb, test/ruby/test_autoload.rb, test/ruby/test_beginendblock.rb, test/ruby/test_exception.rb, test/ruby/test_file.rb, test/ruby/test_io.rb, test/ruby/test_marshal.rb, test/ruby/test_process.rb, test/ruby/test_require.rb, test/ruby/test_rubyoptions.rb, test/syslog/test_syslog_logger.rb, test/webrick/test_httpauth.rb, test/zlib/test_zlib.rb: Use Tempfile.create. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_require.rb: Remove temporally files in the tests.akr2013-03-241-0/+32
| | | | | | | | | | | | | | | | | | | | * test/ruby/test_rubyoptions.rb: Ditto. * test/logger/test_logger.rb: Ditto. * test/psych/test_psych.rb: Ditto. * test/readline/test_readline.rb: Ditto. * test/syslog/test_syslog_logger.rb: Ditto. * test/webrick/test_httpauth.rb: Ditto. * test/zlib/test_zlib.rb: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c: Added streaming support to inflate processing.drbrain2012-07-101-0/+153
| | | | | | | | | | | | | | | | | | | | | This allows zlib streams to be processed without huge memory growth. [Feature #6612] * NEWS: ditto * ext/zlib/zlib.c (zstream_expand_buffer): Uses rb_yield when a block is given for streaming support. Refactored to use zstream_expand_buffer_into to remove duplicate code. * ext/zlib/zlib.c (zstream_expand_buffer_protect): Added wrapper function to pass jump state back through GVL-free section to allow zstream clean-up before terminating the ruby call. * ext/zlib/zlib.c (zstream_expand_buffer_without_gvl): Acquire GVL to yield processed chunk of output stream. * ext/zlib/zlib.c (zstream_detach_buffer): When a block is given, returns Qnil mid-stream and yields the output buffer at the end of the stream. * test/zlib/test_zlib.rb: Updated tests git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c: Revert r36349. Added streaming support to inflatedrbrain2012-07-101-153/+0
| | | | | | | | | | processing. rb_block_given_p() is not callable without the GVL. * ext/zlib/extconf.rb: ditto * NEWS: ditto * test/zlib/test_zlib.rb: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c: Added streaming support to inflate processing.drbrain2012-07-101-0/+153
| | | | | | | | | | | | | | | | | | | | | | | This allows zlib streams to be processed without huge memory growth. [Feature #6612] * NEWS: ditto * ext/zlib/zlib.c (zstream_expand_buffer): Uses rb_yield when a block is given for streaming support. Refactored to use zstream_expand_buffer_into to remove duplicate code. * ext/zlib/zlib.c (zstream_expand_buffer_protect): Added wrapper function to pass jump state back through GVL-free section to allow zstream clean-up before terminating the ruby call. * ext/zlib/zlib.c (zstream_expand_buffer_without_gvl): Acquire GVL to yield processed chunk of output stream. * ext/zlib/zlib.c (zstream_detach_buffer): When a block is given, returns Qnil mid-stream and yields the output buffer at the end of the stream. * ext/zlib/extconf.rb: Update INCFLAGS to find internal.h for rb_thread_call_with_gvl * test/zlib/test_zlib.rb: Updated tests git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb (test_inflate_partial_input): Added test fordrbrain2012-07-031-0/+19
| | | | | | | inflating incomplete zlib streams. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb (test_inflate): add a test for Zlib.inflate.naruse2012-05-041-0/+8
| | | | | | | | patched by headius (Charles Nutter). [ruby-core:44859] [Bug #6398] * test/zlib/test_zlib.rb (test_deflate): add a test for Zlib.deflate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb (TestZlibGzipReader#test_encoding): Add nahi2012-02-241-0/+16
| | | | | | | | | encoding testcases for GzipReader#read. read() emits Encoding.default_external in contrast to read(size) emits BINARY. See also: http://bugs.jruby.org/6208 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (rb_inflate_add_dictionary): Addeddrbrain2012-02-111-0/+17
| | | | | | | | Zlib::Inflate#add_dictionary to allow users to pre-specify for using during #inflate. [ruby-trunk - Feature #5937] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (do_inflate): Inflate more data if buffered datadrbrain2012-02-111-0/+23
| | | | | | | | exists. Allows Zlib::Inflate#set_dictionary to work. [ruby-trunk - Bug #5929] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb (TestZlibGzipReader#test_reader_wrap): setshirosaki2012-01-281-0/+1
| | | | | | | | binmode explicitly for fixing test error on Windows. This is consistent with r34243. [ruby-dev:45149] [Bug #5812] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb (TestZlibGzipWriter#test_writer_wrap): setusa2012-01-091-0/+1
| | | | | | | binmode explicitly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (gzfile_read_header): Ensure that each section ofnahi2011-08-231-0/+14
| | | | | | | | | gzip header is readable to avoid SEGV. * test/zlib/test_zlib.rb (test_corrupted_header): Test it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (gzfile_reader_get_unused): no need to dupnobu2011-02-031-2/+2
| | | | | | before rb_str_resurrect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30776 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* e ext/zlib/zlib.c (gzfile_reader_get_unused): use rb_str_resurrectnaruse2011-02-031-2/+30
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (gzreader_gets): support optional lengthnobu2010-12-251-0/+34
| | | | | | parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb (test_readline): renamed from test_gets.nobu2010-12-251-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb (test_to_io): forgotten to fix with r30201.usa2010-12-151-2/+3
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb (*): should close files associated with zlib.usa2010-12-141-129/+151
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (gzfile_raise): add invalid header tonobu2010-07-071-0/+18
| | | | | | | exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28562 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb (test_adler32_combine, test_crc32_combine): skip ifusa2010-05-191-2/+10
| | | | | | | they are not implemented. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* avoid method redefinition.akr2010-02-141-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c: added Zlib.crc32_combine and Zlib.adler32_combinetenderlove2010-01-191-0/+12
| | | | | | * test/zlib/test_zlib.rb: corresponding tests [ruby-core:27551] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (gzfile_read_all): use gzfile_newstr;naruse2009-08-291-2/+4
| | | | | | set and convert its encoding. [ruby-dev:38304] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (Zlib::GzipFile#path): New method.knu2009-04-221-0/+28
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb(test_readchar): compare in same type.takano322008-11-031-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/stringio/stringio.c (strio_write): should convert writingmatz2008-10-211-1/+1
| | | | | | | | | | | string to the encoding of the buffer. * hash.c (rb_any_hash): typo fixed. * ext/zlib/zlib.c (rb_gzwriter_write): oops, IO string conversion need to be done by to_s. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c (rb_gzwriter_write): conversion should be donematz2008-10-211-1/+1
| | | | | | | | | | | | using to_str, not to_s. * ext/zlib/zlib.c (rb_gzwriter_write): need proper conversion according to gz encoding. * ext/zlib/zlib.c (rb_gzreader_ungetc): convert string encoding before unget. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c: remove obsolete prototype macros.matz2008-10-211-1/+11
| | | | | | | | | | | | | | | | | | | | * ext/zlib/zlib.c (struct gzfile): add encoding field to gzfile structure. * ext/zlib/zlib.c (rb_gzreader_getc): now works on characters. * ext/zlib/zlib.c (rb_gzreader_getbyte): new method to retrieve single byte. * ext/zlib/zlib.c (rb_gzreader_readbyte): ditto. * ext/zlib/zlib.c (rb_gzreader_each_byte): renamed from each_char * ext/zlib/zlib.c (rb_gzreader_ungetc): allow unget strings. * ext/zlib/zlib.c (rb_gzreader_ungetbyte): renamed from ungetc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb (TestZlibDeflate#test_params): suppress a finalizer ↵kazu2008-07-231-0/+1
| | | | | | warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb: add a test for Zlib::Deflate#params.mame2008-07-111-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/zlib/test_zlib.rb: add tests to achieve over 90% test coveragemame2008-06-081-2/+576
| | | | | | | of zlib. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* use ML ref. for assertion message.akr2007-11-181-10/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* don't modify $/akr2004-09-071-12/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_ungetc_paragraph: restore $/.akr2004-09-071-7/+12
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add test for [ruby-dev:24060], [ruby-dev:24065], [ruby-dev:24103],akr2004-09-071-4/+34
| | | | | | | | [ruby-dev:24190], [ruby-dev:24191], [ruby-dev:24194], [ruby-dev:24197], [ruby-dev:24202], [ruby-dev:24213], [ruby-dev:24223] and [ruby-dev:24228]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/zlib/zlib.c: Zlib::GzipReader#read(0) returns "" instead of nil.akr2004-08-061-0/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add test for [ruby-dev:23344].akr2004-04-071-1/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* check zlib existence.akr2004-04-061-4/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e