diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-20 19:32:03 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-01-20 19:32:03 +0000 |
commit | 779a630aee3aee42693abb6ae213234e799dcea0 (patch) | |
tree | 0dc421ae7f33ef82661bb898dea3df59535256fb /test/socket/test_sockopt.rb | |
parent | 5af92f6369f02318d57114342891b849b12d39e4 (diff) | |
download | ruby-779a630aee3aee42693abb6ae213234e799dcea0.tar.gz |
* ext/socket/option.c: Use "int" for IP_MULTICAST_LOOP and
IP_MULTICAST_TTL on Mac OS X.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/socket/test_sockopt.rb')
-rw-r--r-- | test/socket/test_sockopt.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/socket/test_sockopt.rb b/test/socket/test_sockopt.rb index ee7ba9b9ff..2ee06dbecd 100644 --- a/test/socket/test_sockopt.rb +++ b/test/socket/test_sockopt.rb @@ -34,6 +34,13 @@ class TestSocketOption < Test::Unit::TestCase assert_equal(128, sockopt.ipv4_multicast_loop) end + def test_ipv4_multicast_loop_size + expected_size = Socket.open(:INET, :DGRAM) {|s| + s.getsockopt(:IP, :MULTICAST_LOOP).to_s.bytesize + } + assert_equal(expected_size, Socket::Option.ipv4_multicast_loop(0).to_s.bytesize) + end + def test_ipv4_multicast_ttl sockopt = Socket::Option.ipv4_multicast_ttl(128) assert_equal('#<Socket::Option: INET IP MULTICAST_TTL 128>', sockopt.inspect) |