diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-03 17:12:46 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-03 17:12:46 +0000 |
commit | 719e53d806d4ccc8ff28206dfb98cc8e75a2b3c1 (patch) | |
tree | 4defc2cf5c47e8b7aa9b0e2247e709ea43733bd7 /test | |
parent | d2aef34ce98a04495214eecd823607c7c703c2ee (diff) | |
download | ruby-719e53d806d4ccc8ff28206dfb98cc8e75a2b3c1.tar.gz ruby-719e53d806d4ccc8ff28206dfb98cc8e75a2b3c1.tar.xz ruby-719e53d806d4ccc8ff28206dfb98cc8e75a2b3c1.zip |
* ext/dl/cptr.c (rb_dlptr_eql, rb_dlptr_cmp): DL::CPtr#== and DL::CPtr#<=>
should not raise an exception when compared to a different object.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/dl/test_cptr.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/dl/test_cptr.rb b/test/dl/test_cptr.rb index 2a55a07de..c03abbe73 100644 --- a/test/dl/test_cptr.rb +++ b/test/dl/test_cptr.rb @@ -3,6 +3,22 @@ require_relative '../ruby/envutil' module DL class TestCPtr < TestBase + def test_equals + ptr = CPtr.new 0 + ptr2 = CPtr.new 0 + assert_equal ptr2, ptr + end + + def test_not_equals + ptr = CPtr.new 0 + assert_not_equal 10, ptr, '10 should not equal the pointer' + end + + def test_cmp + ptr = CPtr.new 0 + assert_nil(ptr <=> 10, '10 should not be comparable') + end + def test_ref_ptr ary = [0,1,2,4,5] addr = CPtr.new(dlwrap(ary)) |