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

ruby-changes:26889

From: kosaki <ko1@a...>
Date: Sat, 26 Jan 2013 02:15:17 +0900 (JST)
Subject: [ruby-changes:26889] kosaki:r38941 (trunk): * test/ruby/test_io.rb (test_ioctl_linux): skip if a platform is

kosaki	2013-01-26 02:15:05 +0900 (Sat, 26 Jan 2013)

  New Revision: 38941

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

  Log:
    * test/ruby/test_io.rb (test_ioctl_linux): skip if a platform is
      not x86 because linux ioctl request number depend on cpu arch.
      At least, alpha, mips, sparc and ppc have a different number.
      [Bug #7718] [ruby-core:51544]

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_io.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38940)
+++ ChangeLog	(revision 38941)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jan 26 01:12:23 2013  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* test/ruby/test_io.rb (test_ioctl_linux): skip if a platform is
+	  not x86 because linux ioctl request number depend on cpu arch.
+	  At least, alpha, mips, sparc and ppc have a different number.
+	  [Bug #7718] [ruby-core:51544]
+
 Fri Jan 25 19:14:24 2013  Masaki Suketa <masaki.suketa@n...>
 
 	* ext/win32ole/win32ole.c: use TlsAlloc instead of __declspec(thread)
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 38940)
+++ test/ruby/test_io.rb	(revision 38941)
@@ -2439,11 +2439,14 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2439
 
   def test_ioctl_linux
     return if /linux/ !~ RUBY_PLATFORM
+    # Alpha, mips, sparc and ppc have an another ioctl request number scheme.
+    # So, hardcoded 0x80045200 may fail.
+    return if /^i.?86|^x86_64/ !~ RUBY_PLATFORM
 
     assert_nothing_raised do
       File.open('/dev/urandom'){|f1|
         entropy_count = ""
-        # get entropy count
+        # RNDGETENTCNT(0x80045200) mean "get entropy count".
         f1.ioctl(0x80045200, entropy_count)
       }
     end

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

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