Browse Source

IOSAD-172 Delete tests affected by ENGINE-732

IOSAD-172
Dirk Zimmermann 2 years ago
parent
commit
65b7d02d93
1 changed files with 0 additions and 132 deletions
  1. +0
    -132
      pEpObjCTests/PEPSessionTest.m

+ 0
- 132
pEpObjCTests/PEPSessionTest.m View File

@ -917,62 +917,6 @@
expectedRating:PEPRatingTrustedAndAnonymized];
}
- (void)testEncryptMessagesWithoutKeys
{
PEPSession *session = [PEPSession new];
PEPIdentity *identMe = [[PEPIdentity alloc]
initWithAddress:@"me-myself-and-i@pep-project.org"
userID:@"me-myself-and-i"
userName:@"pEp Me"
isOwn:YES];
NSError *error = nil;
XCTAssertTrue([session mySelf:identMe error:&error]);
XCTAssertNil(error);
XCTAssertNotNil(identMe.fingerPrint);
PEPIdentity *identAlice = [[PEPIdentity alloc]
initWithAddress:@"alice@pep-project.org"
userID:@"alice"
userName:@"pEp Test Alice"
isOwn:NO];
PEPMessage *msg = [PEPMessage new];
msg.from = identMe;
msg.to = @[identAlice];
msg.shortMessage = @"Mail to Alice";
msg.longMessage = @"Alice?";
msg.direction = PEPMsgDirectionOutgoing;
NSNumber *numRating = [self testOutgoingRatingForMessage:msg session:session error:&error];
XCTAssertNotNil(numRating);
XCTAssertNil(error);
XCTAssertEqual(numRating.pEpRating, PEPRatingUnencrypted);
PEPMessage *encMsg = [session encryptMessage:msg extraKeys:nil status:nil error:&error];
XCTAssertNotNil(encMsg);
XCTAssertNil(error);
XCTAssertNotNil(encMsg);
PEPStringList *keys;
PEPRating pEpRating;
error = nil;
PEPMessage *decMsg = [session
decryptMessage:encMsg
flags:nil
rating:&pEpRating
extraKeys:&keys
status:nil
error:&error];
XCTAssertNotNil(decMsg);
XCTAssertNil(error);
XCTAssertEqual(pEpRating, PEPRatingUnencrypted);
XCTAssertNotNil(decMsg);
}
/**
ENGINE-364. Tries to invoke trustPersonalKey on an identity without key,
giving it a fake fingerprint.
@ -1553,82 +1497,6 @@
}
}
/**
Tests [PEPSessionProtocol keyResetAllOwnKeysError:error].
Does the following:
* Do a mySelf.
* Catch the sent out sync (beacon?) message.
* Do a key reset on all own identities ([PEPSessionProtocol keyResetAllOwnKeysError:error]).
* Catch the sent out sync message.
* Decrypt the caught sync messages.
*/
- (void)testDecryptBeaconsAfterKeyReset
{
PEPSession *session = [PEPSession new];
XCTAssertEqual(self.sendMessageDelegate.messages.count, 0);
XCTAssertNil(self.sendMessageDelegate.lastMessage);
PEPIdentity *identMe = [[PEPIdentity alloc]
initWithAddress:@"me-myself-and-i@pep-project.org"
userID:@"me-myself-and-i"
userName:@"pEp Me"
isOwn:YES];
NSError *error = nil;
XCTAssertTrue([session mySelf:identMe error:&error]);
XCTAssertNil(error);
XCTAssertNotNil(identMe.fingerPrint);
[self startSync];
XCTKVOExpectation *expHaveMessage1 = [[XCTKVOExpectation alloc]
initWithKeyPath:@"lastMessage"
object:self.sendMessageDelegate];
[self waitForExpectations:@[expHaveMessage1] timeout:PEPTestInternalSyncTimeout];
XCTAssertNotNil(self.sendMessageDelegate.lastMessage);
XCTAssertEqual(self.sendMessageDelegate.messages.count, 1);
PEPMessage *oldBeacon = self.sendMessageDelegate.lastMessage;
XCTAssertTrue([session keyResetAllOwnKeysError:&error]);
XCTAssertNil(error);
XCTKVOExpectation *expHaveMessage2 = [[XCTKVOExpectation alloc]
initWithKeyPath:@"lastMessage"
object:self.sendMessageDelegate];
[self waitForExpectations:@[expHaveMessage2] timeout:PEPTestInternalSyncTimeout];
XCTAssertNotNil(self.sendMessageDelegate.lastMessage);
XCTAssertEqual(self.sendMessageDelegate.messages.count, 2);
PEPMessage *newBeacon = self.sendMessageDelegate.lastMessage;
XCTAssertNotEqual(oldBeacon, newBeacon);
PEPRating rating;
PEPStringList *extraKeys;
PEPStatus status;
PEPMessage *decryptedOldBeacon = [session decryptMessage:oldBeacon
flags:nil
rating:&rating
extraKeys:&extraKeys
status:&status
error:&error];
XCTAssertNotNil(decryptedOldBeacon);
XCTAssertNil(error);
PEPMessage *decryptedNewBeacon = [session decryptMessage:newBeacon
flags:nil
rating:&rating
extraKeys:&extraKeys
status:&status
error:&error];
XCTAssertNotNil(decryptedNewBeacon);
XCTAssertNil(error);
[self shutdownSync];
}
#pragma mark - Helpers
- (void)testSendMessageOnSession:(PEPSession *)session


Loading…
Cancel
Save