ruby-changes:38644
From: normal <ko1@a...>
Date: Tue, 2 Jun 2015 10:47:49 +0900 (JST)
Subject: [ruby-changes:38644] normal:r50725 (trunk): test/socket/test_nonblock.rb: new test for sendmsg_nonblock
normal 2015-06-02 10:47:41 +0900 (Tue, 02 Jun 2015) New Revision: 50725 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50725 Log: test/socket/test_nonblock.rb: new test for sendmsg_nonblock sendmsg_nonblock was not tested on any of my systems due to the common 64K limit. I also don't believe UDP sockets are at all a useful candidate for sendmsg_nonblock testing since they should never block on sending. Modified files: trunk/ChangeLog trunk/test/socket/test_nonblock.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 50724) +++ ChangeLog (revision 50725) @@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue Jun 2 10:46:36 2015 Eric Wong <e@8...> + + * test/socket/test_nonblock.rb: new test for sendmsg_nonblock + Tue Jun 2 09:04:14 2015 Eric Wong <e@8...> * lib/benchmark.rb: just use Process::CLOCK_MONOTONIC Index: test/socket/test_nonblock.rb =================================================================== --- test/socket/test_nonblock.rb (revision 50724) +++ test/socket/test_nonblock.rb (revision 50725) @@ -275,6 +275,19 @@ 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) + 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" + end + end + def test_recvmsg_nonblock_error udp_pair {|s1, s2| begin -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/