History log of /libcore/luni/src/test/java/libcore/java/net/InetAddressTest.java
Revision Date Author Comments
3781a7d49fd4b59c0076dccd7cbff0922d4d5c86 22-Feb-2016 Narayan Kamath <narayan@google.com> Revert "Revert "InetAddress: Don't throw SocketException from isReachable.""

This reverts commit 6bec79c64211b7849e1c947dc2b089ab5b356dc9.

Change-Id: Ia3e47a9469f32a2e9777dcb8b3a5cb0c5e7fd6c9
fe8d46c16e53822545b3c37bb7636abf2c342074 22-Feb-2016 Narayan Kamath <narayan@google.com> Revert "Revert "InetAddress: Don't throw SocketException from isReachable.""

This reverts commit 6bec79c64211b7849e1c947dc2b089ab5b356dc9.

Change-Id: Ia3e47a9469f32a2e9777dcb8b3a5cb0c5e7fd6c9
6bec79c64211b7849e1c947dc2b089ab5b356dc9 22-Feb-2016 Narayan Kamath <narayan@google.com> Revert "InetAddress: Don't throw SocketException from isReachable."

This reverts commit 21f8cbbf61d14ee8df7e31718826a7038feefb31.

This accidentally included some unreviewed (but good) code.

Change-Id: Ie232dd93d8cde496d9f78c398944cd68dda7df8d
21f8cbbf61d14ee8df7e31718826a7038feefb31 16-Feb-2016 Narayan Kamath <narayan@google.com> InetAddress: Don't throw SocketException from isReachable.

If something goes wrong, just state that the address is unreachable.
This fixes InetAddressTest.testIsReachable. The test was failing in
quite a convoluted manner - it was testing that isReachable did not
throw on any of the network interfaces on the system. However, we did
throw for interface = dummy0 because bind() returned EINVAL on the
iface's (link local) address.

(cherry picked from commit 838dc8ab4b456d91e56b46f7deb76a8f97145563)

bug: 27265678

Change-Id: I4530b761f157b9c2b5967d64e141424ce09957e0
838dc8ab4b456d91e56b46f7deb76a8f97145563 16-Feb-2016 Narayan Kamath <narayan@google.com> InetAddress: Don't throw SocketException from isReachable.

If something goes wrong, just state that the address is unreachable.
This fixes InetAddressTest.testIsReachable. The test was failing in
quite a convoluted manner - it was testing that isReachable did not
throw on any of the network interfaces on the system. However, we did
throw for interface = dummy0 because bind() returned EINVAL on the
iface's (link local) address.

Change-Id: Id7bdcf7318b6b4eaa92f9caaba38e86a580cc84b
d960ef32a57a91e4ea0976a2bbd97b8ec0fd2cf0 19-Jan-2016 Narayan Kamath <narayan@google.com> Always clone the return value of InetAddress#getAllByName.

Also move the responsibility for cloning to InetAddress so that
we can make sure we clone things consistently.

Change-Id: I93ea6096aebeca5df9b39e355bb4051ac38015c6
5732c4b309e28fb11ce6a3faf7bacef6876f9ac7 10-Dec-2015 Yi Kong <yikong@google.com> Let getByName prefer IPv6 loopback over IPv4

Bug: 26083444
Change-Id: I6d874480f7c61fd4804cb7541583d32ef3f5108f
db6fe533dcb9e7df4d3a2024de37e5193b3685d6 10-Dec-2015 Yi Kong <yikong@google.com> Let getByName prefer IPv6 loopback over IPv4

Bug: 26083444
Change-Id: I6d874480f7c61fd4804cb7541583d32ef3f5108f
b2f612dfda4bf2362413e3e205880ae7c1addde9 28-Sep-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Blacklist a few more tests.

Some of them need further investigation and others rely on hidden /
private APIs.

Change-Id: I1f25b6dd801765c570035b4629fd47658d67d7b8
a43c5da446e8f02ebe23b6a026c25f4e25d89318 14-Jan-2015 Neil Fuller <nfuller@google.com> Fix the hostname for the IPv6 loopback address

Previously the hostname was "localhost", which
resolves to the IPv4 loopback address.

Also fixed the documentation for getAllByName(null)
which has returned the loopback addresses all the way
back to 2009 and not thrown an exception as
suggested in the docs.

Test fixes and new tests included.

Depends on commit 25147416bb105914c3cdf8fd65ca7cc20dae0f3e

Bug: 18991397
Bug: https://code.google.com/p/android/issues/detail?id=96801
Change-Id: I9723516a977e2a3b97412bc1d7e58b36df327feb
ee458cf73d150be182b1797bc59043b131706f7f 03-Dec-2014 Neil Fuller <nfuller@google.com> Fix InetSocketAddress.getHostString(): return the name if available

getHostString() would return the IP address in one of the three
scenarios possible:

1) InetSocketAddress created with a name - already worked, name returned.
2) InetSocketAddress create with an InetAddress with only an address - already worked,
address returned.
3) InetSocketAddress create with an InetAddress with an address and name: would return
the address.

Change-Id: Id9d1addda5cef589ac56db5397e00e842cf8c5d7
e5dc23234307897754529a782a6c546c496a4acf 19-May-2014 Neil Fuller <nfuller@google.com> Fix InetAddressTest

Fixes:
test_getByName
test_isNumeric
test_parseNumericAddress

Change Ic42173b7b06e8536e8c4331087720d7df1e1681a (made
in early 2011) modified handling of "obsolete" numeric IP
addresses.

