西山です。

1.9のtest_05_eq(TestDRbCore)のassertで

test_05_eq(TestDRbCore) [.../test/drb/drbtest.rb:143]:
<false> is not true.

が出ているので、
drb/eqを一時的に無効にできるようにして、さらにassert_not_equal
に変更してみました。


Index: lib/drb/eq.rb
===================================================================
RCS file: /cvsup/ruby/cvs/ruby/lib/drb/eq.rb,v
retrieving revision 1.1
diff -u -p -r1.1 eq.rb
--- lib/drb/eq.rb       18 Jun 2003 15:43:10 -0000      1.1
+++ lib/drb/eq.rb       21 Feb 2004 12:31:16 -0000
@@ -2,12 +2,24 @@ require 'drb/drb'

 module DRb
   class DRbObject
+    @@eq_disabled = false
+
+    def DRbObject.eq_enable
+      @@eq_disabled = false
+    end
+
+    def DRbObject.eq_disable
+      @@eq_disabled = true
+    end
+
     def ==(other)
+      return super(other) if @@eq_disabled
       return false unless DRbObject === other
      (@ref == other.__drbref) && (@uri == other.__drburi)
     end

     def hash
+      return super if @@eq_disabled
       [@uri, @ref].hash
     end

Index: test/drb/drbtest.rb
===================================================================
RCS file: /cvsup/ruby/cvs/ruby/test/drb/drbtest.rb,v
retrieving revision 1.5
diff -u -p -r1.5 drbtest.rb
--- test/drb/drbtest.rb 30 Oct 2003 13:30:48 -0000      1.5
+++ test/drb/drbtest.rb 21 Feb 2004 12:27:55 -0000
@@ -1,9 +1,12 @@
 require 'test/unit'
 require 'drb/drb'
+require 'drb/eq'
 require 'drb/extservm'
 require 'timeout'
 require 'rbconfig'

+DRb::DRbObject.eq_disable
+
 class DRbService
   @@manager = DRb::ExtServManager.new
   @@ruby = File.join(
@@ -137,13 +140,17 @@ module DRbCore
   end

   def test_05_eq
+    DRb::DRbObject.eq_disable
     a = @there.to_a[0]
     b = @there.to_a[0]
-    assert(a.object_id != b.object_id)
-    assert(a != b)
-    assert(a.hash != b.hash)
+    p [a.object_id, b.object_id]
+    p [a.class, b.class]
+    p [a.hash, b.hash]
+    assert_not_equal(a.object_id, b.object_id)
+    assert_not_equal(a, b)
+    assert_not_equal(a.hash, b.hash)
     assert(! a.eql?(b))
-    require 'drb/eq'
+    DRb::DRbObject.eq_enable
     assert(a == b)
     assert_equal(a, b)
     assert(a == @there)
@@ -151,6 +158,7 @@ module DRbCore
     assert_equal(a.hash, @there.hash)
     assert(a.eql?(b))
     assert(a.eql?(@there))
+    DRb::DRbObject.eq_disable
   end

   def test_06_timeout
Index: test/rinda/test_rinda.rb
===================================================================
RCS file: /cvsup/ruby/cvs/ruby/test/rinda/test_rinda.rb,v
retrieving revision 1.3
diff -u -p -r1.3 test_rinda.rb
--- test/rinda/test_rinda.rb    19 Feb 2004 13:39:40 -0000      1.3
+++ test/rinda/test_rinda.rb    20 Feb 2004 16:57:48 -0000
@@ -3,10 +3,18 @@ require 'test/unit'
 require 'drb/drb'
 require 'drb/eq'
 require 'rinda/tuplespace'
+DRb::DRbObject.eq_disable

 module Rinda

 module TupleSpaceTestModule
+  def setup
+    DRb::DRbObject.eq_enable
+  end
+  def teardown
+    DRb::DRbObject.eq_disable
+  end
+
   def test_00_tuple
     tuple = Rinda::TupleEntry.new([1,2,3])
     assert(!tuple.canceled?)



-- 
|ZnZ(ゼット エヌ ゼット)
|西山和広(Kazuhiro NISHIYAMA)