diff options
author | Elliott Hughes <enh@google.com> | 2011-01-09 10:04:02 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-01-09 10:04:02 -0800 |
commit | 139545096c077c172af9e8dd7122b56172715ce9 (patch) | |
tree | 20e7724c5197c0ab99aea173d83ca0f79e17159e /luni/src/test | |
parent | a68d1154a7e60c12d661b6a03756dee039c99094 (diff) | |
parent | 2c9f1e5b63c624793d01038a2b0c72e853c017df (diff) | |
download | libcore-139545096c077c172af9e8dd7122b56172715ce9.zip libcore-139545096c077c172af9e8dd7122b56172715ce9.tar.gz libcore-139545096c077c172af9e8dd7122b56172715ce9.tar.bz2 |
am 2c9f1e5b: am 90a81872: am 3a9a00ad: Fix getifaddrs(3).
* commit '2c9f1e5b63c624793d01038a2b0c72e853c017df':
Fix getifaddrs(3).
Diffstat (limited to 'luni/src/test')
-rw-r--r-- | luni/src/test/java/libcore/java/net/NetworkInterfaceTest.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/luni/src/test/java/libcore/java/net/NetworkInterfaceTest.java b/luni/src/test/java/libcore/java/net/NetworkInterfaceTest.java new file mode 100644 index 0000000..fe89adb --- /dev/null +++ b/luni/src/test/java/libcore/java/net/NetworkInterfaceTest.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2011 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package libcore.java.net; + +import java.net.*; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import junit.framework.TestCase; + +public class NetworkInterfaceTest extends TestCase { + // http://code.google.com/p/android/issues/detail?id=13784 + public void testIPv6() throws Exception { + NetworkInterface lo = NetworkInterface.getByName("lo"); + Set<InetAddress> actual = new HashSet<InetAddress>(Collections.list(lo.getInetAddresses())); + + Set<InetAddress> expected = new HashSet<InetAddress>(); + expected.add(Inet4Address.LOOPBACK); + expected.add(Inet6Address.getByAddress("localhost", new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }, null)); + + assertEquals(expected, actual); + } +} |