summaryrefslogtreecommitdiffstats
path: root/test/dl/test_func.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-07 00:49:09 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-12-07 00:49:09 +0000
commit0300a5f10c1173240019551b04c9dde57aab74ce (patch)
treedc43acb6c808695125418670055b54cc6cb8375a /test/dl/test_func.rb
parenta2d4f20b5163ad223d66730ddb7c65e602bcec52 (diff)
downloadruby-0300a5f10c1173240019551b04c9dde57aab74ce.tar.gz
ruby-0300a5f10c1173240019551b04c9dde57aab74ce.tar.xz
ruby-0300a5f10c1173240019551b04c9dde57aab74ce.zip
* test/dl/test_callback.rb testing callback removal
* test/dl/test_func.rb testing function names, to_i git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@26037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/dl/test_func.rb')
-rw-r--r--test/dl/test_func.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/dl/test_func.rb b/test/dl/test_func.rb
index 99953a448..5503f350c 100644
--- a/test/dl/test_func.rb
+++ b/test/dl/test_func.rb
@@ -3,6 +3,18 @@ require 'dl/func'
module DL
class TestFunc < TestBase
+ def test_name
+ f = Function.new(CFunc.new(@libc['strcpy'], TYPE_VOIDP, 'strcpy'),
+ [TYPE_VOIDP, TYPE_VOIDP])
+ assert_equal 'strcpy', f.name
+ end
+
+ def test_to_i
+ cfunc = CFunc.new(@libc['strcpy'], TYPE_VOIDP, 'strcpy')
+ f = Function.new(cfunc, [TYPE_VOIDP, TYPE_VOIDP])
+ assert_equal cfunc.to_i, f.to_i
+ end
+
def test_strcpy()
f = Function.new(CFunc.new(@libc['strcpy'], TYPE_VOIDP, 'strcpy'),
[TYPE_VOIDP, TYPE_VOIDP])