diff options
Diffstat (limited to 'test/dl/test_func.rb')
-rw-r--r-- | test/dl/test_func.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/dl/test_func.rb b/test/dl/test_func.rb index 761ae43143..819e3eb952 100644 --- a/test/dl/test_func.rb +++ b/test/dl/test_func.rb @@ -9,6 +9,14 @@ module DL assert_equal 'strcpy', f.name end + def test_bind + f = Function.new(CFunc.new(0, TYPE_INT, 'test'), [TYPE_INT, TYPE_INT]) + assert_nothing_raised { + f.bind { |x, y| x + y } + } + assert_equal 579, f.call(123, 456) + end + def test_to_i cfunc = CFunc.new(@libc['strcpy'], TYPE_VOIDP, 'strcpy') f = Function.new(cfunc, [TYPE_VOIDP, TYPE_VOIDP]) |