summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-13 07:19:59 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-13 07:19:59 +0000
commit9a9cc65035b7b6c06e4990fe2563580ceeb92a1b (patch)
tree5c08eec132ce21bad5570da86197904909fbb7bd
parent29f982738e0703c316ff124f66e92791c13f2376 (diff)
* test/dl/test_cptr.rb (**): using ruby_xfree instead of libc's free
* test/dl/test_func.rb (test_strdod): strtod needs a char ** argument git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25747 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/dl/test_cptr.rb8
-rw-r--r--test/dl/test_func.rb2
2 files changed, 5 insertions, 5 deletions
diff --git a/test/dl/test_cptr.rb b/test/dl/test_cptr.rb
index 5bc98ef35b..64b78d134f 100644
--- a/test/dl/test_cptr.rb
+++ b/test/dl/test_cptr.rb
@@ -4,7 +4,7 @@ require_relative '../ruby/envutil'
module DL
class TestCPtr < TestBase
def test_malloc_free_func_int
- free = CFunc.new(@libc['free'], TYPE_VOID, 'free')
+ free = CFunc.new(DL::RUBY_FREE, TYPE_VOID, 'free')
ptr = CPtr.malloc(10, free.to_i)
assert_equal 10, ptr.size
@@ -12,7 +12,7 @@ module DL
end
def test_malloc_free_func
- free = CFunc.new(@libc['free'], TYPE_VOID, 'free')
+ free = CFunc.new(DL::RUBY_FREE, TYPE_VOID, 'free')
ptr = CPtr.malloc(10, free)
assert_equal 10, ptr.size
@@ -142,14 +142,14 @@ module DL
include DL
@libc = dlopen(LIBC_SO)
@libm = dlopen(LIBM_SO)
- free = CFunc.new(@libc['free'], TYPE_VOID, 'free')
+ free = CFunc.new(DL::RUBY_FREE, TYPE_VOID, 'free')
ptr = CPtr.malloc(4)
ptr.free = free
free.ptr
ptr.free.ptr
End
- free = CFunc.new(@libc['free'], TYPE_VOID, 'free')
+ free = CFunc.new(DL::RUBY_FREE, TYPE_VOID, 'free')
ptr = CPtr.malloc(4)
ptr.free = free
diff --git a/test/dl/test_func.rb b/test/dl/test_func.rb
index 522cbd4257..99953a448e 100644
--- a/test/dl/test_func.rb
+++ b/test/dl/test_func.rb
@@ -35,7 +35,7 @@ module DL
[TYPE_VOIDP, TYPE_VOIDP])
buff1 = CPtr["12.34"]
buff2 = buff1 + 4
- r = f.call(buff1, buff2)
+ r = f.call(buff1, - buff2)
assert_in_delta(12.34, r, 0.001)
end