diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-04 00:15:26 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-12-04 00:15:26 +0000 |
commit | d5e1b514f9113ac0f706bb46b8a20a1dd5ec7390 (patch) | |
tree | 7ad6967093e8eafae4cfb706901a2a9873e999c0 | |
parent | 3e3f66e4822905d15787d02ebbe80bb7015d96f2 (diff) | |
download | ruby-d5e1b514f9113ac0f706bb46b8a20a1dd5ec7390.tar.gz |
* test/dl/test_callback.rb (**): using DL::Function to test callbacks
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/dl/test_callback.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/dl/test_callback.rb b/test/dl/test_callback.rb index 0b4ad5dded..458625b3a6 100644 --- a/test/dl/test_callback.rb +++ b/test/dl/test_callback.rb @@ -34,20 +34,22 @@ module DL called_with = dlunwrap(str) end func = CFunc.new(addr, TYPE_VOID, 'test') + f = Function.new(func, [TYPE_VOIDP]) - func.call([dlwrap('foo')]) + f.call(dlwrap('foo')) assert_equal 'foo', called_with end def test_call_callback called = false - addr = set_callback(TYPE_VOID, 0) do + addr = set_callback(TYPE_VOID, 1) do |foo| called = true end func = CFunc.new(addr, TYPE_VOID, 'test') - func.call([]) + f = Function.new(func, [TYPE_VOIDP]) + f.call(nil) assert called, 'function should be called' end |