ruby-changes:33166
From: naruse <ko1@a...>
Date: Sun, 2 Mar 2014 17:44:37 +0900 (JST)
Subject: [ruby-changes:33166] naruse:r45245 (trunk): Use assert_separately to speed up
naruse 2014-03-02 17:44:34 +0900 (Sun, 02 Mar 2014) New Revision: 45245 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45245 Log: Use assert_separately to speed up Modified files: trunk/test/dl/test_func.rb Index: test/dl/test_func.rb =================================================================== --- test/dl/test_func.rb (revision 45244) +++ test/dl/test_func.rb (revision 45245) @@ -153,12 +153,17 @@ module DL https://github.com/ruby/ruby/blob/trunk/test/dl/test_func.rb#L153 end def test_qsort1() + assert_separately(%W[--disable=gems -r#{__dir__}/test_base.rb -rdl/func], __FILE__, __LINE__, <<-"end;") + include DL + @libc = dlopen(LIBC_SO) + @libm = dlopen(LIBM_SO) begin cb = Function.new(CFunc.new(0, TYPE_INT, '<callback>qsort'), [TYPE_VOIDP, TYPE_VOIDP]){|x,y| CPtr.new(x)[0] <=> CPtr.new(y)[0]} qsort = Function.new(CFunc.new(@libc['qsort'], TYPE_VOID, 'qsort'), [TYPE_VOIDP, TYPE_SIZE_T, TYPE_SIZE_T, TYPE_VOIDP]) buff = "9341" + qsort.call(buff, buff.size, 1, cb) assert_equal("1349", buff) @@ -169,6 +174,7 @@ module DL https://github.com/ruby/ruby/blob/trunk/test/dl/test_func.rb#L174 ensure cb.unbind if cb # max number of callbacks is limited to MAX_CALLBACK end + end; end def test_qsort2() -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/