[前][次][番号順一覧][スレッド一覧]

ruby-changes:9570

From: takano32 <ko1@a...>
Date: Sun, 28 Dec 2008 17:10:34 +0900 (JST)
Subject: [ruby-changes:9570] Ruby:r21110 (trunk): Sun Dec 28 17:10:13 2008 TAKANO Mitsuhiro (takano32) <tak@n...>

takano32	2008-12-28 17:10:20 +0900 (Sun, 28 Dec 2008)

  New Revision: 21110

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21110

  Log:
    Sun Dec 28 17:10:13 2008  TAKANO Mitsuhiro (takano32)  <tak@n...>
    * 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.

  Modified files:
    trunk/ext/dl/test/test_base.rb
    trunk/ext/dl/test/test_dl2.rb

Index: ext/dl/test/test_dl2.rb
===================================================================
--- ext/dl/test/test_dl2.rb	(revision 21109)
+++ ext/dl/test/test_dl2.rb	(revision 21110)
@@ -59,14 +59,14 @@
     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 @@
     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
 
Index: ext/dl/test/test_base.rb
===================================================================
--- ext/dl/test/test_base.rb	(revision 21109)
+++ ext/dl/test/test_base.rb	(revision 21110)
@@ -5,9 +5,6 @@
 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"

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]