From 597d60f7920311ce595781d6683e5c0fe9298743 Mon Sep 17 00:00:00 2001 From: usa Date: Wed, 2 Jun 2010 07:49:00 +0000 Subject: * test/dl/test_cfunc.rb (test_last_error): CFunc.last_error is thread local variable. So, if another test calls CFunc#call, it's set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/dl/test_cfunc.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'test/dl') diff --git a/test/dl/test_cfunc.rb b/test/dl/test_cfunc.rb index 209c8f3731..e18a096611 100644 --- a/test/dl/test_cfunc.rb +++ b/test/dl/test_cfunc.rb @@ -65,10 +65,12 @@ module DL end def test_last_error - f = Function.new(@cf, [TYPE_VOIDP, TYPE_VOIDP]) - assert_nil CFunc.last_error - str = f.call("000", "123") - assert_not_nil CFunc.last_error + Thread.new do + f = Function.new(@cf, [TYPE_VOIDP, TYPE_VOIDP]) + assert_nil CFunc.last_error + str = f.call("000", "123") + assert_not_nil CFunc.last_error + end.join end end end -- cgit v1.2.3