summaryrefslogtreecommitdiffstats
path: root/core/tests
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2014-06-09 22:58:46 +0900
committerRobert Greenwalt <rgreenwalt@google.com>2014-06-11 18:52:19 +0000
commit00a0fd650b7a31dffb88c229242bb04fa0b487a4 (patch)
treefede654ba17701546fac7417f47d173bbe76a024 /core/tests
parenteeaf164bea829325af343b9e41196bc9680ecac9 (diff)
downloadframeworks_base-00a0fd650b7a31dffb88c229242bb04fa0b487a4.zip
frameworks_base-00a0fd650b7a31dffb88c229242bb04fa0b487a4.tar.gz
frameworks_base-00a0fd650b7a31dffb88c229242bb04fa0b487a4.tar.bz2
Minor changes to the LinkAddress API docs.
1. Rename getNetworkPrefixLength to getPrefixLength. Update all callers in frameworks/base and add a shim method and a TODO for the rest. 2. @hide isSameAddressAs. It doesn't add much, and it's just one-liner that callers can implement if they want. 3. Fix the alignment of the initial paragraph (<ul> should have been </ul>). 4. Remove the documentation that talks about creating LinkAddresses, since there's no public API for creating them. With these changes I think LinkAddress is fine as a public API. Bug: 15142362 Change-Id: Iaf3b1db577745bb68a9e1dd7f96d666dd3f3ec7c (cherry picked from commit 9ab53650cfcd91a2a151b44b3fd1381841f76269)
Diffstat (limited to 'core/tests')
-rw-r--r--core/tests/coretests/src/android/net/LinkAddressTest.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/tests/coretests/src/android/net/LinkAddressTest.java b/core/tests/coretests/src/android/net/LinkAddressTest.java
index bccf556..814ecdd 100644
--- a/core/tests/coretests/src/android/net/LinkAddressTest.java
+++ b/core/tests/coretests/src/android/net/LinkAddressTest.java
@@ -56,26 +56,26 @@ public class LinkAddressTest extends AndroidTestCase {
// Valid addresses work as expected.
address = new LinkAddress(V4_ADDRESS, 25);
assertEquals(V4_ADDRESS, address.getAddress());
- assertEquals(25, address.getNetworkPrefixLength());
+ assertEquals(25, address.getPrefixLength());
assertEquals(0, address.getFlags());
assertEquals(RT_SCOPE_UNIVERSE, address.getScope());
address = new LinkAddress(V6_ADDRESS, 127);
assertEquals(V6_ADDRESS, address.getAddress());
- assertEquals(127, address.getNetworkPrefixLength());
+ assertEquals(127, address.getPrefixLength());
assertEquals(0, address.getFlags());
assertEquals(RT_SCOPE_UNIVERSE, address.getScope());
// Nonsensical flags/scopes or combinations thereof are acceptable.
address = new LinkAddress(V6 + "/64", IFA_F_DEPRECATED | IFA_F_PERMANENT, RT_SCOPE_LINK);
assertEquals(V6_ADDRESS, address.getAddress());
- assertEquals(64, address.getNetworkPrefixLength());
+ assertEquals(64, address.getPrefixLength());
assertEquals(IFA_F_DEPRECATED | IFA_F_PERMANENT, address.getFlags());
assertEquals(RT_SCOPE_LINK, address.getScope());
address = new LinkAddress(V4 + "/23", 123, 456);
assertEquals(V4_ADDRESS, address.getAddress());
- assertEquals(23, address.getNetworkPrefixLength());
+ assertEquals(23, address.getPrefixLength());
assertEquals(123, address.getFlags());
assertEquals(456, address.getScope());
@@ -94,10 +94,10 @@ public class LinkAddressTest extends AndroidTestCase {
}
assertEquals(NetworkUtils.numericToInetAddress("127.0.0.1"), ipv4Loopback.getAddress());
- assertEquals(8, ipv4Loopback.getNetworkPrefixLength());
+ assertEquals(8, ipv4Loopback.getPrefixLength());
assertEquals(NetworkUtils.numericToInetAddress("::1"), ipv6Loopback.getAddress());
- assertEquals(128, ipv6Loopback.getNetworkPrefixLength());
+ assertEquals(128, ipv6Loopback.getPrefixLength());
// Null addresses are rejected.
try {