Граф коммитов

24 Коммитов

Автор SHA1 Сообщение Дата
nobu 07acd05ffb test/digest/test_digest.rb: fold long lines
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-27 06:26:09 +00:00
naruse 3e92b635fb Add frozen_string_literal: false for all files
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-16 05:07:31 +00:00
knu c02fa39463 Make Digest() thread-safe.
* ext/digest/lib/digest.rb (Digest()): This function should now be
  thread-safe.  If you have a problem with regard to on-demand
  loading under a multi-threaded environment, preload "digest/*"
  modules on boot or use this method instead of directly
  referencing Digest::*. [Bug #9494]
  cf. https://github.com/aws/aws-sdk-ruby/issues/525

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-31 13:21:51 +00:00
knu 2172b44898 * test/digest/test_digest.rb: Drop #!. This no longer runs
stand-alone because it depends on ruby/envutil.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-31 13:12:44 +00:00
nobu 15ae462d8b digest.c: typed data
* ext/digest/digest.c (rb_digest_base_alloc): use typed data.

* ext/digest/digest.c (rb_digest_base_copy): fail unless original
  object has same algorithm.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-27 01:30:16 +00:00
eregon bc211f3634 digest.c: fix #== for non-string arguments
* ext/digest/digest.c (rb_digest_instance_equal):
  fix #== for non-string arguments. [ruby-core:62967] [Bug #9913]
* test/digest/test_digest.rb: add test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46368 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-06 21:05:48 +00:00
zzak d553c518d5 * test/digest/test_digest.rb: Reverse order of assert_equal
Reported by @splattael


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43770 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 00:43:08 +00:00
zzak 671dbfdda8 * test/digest/test_digest.rb: Add more tests for digest/bubblebabble
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21 07:51:29 +00:00
zzak 543c99e25a * test/digest/test_digest.rb: Add test for Digest::SHA256.bubblebabble
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21 01:31:51 +00:00
naruse 7a32434fb6 Fix test failure of binmode from r40879
http://ruby-mswin.cloudapp.net/vc10-x64/ruby-trunk/log/20130521T131601Z.log.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-22 10:36:28 +00:00
knu 07a6b4cbb5 * ext/digest/lib/digest.rb (Digest::Class.file): Take optional
arguments that are passed to the constructor of the digest
  class.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-21 12:41:34 +00:00
eregon 61b624d149 ext/digest/digest.c (hexencode_str_new): return an ASCII string
* test/digest: tests for all kind of digests encodings
  [ruby-core:46792][Bug #6799]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-01 13:30:51 +00:00
nahi e56f2abe4b * ext/digest/sha2/sha2.c (SHA256_Update, SHA512_Update): avoid Bus
Error caused by unalignment access on Sparc-Solaris (and possibly on
  other similar environment.) This patch just do memcpy always instead
  of checking architecture. I see no perf drop on my 64bit env. For
  more details, see #4320.

* test/digest/test_digest.rb: add test for unalignment access.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-15 03:03:31 +00:00
knu 74cacd0df4 * ext/digest/digest.c (rb_digest_class_init): Define
Digest::Class.new(). [Feature #3954]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-18 04:26:06 +00:00
nobu 83a827ac9b * vm.c (vm_backtrace_each): skip allocator frames which have no
name.  [ruby-core:32231]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-09 14:25:56 +00:00
nobu fd1762b45b * test/digest/test_digest.rb (test_eq): use descriptive assertion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-02 05:56:35 +00:00
knu d8f265b332 * ext/digest/digest.c (rb_digest_instance_hexdigest_bang): Fix
rdoc.

* ext/digest/lib/digest.rb (Digest::Class.base64digest)
  (Digest::Instance#base64digest{,!}): New methods.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-01-17 19:12:10 +00:00
knu f678390e1f * ext/digest/digest.c (Init_digest): Digest::Base.new() does no
longer take an initial string to feed.  This change allows
  subclasses to take hashing parameters.  A statement such as
  ``md = Digest::MD5.new(s)'' can be easily rewritten as
  ``md = Digest::MD5.new << s'' or
  ``md = Digest::MD5.new.update(s)''.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-13 11:58:05 +00:00
matz ccf99b9ce6 * eval.c (ev_const_get): simplified using rb_const_get_fallback().
* eval.c (ev_const_defined): adopt to ev_const_get() using
  rb_const_defined_fallback().

* variable.c (rb_const_get_fallback): new function to implement
  constant search.

* variable.c (rb_const_defined_fallback): new function to
  implement constant definition check.

* variable.c (rb_const_get_0): adopt to new behavior.  constants
  are looked up in the order of: current class, super classes (but
  Object), lexically external classes/modules, and Object.

* variable.c (rb_const_defined_0): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-17 08:40:52 +00:00
ocean 52dca16384 * lib/drb/drb.rb (DRbServer.default_safe_level): fix typo.
* test/digest/test_digest.rb: separate test case for each algorithms.
  (Thanks nobu) [ruby-dev:25412]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-02-17 11:16:57 +00:00
matz e77ddaf0d1 * array.c (rb_ary_delete): element comparison might change array
size. [ruby-dev:24273]

* parse.y: make ruby parser reentrant. merge ripper parser to the
  real one.  this change makes ruby require bison.

* file.c (rb_file_truncate): clear stdio buffer before truncating
  the file.  [ruby-dev:24191]

* ext/digest/digest.c: use rb_obj_class() instead of CLASS_OF
  which might return singleton class.  [ruby-dev:24202]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-09-17 09:24:13 +00:00
akr 08907d87e0 add test for [ruby-dev:24060], [ruby-dev:24065], [ruby-dev:24103],
[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
2004-09-07 05:32:26 +00:00
nobu e45c4cd1ac * test/digest/test_digest.rb (test_eq): show failed class.
* test/ruby/test_iterator.rb (test_break, test_return_trace_func):
  test localjump destination.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-15 23:38:10 +00:00
knu 6d9c20d6a3 * test/digest/test_digest.rb: Moved from ext/digest/test.rb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-10-14 19:34:46 +00:00