summaryrefslogtreecommitdiff
path: root/ext/dl
diff options
context:
space:
mode:
authortakano32 <takano32@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-28 08:10:20 +0000
committertakano32 <takano32@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-28 08:10:20 +0000
commit0781d24aaa41d87802592f325ccf8ccfe9bad04b (patch)
tree1ddb08f9ef5ed84ba567e7220ccb5dd282ff786e /ext/dl
parent04b672f34b2ff39b90123045ccf3f67b811ff170 (diff)
Sun Dec 28 17:10:13 2008 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
* ext/dl/test/test_dl2.rb: modify strncpy, strcpy, qsort, types. Bug #633 [ruby-core:19289] * ext/dl/test/test_base.rb: /lib/libc.so is x86_64 binary in x86_64 architecture. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21110 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl')
-rw-r--r--ext/dl/test/test_base.rb3
-rw-r--r--ext/dl/test/test_dl2.rb6
2 files changed, 3 insertions, 6 deletions
diff --git a/ext/dl/test/test_base.rb b/ext/dl/test/test_base.rb
index 8466812a1e..0e14c8dcae 100644
--- a/ext/dl/test/test_base.rb
+++ b/ext/dl/test/test_base.rb
@@ -5,9 +5,6 @@ case RUBY_PLATFORM
when /cygwin/
LIBC_SO = "cygwin1.dll"
LIBM_SO = "cygwin1.dll"
-when /x86_64-linux/
- LIBC_SO = "/lib64/libc.so.6"
- LIBM_SO = "/lib64/libm.so.6"
when /linux/
LIBC_SO = "/lib/libc.so.6"
LIBM_SO = "/lib/libm.so.6"
diff --git a/ext/dl/test/test_dl2.rb b/ext/dl/test/test_dl2.rb
index 8c1f3e71b4..3c854aea8f 100644
--- a/ext/dl/test/test_dl2.rb
+++ b/ext/dl/test/test_dl2.rb
@@ -59,14 +59,14 @@ class TestDL < TestBase
buff = "xxxx"
str = "abc"
cfunc = CFunc.new(@libc['strncpy'], TYPE_VOIDP, 'strncpy')
- x = cfunc.call([buff,str,3].pack("ppi").unpack("l!*"))
+ x = cfunc.call([buff,str,3].pack("ppL!").unpack("l!*"))
assert_equal("abcx", buff)
assert_equal("abcx", CPtr.new(x).to_s(4))
ptr = CPtr.malloc(4)
str = "abc"
cfunc = CFunc.new(@libc['strcpy'], TYPE_VOIDP, 'strcpy')
- x = cfunc.call([ptr.to_i,str].pack("lp").unpack("l!*"))
+ x = cfunc.call([ptr.to_i,str].pack("l!p").unpack("l!*"))
assert_equal("abc\0", ptr[0,4])
assert_equal("abc\0", CPtr.new(x).to_s(4))
end
@@ -75,7 +75,7 @@ class TestDL < TestBase
buff = "foobarbaz"
cb = set_callback(TYPE_INT,2){|x,y| CPtr.new(x)[0] <=> CPtr.new(y)[0]}
cfunc = CFunc.new(@libc['qsort'], TYPE_VOID, 'qsort')
- cfunc.call([buff, buff.size, 1, cb].pack("pI!I!L!").unpack("l!*"))
+ cfunc.call([buff, buff.size, 1, cb].pack("pL!L!L!").unpack("l!*"))
assert_equal('aabbfoorz', buff)
end