mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cbaa60c9b7
commit
5af92f6369
1 changed files with 7 additions and 0 deletions
|
@ -43,6 +43,13 @@ class TestSocketOption < Test::Unit::TestCase
|
|||
assert_equal(128, sockopt.ipv4_multicast_ttl)
|
||||
end
|
||||
|
||||
def test_ipv4_multicast_ttl_size
|
||||
expected_size = Socket.open(:INET, :DGRAM) {|s|
|
||||
s.getsockopt(:IP, :MULTICAST_TTL).to_s.bytesize
|
||||
}
|
||||
assert_equal(expected_size, Socket::Option.ipv4_multicast_ttl(0).to_s.bytesize)
|
||||
end
|
||||
|
||||
def test_unpack
|
||||
sockopt = Socket::Option.new(:INET, :SOCKET, :KEEPALIVE, [1].pack("i"))
|
||||
assert_equal([1], sockopt.unpack("i"))
|
||||
|
|
Loading…
Reference in a new issue