summaryrefslogtreecommitdiff
path: root/tests/common/java/android/net/LinkPropertiesTest.java
diff options
context:
space:
mode:
authorRemi NGUYEN VAN <reminv@google.com>2022-01-18 12:36:25 +0900
committerRemi NGUYEN VAN <reminv@google.com>2022-01-18 16:55:32 +0900
commit8bc36966d4e7aeb1eca933326d5e314af4909ed5 (patch)
tree058516bb83cf3a812e32a33f8ed08bbf80ffa083 /tests/common/java/android/net/LinkPropertiesTest.java
parent392161e651d870c1c5dcf5ff1b1cb5afd029dea4 (diff)
Do not verify field count in tests used in CTS
Tests in tests/common and tests/cts are run as part of CtsNetTestCases. Many used assertFieldCountEquals in parceling/unparceling tests to ensure that unexpected fields were not added, or that they were not missed when testing parceling/unparceling. However with many of the classes updatable through module updates, the field count may change in the future, breaking CTS tests. Stop checking for the field count, as it would break on module releases, and its value is lower than the maintenance cost. Bug: 205901761 Test: atest CtsNetTestCases Change-Id: I79854741f7e834574d4825bb737ef507785310fe
Diffstat (limited to 'tests/common/java/android/net/LinkPropertiesTest.java')
-rw-r--r--tests/common/java/android/net/LinkPropertiesTest.java6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/common/java/android/net/LinkPropertiesTest.java b/tests/common/java/android/net/LinkPropertiesTest.java
index 550953d061..23c187e1ad 100644
--- a/tests/common/java/android/net/LinkPropertiesTest.java
+++ b/tests/common/java/android/net/LinkPropertiesTest.java
@@ -20,7 +20,6 @@ import static android.net.RouteInfo.RTN_THROW;
import static android.net.RouteInfo.RTN_UNICAST;
import static android.net.RouteInfo.RTN_UNREACHABLE;
-import static com.android.testutils.ParcelUtils.assertParcelSane;
import static com.android.testutils.ParcelUtils.assertParcelingIsLossless;
import static com.android.testutils.ParcelUtils.parcelingRoundTrip;
@@ -1006,7 +1005,7 @@ public class LinkPropertiesTest {
@Test @IgnoreAfter(Build.VERSION_CODES.Q)
public void testLinkPropertiesParcelable_Q() throws Exception {
final LinkProperties source = makeLinkPropertiesForParceling();
- assertParcelSane(source, 14 /* fieldCount */);
+ assertParcelingIsLossless(source);
}
@Test @IgnoreUpTo(Build.VERSION_CODES.Q)
@@ -1017,8 +1016,7 @@ public class LinkPropertiesTest {
source.setCaptivePortalApiUrl(CAPPORT_API_URL);
source.setCaptivePortalData((CaptivePortalData) getCaptivePortalData());
source.setDhcpServerAddress((Inet4Address) GATEWAY1);
- assertParcelSane(new LinkProperties(source, true /* parcelSensitiveFields */),
- 18 /* fieldCount */);
+ assertParcelingIsLossless(new LinkProperties(source, true /* parcelSensitiveFields */));
// Verify that without using a sensitiveFieldsParcelingCopy, sensitive fields are cleared.
final LinkProperties sanitized = new LinkProperties(source);