ruby-changes:13943
From: tenderlove <ko1@a...>
Date: Fri, 13 Nov 2009 16:20:09 +0900 (JST)
Subject: [ruby-changes:13943] Ruby:r25747 (trunk): * test/dl/test_cptr.rb (**): using ruby_xfree instead of libc's free
tenderlove 2009-11-13 16:19:59 +0900 (Fri, 13 Nov 2009) New Revision: 25747 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25747 Log: * 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 Modified files: trunk/test/dl/test_cptr.rb trunk/test/dl/test_func.rb Index: test/dl/test_cptr.rb =================================================================== --- test/dl/test_cptr.rb (revision 25746) +++ test/dl/test_cptr.rb (revision 25747) @@ -4,7 +4,7 @@ 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 @@ 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 @@ 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 Index: test/dl/test_func.rb =================================================================== --- test/dl/test_func.rb (revision 25746) +++ test/dl/test_func.rb (revision 25747) @@ -35,7 +35,7 @@ [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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/