diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-04 12:15:01 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-04 12:15:01 +0000 |
commit | 7d712b2c4801d4c614774788b93e8863a22b9bc4 (patch) | |
tree | 5078deedfb0f15109adc7d148ef777de0886b23d | |
parent | b0a8c9a6906d1b69a37c1469da4771aed40bc438 (diff) | |
download | ruby-7d712b2c4801d4c614774788b93e8863a22b9bc4.tar.gz ruby-7d712b2c4801d4c614774788b93e8863a22b9bc4.tar.xz ruby-7d712b2c4801d4c614774788b93e8863a22b9bc4.zip |
fix tests.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/socket/test_nonblock.rb | 6 | ||||
-rw-r--r-- | test/socket/test_unix.rb | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/test/socket/test_nonblock.rb b/test/socket/test_nonblock.rb index 5989a8f23..c86112091 100644 --- a/test/socket/test_nonblock.rb +++ b/test/socket/test_nonblock.rb @@ -88,9 +88,9 @@ class TestNonblockSocket < Test::Unit::TestCase IO.select [c] mesg, unix_addr = c.recvfrom_nonblock(100) assert_equal("aaa", mesg) - if unix_addr != nil # connection-oriented socket may not return the peer address. - assert_equal(2, unix_addr.length) - af, path = unix_addr + assert_equal(2, unix_addr.length) + af, path = unix_addr + if path != "" # connection-oriented socket may not return the peer address. assert_equal(serv_path, path) end s.close diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb index 081100073..a918fff96 100644 --- a/test/socket/test_unix.rb +++ b/test/socket/test_unix.rb @@ -148,9 +148,10 @@ class TestUNIXSocket < Test::Unit::TestCase assert_equal("", s1.recv(10)) assert_equal("", s1.recv(10)) assert_raise(Errno::EAGAIN) { s1.recvfrom_nonblock(10) } + rescue Errno::EPROTONOSUPPORT ensure - s1.close - s2.close + s1.close if s1 + s2.close if s2 end end if defined?(UNIXSocket) |