Browse Source

Merge branch 'IPS-197'

master
Dirk Zimmermann 6 months ago
parent
commit
87b0230283
3 changed files with 6 additions and 15 deletions
  1. +1
    -0
      build-mac/pEpTransportTests/PEPBlockBasedTransportTests.m
  2. +3
    -4
      build-mac/pEpTransportTests/TestUtils/Transport/TransportMock.m
  3. +2
    -11
      src/PEPBlockBasedTransport.m

+ 1
- 0
build-mac/pEpTransportTests/PEPBlockBasedTransportTests.m View File

@ -34,6 +34,7 @@
error:&error];
XCTAssertNotNil(self.transport);
XCTAssertNil(error);
self.transport.delayedStartupStatusCode = [NSNumber numberWithInteger:PEPTransportStatusCodeConnectionUp];
self.transportDelegate = [MockBlockBasedTransportDelegate new];


+ 3
- 4
build-mac/pEpTransportTests/TestUtils/Transport/TransportMock.m View File

@ -95,10 +95,9 @@ static const PEPTransportID s_transportID = PEPTransportIDTransportAuto;
return YES;
} else {
// We are able to start up immediately and know it's a success.
// No message to the delegate.
*transportStatusCode = PEPTransportStatusCodeConnectionUp;
return YES;
NSAssert(NO, @"TransportMock must be configured with either directStartupStatusCode or delayedStartupStatusCode");
*transportStatusCode = PEPTransportStatusCodeConfigIncompleteOrWrong;
return NO;
}
}


+ 2
- 11
src/PEPBlockBasedTransport.m View File

@ -62,17 +62,8 @@
BOOL success = [self.transport startupWithTransportStatusCode:&statusCode error:&error];
if (success) {
if (statusCode == PEPTransportStatusCodeConnectionUp) {
// This is already up, so assume there's no need to wait for more.
// Remove our callback, and inform the caller.
[self.startupCallbacks removeObject:callbacks];
successCallback(statusCode);
} else {
// Note the assumptions here:
// * No error has occurred, but the transport is not yet up.
// * We don't report that, since we consider it an intermediate step.
// * Instead, we wait for further delegate notifications.
}
// In case of success, the transport is required to inform the delegate about
// PEPTransportStatusCodeConnectionUp asynchronously. Nothing left to do here.
} else {
// Immediate error. Remove our callback, and inform the caller.
// Transport could not be started.


Loading…
Cancel
Save