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

ruby-changes:38645

From: nobu <ko1@a...>
Date: Tue, 2 Jun 2015 11:02:04 +0900 (JST)
Subject: [ruby-changes:38645] nobu:r50726 (trunk): test_nonblock.rb: skip if EPROTONOSUPPORT

nobu	2015-06-02 11:02:00 +0900 (Tue, 02 Jun 2015)

  New Revision: 50726

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

  Log:
    test_nonblock.rb: skip if EPROTONOSUPPORT
    
    * test/socket/test_nonblock.rb (test_sendmsg_nonblock_seqpacket):
      OSX raises EPROTONOSUPPORT.

  Modified files:
    trunk/test/socket/test_nonblock.rb
Index: test/socket/test_nonblock.rb
===================================================================
--- test/socket/test_nonblock.rb	(revision 50725)
+++ test/socket/test_nonblock.rb	(revision 50726)
@@ -275,16 +275,16 @@ class TestSocketNonblock < Test::Unit::T https://github.com/ruby/ruby/blob/trunk/test/socket/test_nonblock.rb#L275
     }
   end
 
-  def test_sendmsg_nonblock_seqpacket
-    if defined?(UNIXSocket) && defined?(Socket::SOCK_SEQPACKET)
+  if defined?(UNIXSocket) && defined?(Socket::SOCK_SEQPACKET)
+    def test_sendmsg_nonblock_seqpacket
       buf = '*' * 10000
       UNIXSocket.pair(:SEQPACKET) do |s1, s2|
         assert_raises(IO::WaitWritable) do
           loop { s1.sendmsg_nonblock(buf) }
         end
       end
-    else
-      skip "UNIXSocket.pair(:SEQPACKET) not implemented on this platform"
+    rescue NotImplementedError, Errno::ENOSYS, Errno::EPROTONOSUPPORT
+      skip "UNIXSocket.pair(:SEQPACKET) not implemented on this platform: #{$!}"
     end
   end
 

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

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