mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
29f982738e
commit
9a9cc65035
2 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue