Browse Source

IOSAD-103 DEBUG testBasicSendMessage

IOSAD-103
Dirk Zimmermann 4 years ago
parent
commit
703f985ea7
4 changed files with 17 additions and 3 deletions
  1. +5
    -2
      pEpObjCAdapter/PEPQueue.m
  2. +5
    -0
      pEpObjCAdapter/PEPSessionProvider.m
  3. +6
    -0
      pEpObjCAdapter/PEPSync.m
  4. +1
    -1
      pEpObjCTests/PEPSessionTest.m

+ 5
- 2
pEpObjCAdapter/PEPQueue.m View File

@ -35,8 +35,10 @@
{
[_cond lock];
if (_queue)
if (_queue) {
NSLog(@"*** enqueue %@", object);
[_queue insertObject:object atIndex:0];
}
[_cond signal];
@ -79,7 +81,8 @@
}
[_cond unlock];
NSLog(@"*** dequeue %@", tmp);
return tmp;
}


+ 5
- 0
pEpObjCAdapter/PEPSessionProvider.m View File

@ -134,9 +134,14 @@ static PEPInternalSession *s_sessionForMainThread = nil;
if ([NSThread isMainThread]) {
NSLog(@"*** assuring main session on main thread");
creationBlock();
NSLog(@"*** assuring main session on main thread - DONE");
} else {
NSLog(@"*** assuring main session on background thread %@",
[[NSThread currentThread] name]);
dispatch_sync(dispatch_get_main_queue(), creationBlock);
NSLog(@"*** assuring main session on background thread - DONE");
}
}


+ 6
- 0
pEpObjCAdapter/PEPSync.m View File

@ -177,6 +177,7 @@ static __weak PEPSync *s_pEpSync;
- (void)shutdown
{
NSLog(@"*** shutdown");
if (self.syncThread) {
[self injectSyncEvent:nil];
[self.conditionLockForJoiningSyncThread lockWhenCondition:YES];
@ -205,6 +206,7 @@ static __weak PEPSync *s_pEpSync;
unregister_sync_callbacks(session.session);
} else {
// indicate error, maybe through `object`?
NSLog(@"*** ERROR: Could not create internal session");
}
session = nil;
@ -224,6 +226,9 @@ static __weak PEPSync *s_pEpSync;
- (int)injectSyncEvent:(SYNC_EVENT)event
{
if (event == NULL) {
NSLog(@"*** enqueueing NULL");
}
[self.queue enqueue:[NSValue valueWithBytes:&event objCType:@encode(SYNC_EVENT)]];
return 0;
}
@ -252,6 +257,7 @@ static __weak PEPSync *s_pEpSync;
[value getValue:&event];
return event;
} else {
NSLog(@"*** timeout event");
return new_sync_timeout_event();
}
}


+ 1
- 1
pEpObjCTests/PEPSessionTest.m View File

@ -1223,7 +1223,7 @@
XCTAssertNotNil(identMe.fingerPrint);
[self waitForExpectations:@[expHaveMessage] timeout:PEPTestInternalSyncTimeout];
[self waitForExpectations:@[expHaveMessage] timeout:1000];
XCTAssertEqual(self.sendMessageDelegate.messages.count, 1);
}


Loading…
Cancel
Save