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

ruby-changes:28958

From: naruse <ko1@a...>
Date: Sat, 1 Jun 2013 03:21:29 +0900 (JST)
Subject: [ruby-changes:28958] naruse:r41010 (trunk): Use custom methods for values whose type is different on platforms

naruse	2013-06-01 03:21:00 +0900 (Sat, 01 Jun 2013)

  New Revision: 41010

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

  Log:
    Use custom methods for values whose type is different on platforms
    
    Use Socket::Option#ip_multicast_loop and Socket::Option#ip_multicast_ttl
    instead of Socket::Option#int because NetBSD's size is byte though
    others' is int.

  Modified files:
    trunk/test/rinda/test_rinda.rb

Index: test/rinda/test_rinda.rb
===================================================================
--- test/rinda/test_rinda.rb	(revision 41009)
+++ test/rinda/test_rinda.rb	(revision 41010)
@@ -657,8 +657,8 @@ class TestRingFinger < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L657
   def test_make_socket_ipv4_multicast
     v4mc = @rf.make_socket('239.0.0.1')
 
-    assert_equal(1, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_LOOP).int)
-    assert_equal(1, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL).int)
+    assert_equal(1, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_LOOP).ip_multicast_loop)
+    assert_equal(1, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL).ip_multicast_ttl)
   end
 
   def test_make_socket_ipv6_multicast
@@ -672,7 +672,7 @@ class TestRingFinger < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L672
   def test_make_socket_ipv4_multicast_hops
     @rf.multicast_hops = 2
     v4mc = @rf.make_socket('239.0.0.1')
-    assert_equal(2, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL).int)
+    assert_equal(2, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL).ip_multicast_ttl)
   end
 
   def test_make_socket_ipv6_multicast_hops

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

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