MulticastSocketTest: Skip rather than pass when !supportsMulticast.
Note that supportMulticast is based on (in CtsRunListener) on
pm.hasSystemFeature(PackageManager.FEATURE_WIFI); this does not
in itself mean that the network support multicast, but it's a
requirement for CTS.
Before this CL, the test would have been marked as passed when
supportMulticast was false; after this CL, it will be marked
as "assumption failed", which seems more appropriate since this
may not be expected.
Bug: 151612773
Test: atest CtsLibcoreTestCases:org.apache.harmony.tests.java.net.MulticastSocketTest
Test: a local edit to add "supportMulticast=false;" results in
test method being marked as "assumption failed" when run
with the above command.
Test: Checked the behavior when WiFi is supported but disabled via
adb shell svc wifi disable
In this case, the test fails because the assertion at the
end of setUp() fails, because ipv4NetworkInterface and
ipv6NetworkInterface are both null.
Change-Id: Ibe035937fddce1a80535b650afadfa4d3c7856f9
1 file changed