At least since then, Octal addresses (those with
leading 0's) have been parsed as decimal values. The tests
were written to expect Octal values to be rejected and
0177.00.00.01 was expected to be treated as an invalid
address. If interpreted as a decimal (177.0.0.1) it is
fine.

The tests have been updated to test a more obviously
incorrect value and the docs have been updated to
document how Android and the RI differ.

Bug: 4539262
Change-Id: I5f9dce6b1accd81dda1348718fe0c74b03c27c29
2ea0b34ba1e3bf712e052304747a3bc6c78e8208 20-Mar-2013 Kenny Root <kroot@google.com> Mapped IPv4 address test fix

The SubjectAlternativeNameTest was failing on getting a mapped IPv4
address back of the form "::ffff:127.0.0.1" which should be handled
fine.

Added several tests to InetAddressTest to make sure the correct handling
of mapped addresses doesn't regress.

Change-Id: If6e1ca8bda405d4862786404d1ced571743391f2
b416ef5dc224630af2b9393a15ae120b27e4864a 14-Dec-2011 Jesse Wilson <jessewilson@google.com> Rename SerializableTester to SerializationTester

Change-Id: Idfaea5c474eb3cabfb8eefc5aa25a7ff0cce26ea
10078dabb17441ce2721a8e5e10f275c5d0a426a 13-Dec-2011 Jesse Wilson <jessewilson@google.com> Kill SerializationTester; obsoleted by SerializableTester.

Bug: http://b/5397460
Change-Id: Ic20f4363c8937d5feff0dec89e5de7ccf20f1dac
9b4a8ec37805be3eabf3a4b443bbdb692ffa2608 30-Sep-2011 Elliott Hughes <enh@google.com> Fix a couple of isReachable bugs.

We shouldn't throw NPE if you call isReachable on a deserialized InetAddress.
Fixed by removing the "globals", which also fixes the unreported bug that
calling isReachable on the same InetAddress was not thread-safe.

Bug: http://code.google.com/p/android/issues/detail?id=20203

Also, the arguments to isReachableByTCP in isReachable(NetworkInterface, int, int)
were the wrong way round, which meant we'd always return false (unless you were
asking if localhost was reachable).

Bug: http://code.google.com/p/android/issues/detail?id=20107

Bug: 2497441
Bug: 3213503

Change-Id: Ic808e774c28be6487e30e6acb8bc06f766f5c71d
a7428d68453f6a74633221e8714f8d3d9597b2b4 29-Sep-2011 Elliott Hughes <enh@google.com> Fix the InetAddress/Inet4Address/Inet6Address documentation.

Also simplify a few of the implementations, and add a few tests.

Bug: http://code.google.com/p/android/issues/detail?id=19165
Change-Id: If33d5a830068114edf722711333bf0e00098d91a
fc041ff241f9a7556e72236f130de0215ecd17db 03-Jun-2011 Elliott Hughes <enh@google.com> Remove support for deprecated IPv4 address formats.

Bug: 4539262
Change-Id: Ic42173b7b06e8536e8c4331087720d7df1e1681a
5bf7fa5b431ebfa093c2a389148be3faa62e8237 25-May-2011 Elliott Hughes <enh@google.com> More Harmony test consolidation.

Change-Id: I98070d03c8b5f5764d54e3d2058c5707bbb954ce
19fa10017f9f8904dea97afcb48caf13d8c2dde2 25-May-2011 Elliott Hughes <enh@google.com> Deduplicate Harmony tests.

Change-Id: I42b6b960660402e701552dceec4ea616955bc23f
1c039d71d3879f39e3a75b8788e656f7b4f88f08 05-May-2011 Elliott Hughes <enh@google.com> Add getaddrinfo(2).

This only supports the "node" side of getaddrinfo(2), not the "service" side.
There's also no support for AI_CANONNAME, so we currently return InetAddress[]
rather than anything equivalent to C's linked list of struct addrinfo.

Bug: 3107501
Change-Id: I8cf6baa3027a0fa05ac6e2f8fcc1dd8b576ff8c4
775095bf6a763e6a9b4e858011a812425d949af5 20-Apr-2011 Elliott Hughes <enh@google.com> Remove an unnecessary special case in InetAddress.getAllByName.

(And add a test to ensure it remains unnecessary.)

Change-Id: Ia1b4f0721308a36d972da36c06869ce4740b1cda
5d3f5562c167120b5ec00e509af0f0ab9308bff5 04-Mar-2011 Elliott Hughes <enh@google.com> Add InetAddress.getLoopbackAddress.

Bug: 3484927
Change-Id: Ic5305c852ed8079d958d8ab7c46fe10cceac60d4
46bed6a47a20d8105f0e099d162d547a7964b4fe 24-Feb-2011 Elliott Hughes <enh@google.com> Make InetAddress.parseNumericAddress more like InetAddress.getByName.

Specifically, treat null and "" as requests for the loopback address.

Bug: 3483011
Change-Id: I656f1d2873faf4b73e1fc7621c96183a8a86992b
ede17863e71079d082ff8fb9d1d6f8299bea04b6 16-Feb-2011 Elliott Hughes <enh@google.com> Better tests for InetAddress.parseNumericAddress.

Bug: 3300307
Change-Id: I1e230354185c2a4bf8c82ba70e3f93a2a738091a
f39b892d87e85835f021e8ad77ffdd215735604b 16-Feb-2011 Elliott Hughes <enh@google.com> Add InetAddress.parseNumericAddress for frameworks/base's benefit.

Bug: 3300307
Change-Id: Ifb2207621232314046aee39fdb86b957b9e7f8fc