summaryrefslogtreecommitdiff
path: root/test/ruby/test_pack.rb
AgeCommit message (Collapse)Author
2016-04-09assertions.rb: set default internal encodingnobu
* test/lib/test/unit/assertions.rb (assert_raise_with_message): set default internal encoding to the excpected message, which affects String#inspect in messages. * test/lib/test/unit/assertions.rb (assert_warning): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
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
2015-12-13pack.c: check index rangenobu
* pack.c (pack_pack): always check index range against the receiver array length, which can be shortened by elements conversion. reported by Marcin 'Icewall' Noga of Cisco Talos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-12* pack.c (pack_{un,}pack): new template character `j` and `J`, pointerusa
with signed and unsigned integers. * NEWS: mention bout this featre. [Feature #11215] [ruby-dev:49015] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-06pack.c: escape and encodingnobu
* pack.c (pack_pack): escape unprintable characters and preserve the encoding of warning message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-06test_pack.rb: test_invalid_warningnobu
* test/ruby/test_pack.rb (test_invalid_warning): add test for invalid directive warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-17* pack.c (pack_unpack): Add casts for char references for 'u'.akr
Fix line ending recognition algorithm. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-11pack.c: fix buffer overrunnobu
* pack.c (encodes): fix buffer overrun by tail_lf. Thanks to Mamoru Tasaka and Tomas Hoger. [ruby-core:63604] [Bug #10019] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-04pack.c: use ivar for associated objectsnobu
* pack.c (str_associate, str_associated): keep associated objects in an instance variables, instead of in the internal structure. * string.c (rb_str_associate, rb_str_associated): deprecate. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-04string.c: enable capacity when setting capanobu
* string.c (rb_str_modify_expand): enable capacity and disable assocation with packed objects when setting capa, so that pack("p") string fails to unpack properly after modified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-13test/ruby: better assertionsnobu
* test/ruby: use better assertions instead of mere assert. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-18* pack.c (pack_unpack): output characters even if the input doesn'tnaruse
have paddings. [Bug #8286] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-06add a comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-03Add comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-02* pack.c: Support Q! and q! for long long.akr
(natstr): Moved to toplevel. Add q and Q if there is long long type. (endstr): Moved to toplevel. (NATINT_PACK): Consider long long. (NATINT_LEN_Q): New macro. (pack_pack): Support Q! and q!. (pack_unpack): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* ruby.c (load_file_internal): set default source encoding asnaruse
UTF-8 instead of US-ASCII. [ruby-core:46021] [Feature #6679] * parse.y (parser_initialize): set default parser encoding as UTF-8 instead of US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-19set encoding to ASCII for appropriate String#unpack modifierseregon
* pack.c (pack_unpack): set encoding of the 'H','h','B' and 'B' modifiers to US-ASCII. * test/ruby/test_pack.rb: tests for the above. [ruby-core:47653][Bug #7050] * test/test_securerandom.rb: tests for SecureRandom.hex from tenderlove. [ruby-core:46792][Bug #6799] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-24test_pack.rb: fix assertionnobu
* pack.c (pack_unpack): fix indent. * test/ruby/test_pack.rb (test_pack_unpack_M): fix assertion. ignore invalid quoted-printable and just skip. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-24* test/ruby/test_pack.rb (test_pack_unpack_M): was redefinedusa
accidentally. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18pack.c: round down too long uuencode widthnobu
* pack.c (pack_pack): round down too long uuencode width. folding width in uuencode format cannot be longer than 63 bytes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-11Set $VERBOSE=false in case of ruby -w.naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-10* pack.c (pack_pack): Warn when an invalid character is found in thedrbrain
format string when $VERBOSE is true. [ruby-trunk - Feature #5219] * pack.c (pack_unpack): ditto * test/ruby/test_pack.rb (class TestPack): Test for warnings on invalid format characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-11* pack.c (pack_unpack): when unpack('M') occurs an illegal bytenaruse
sequence, output the "=" character and the following character in the decoded data without any transformation. [ruby-dev:44875] [Bug #5635] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-12* lib/test/unit.rb (assert_include): add alias.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-14* pack.c (pack_unpack): the resulted string of unpack('M') must havenaruse
ASCII-8BIT encoding (and ENC_CODERANGE_VALID). [ruby-core:34482] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-15* pack.c (PACK_ITEM_ADJUST): return nil not result array and yieldnobu
values if block is given. [ruby-core:33193] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-18Revert r29527. [ruby-dev:42419]naruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29529 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-18* pack.c (pack_pack): Add native size option ! to q and Q.naruse
[ruby-dev:42375] * pack.c (pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-15* pack.c (pack_pack): fix more than one modifiers appear in thenaruse
format string. [ruby-core:32793] * pack.c (pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-14* pack.c (pack_pack): support endian modifiers: < and >.naruse
[ruby-dev:42376] Feature #3491 * pack.c (pack_unpack): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29496 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-29* lib/test/unit/assertions.rb (Test::Unit::Assertions#assert):nobu
use more descriptive assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-25* pack.c: consider DYNAMIC_ENDIAN. refactored.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-24* pack.c (pack_unpack): don't use OFF32 for gcc 4.5.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-18* pack.c (pack_unpack): call PACK_ITEM_ADJUST for 'Q'.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-08* pack.c (pack_pack): fixed length for odd length string.nobu
[ruby-dev:37283] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20580 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-06* pack.c (pack_pack): 'u0' is not special differently from 'm0'.yugui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-29* test/ruby/test_array.rb (test_pack): use utf-8.nobu
* test/ruby/test_pack.rb (test_pack_U): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-25* pack.c (pack_pack, pack_unpack): 'm0' format (base64) complies withmame
RFC 4648. It adds no line feed when encoding, and raise ArgumentError if the encoded string contains non-alphabet (including CR and LF). * lib/base64.rb: added. This provides encoding/decoding method for Base64 in standard RFC 2045, Base64 in standard RFC 4648 and ``Base 64 Encoding with URL and Filename SafeAlphabet'' in RFC 4648. * test_pack.c, test/base64/test_base64.rb: add tests for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-24* test: assert_raises has been deprecated since a long time ago.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-17* pack.c (pack_pack): check errno to detect error of ruby_strtoul.mame
* pack.c (pack_unpack): ditto. * test/ruby/test_pack.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-15* test/ruby/test_string.rb: add tests to achieve over 90% testmame
coverage of string.c. * test/ruby/test_m17n.rb: ditto. * test/ruby/test_symbol.rb: ditto. * test/ruby/test_pack.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-02-10* test/ruby/test_pack.rb: fix tests for 64bit CPU.mame
* test/ruby/test_bignum.rb: ditto. * test/ruby/test_file_exhaustive.rb: ditto. * test/ruby/test_integer.rb: ditto. * test/ruby/test_time.rb: ditto. * test/ruby/test_numeric.rb: ditto. * test/ruby/test_fixnum.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-31* test/ruby/test_bignum.rb: suppress warnings during test.mame
* test/ruby/test_enum.rb: ditto. * test/ruby/test_integer.rb: add tests to achieve over 90% test coverage of numeric.c. * test/ruby/test_float.rb: ditto. * test/ruby/test_fixnum.rb: ditto. * test/ruby/test_numeric.rb: ditto. * test/ruby/test_pack.rb: add tests to achieve over 90% test coverage of pack.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-23* string.c (str_make_independent): should set length.nobu
* string.c (rb_str_associate): hide associated array from ObjectSpace. * string.c (rb_str_associated): return associated array with freezing instead of false. [ruby-dev:33282] * string.c (rb_str_freeze): freeze associated array together. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-17* util.c (ruby_strtod): Float("1e") should fail. [ruby-core:7330]ocean
* pack.c (EXTEND32): unpack("l") did not work where sizeof(long) != 4. [ruby-talk:180024] * pack.c (pack_unpack): fixed integer overflow on template "w". [ruby-talk:180126] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-07add an assertion for [0x100000000].pack("U").akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-04-01add test_pack_U.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-02-18 * test/*: should not depend on $KCODE.nahi
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-01-22* pack.c (num2i32): pack should not raise RangeError.matz
[ruby-dev:22654] * pack.c (pack_pack): do not auto convert nil to zero. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e