aboutsummaryrefslogtreecommitdiffstats
path: root/test/dl/test_cptr.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/dl/test_cptr.rb')
-rw-r--r--test/dl/test_cptr.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/dl/test_cptr.rb b/test/dl/test_cptr.rb
index 461b7d27d4..2a55a07dee 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))