diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-01 01:47:08 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-11-01 01:47:08 +0000 |
commit | 4515fc22893bbc3d7cc1e1b1dc3e92fc8adc3bdd (patch) | |
tree | 180b27b003760335f6a5176a031e5b9914a3e04f /test | |
parent | 545dfac5d42d1b6951a5db2395bde5247741f568 (diff) | |
download | ruby-4515fc22893bbc3d7cc1e1b1dc3e92fc8adc3bdd.tar.gz ruby-4515fc22893bbc3d7cc1e1b1dc3e92fc8adc3bdd.tar.xz ruby-4515fc22893bbc3d7cc1e1b1dc3e92fc8adc3bdd.zip |
* ext/dl/cptr.c (rb_dlptr_ptr, rb_dlptr_ref) adding documentation
* test/dl/test_cptr.rb (test_ref_ptr) testing CPtr#ref and CPtr#ptr
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/dl/test_cptr.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/dl/test_cptr.rb b/test/dl/test_cptr.rb index 461b7d27d..2a55a07de 100644 --- a/test/dl/test_cptr.rb +++ b/test/dl/test_cptr.rb @@ -3,6 +3,14 @@ require_relative '../ruby/envutil' module DL class TestCPtr < TestBase + def test_ref_ptr + ary = [0,1,2,4,5] + addr = CPtr.new(dlwrap(ary)) + assert_equal addr.to_i, addr.ref.ptr.to_i + + assert_equal addr.to_i, (+ (- addr)).to_i + end + def test_to_value ary = [0,1,2,4,5] addr = CPtr.new(dlwrap(ary)) |