Accept more than one SD in NsdManagerTest
In current implementation it's been assumed that there will be only one interface registered for service discovery in mdnsresponder. In reality there's possibility that some real but currently unused interfaces will have link-local address assigned prior to registration, which will cause mdnsresponder to register these interfaces for service discovery. This will result in SERVICE_LOST and SERVICE_FOUND events to be received more than one time. Current test implementation is not 100% prone for this situation - depending upon time gap between both events it can PASS or FAIL. Fix by removing an assert on number of received events. Change-Id: I147dc4d600f41f6d63d2b9e4bcb10efe90d5b3ec
This commit is contained in:
committed by
Johan Redestig
parent
40025ba80b
commit
970cbe09b5
@@ -372,8 +372,6 @@ public class NsdManagerTest extends AndroidTestCase {
|
||||
assertTrue(lastEvent != null);
|
||||
assertTrue(lastEvent.mInfo.getServiceName().equals(registeredName));
|
||||
|
||||
assertTrue(eventCacheSize() == 2);
|
||||
|
||||
// Register service again to see if we discover it
|
||||
checkForAdditionalEvents();
|
||||
clearEventCache();
|
||||
@@ -405,7 +403,6 @@ public class NsdManagerTest extends AndroidTestCase {
|
||||
lastEvent.mInfo.getServiceName());
|
||||
|
||||
assertTrue(lastEvent.mInfo.getServiceName().equals(registeredName));
|
||||
assertTrue(checkCacheSize(2));
|
||||
|
||||
checkForAdditionalEvents();
|
||||
clearEventCache();
|
||||
|
||||
Reference in New Issue
Block a user