[前][次][番号順一覧][スレッド一覧]

ruby-changes:21548

From: naruse <ko1@a...>
Date: Tue, 1 Nov 2011 09:42:52 +0900 (JST)
Subject: [ruby-changes:21548] naruse:r33597 (trunk): On some platforms, object_id can be negative value like NetBSD.

naruse	2011-11-01 09:42:41 +0900 (Tue, 01 Nov 2011)

  New Revision: 33597

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33597

  Log:
    On some platforms, object_id can be negative value like NetBSD.

  Modified files:
    trunk/test/-ext-/symbol/test_inadvertent_creation.rb

Index: test/-ext-/symbol/test_inadvertent_creation.rb
===================================================================
--- test/-ext-/symbol/test_inadvertent_creation.rb	(revision 33596)
+++ test/-ext-/symbol/test_inadvertent_creation.rb	(revision 33597)
@@ -4,7 +4,7 @@
 module Test_Symbol
   class TestInadvertent < Test::Unit::TestCase
     def noninterned_name(prefix = "")
-      prefix += "_#{Thread.current.object_id.to_s(36)}"
+      prefix += "_#{Thread.current.object_id.to_s(36).tr('-', '_')}"
       begin
         name = "#{prefix}_#{rand(0x1000).to_s(16)}_#{Time.now.usec}"
       end while Bug::Symbol.interned?(name)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]