summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-04 00:15:26 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-04 00:15:26 +0000
commitc7994db1dfe0f3aeed987d9f163d8aa2fe3daeeb (patch)
tree7ad6967093e8eafae4cfb706901a2a9873e999c0 /test
parent8a0ad0bf786bffcf514026509d9acac1751cf50d (diff)
downloadruby-c7994db1dfe0f3aeed987d9f163d8aa2fe3daeeb.tar.gz
ruby-c7994db1dfe0f3aeed987d9f163d8aa2fe3daeeb.tar.xz
ruby-c7994db1dfe0f3aeed987d9f163d8aa2fe3daeeb.zip
* test/dl/test_callback.rb (**): using DL::Function to test callbacks
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25986 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/dl/test_callback.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/dl/test_callback.rb b/test/dl/test_callback.rb
index 0b4ad5dde..458625b3a 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