Add test for getDeprecationTime and getExpirationTime

Add for cts coverage for system API

Bug: 139268426
Bug: 135998869
Test: atest FrameworksNetTests
Test: atest CtsNetTestCasesLatestSdk:android.net.LinkAddressTest
Change-Id: I64cd2c914f2da71383af7cdef2cf64c60a7d268c
Merged-In: I64cd2c914f2da71383af7cdef2cf64c60a7d268c
(cherry picked from commit 1e7f68f39c0855a45dbf4eeecbff430a2f6f3396)
This commit is contained in:
Automerger Merge Worker
2020-03-10 05:47:55 +00:00
committed by Chiachang Wang
parent 132b843b78
commit 04b7e0b17c

View File

@@ -367,6 +367,9 @@ public class LinkAddressTest {
-2, 100000L);
fail("negative deprecation time should cause exception");
} catch (IllegalArgumentException expected) { }
LinkAddress addr = new LinkAddress(V6_ADDRESS, 64, 0, 456, 100000L, 200000L);
assertEquals(100000L, addr.getDeprecationTime());
}
@Test @IgnoreUpTo(Build.VERSION_CODES.Q)
@@ -382,6 +385,9 @@ public class LinkAddressTest {
100000L, -2);
fail("negative expiration time should cause exception");
} catch (IllegalArgumentException expected) { }
LinkAddress addr = new LinkAddress(V6_ADDRESS, 64, 0, 456, 100000L, 200000L);
assertEquals(200000L, addr.getExpirationTime());
}
@Test