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

ruby-changes:43142

From: nobu <ko1@a...>
Date: Mon, 30 May 2016 20:23:37 +0900 (JST)
Subject: [ruby-changes:43142] nobu:r55216 (trunk): test_addrinfo.rb: signle digit address

nobu	2016-05-30 20:23:32 +0900 (Mon, 30 May 2016)

  New Revision: 55216

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=55216

  Log:
    test_addrinfo.rb: signle digit address
    
    * test/socket/test_addrinfo.rb (test_addrinfo_ip): use single
      digit address so that the values are same in both decimal and
      octal.  some platform zero-prefixed dotted-decimal is parsed as
      an octal value.

  Modified files:
    trunk/test/socket/test_addrinfo.rb
Index: test/socket/test_addrinfo.rb
===================================================================
--- test/socket/test_addrinfo.rb	(revision 55215)
+++ test/socket/test_addrinfo.rb	(revision 55216)
@@ -37,9 +37,9 @@ class TestSocketAddrinfo < Test::Unit::T https://github.com/ruby/ruby/blob/trunk/test/socket/test_addrinfo.rb#L37
     assert_equal([0, "255.255.255.255"], Socket.unpack_sockaddr_in(ai))
 
     ai = assert_nothing_raised(SocketError) do
-      Addrinfo.ip("00000000127.000000000.00000000.0000001x".chop)
+      Addrinfo.ip("00000000001.000000000.00000000.0000001x".chop)
     end
-    assert_equal([0, "127.0.0.1"], Socket.unpack_sockaddr_in(ai))
+    assert_equal([0, "1.0.0.1"], Socket.unpack_sockaddr_in(ai))
   end
 
   def test_addrinfo_tcp

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

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