IOSAD-172 Correct test IOSAD-172
authorDirk Zimmermann <dz@pep.security>
Fri, 26 Jun 2020 16:54:34 +0200
branchIOSAD-172
changeset 146292aa792fcbba
parent 1461 c7790f7d9185
child 1463 2be0d736625f
IOSAD-172 Correct test
pEpObjCTests/PEPPassphraseCacheTest.m
     1.1 --- a/pEpObjCTests/PEPPassphraseCacheTest.m	Fri Jun 26 16:54:34 2020 +0200
     1.2 +++ b/pEpObjCTests/PEPPassphraseCacheTest.m	Fri Jun 26 16:54:34 2020 +0200
     1.3 @@ -54,7 +54,7 @@
     1.4  - (void)testTwentyPassphrases
     1.5  {
     1.6      NSMutableArray *passphrases = [NSMutableArray arrayWithCapacity:20];
     1.7 -    for (NSUInteger i = 0; i < 20; ++i) {
     1.8 +    for (NSUInteger i = 1; i <= 20; ++i) {
     1.9          NSString *newPhrase = [NSString stringWithFormat:@"passphrase_%lu", (unsigned long) i];
    1.10          [passphrases addObject:newPhrase];
    1.11          [self.cache addPassphrase:newPhrase];
    1.12 @@ -69,7 +69,7 @@
    1.13  - (void)testTwentyOnePassphrases
    1.14  {
    1.15      NSMutableArray *expectedPassphrases = [NSMutableArray arrayWithCapacity:20];
    1.16 -    for (NSUInteger i = 0; i < 20; ++i) {
    1.17 +    for (NSUInteger i = 1; i <= 20; ++i) {
    1.18          NSString *newPhrase = [NSString stringWithFormat:@"passphrase_%lu", (unsigned long) i];
    1.19          [expectedPassphrases addObject:newPhrase];
    1.20          [self.cache addPassphrase:newPhrase];
    1.21 @@ -78,6 +78,7 @@
    1.22      NSString *latestPassphrase = @"theLatest";
    1.23      [expectedPassphrases removeObjectAtIndex:0];
    1.24      [expectedPassphrases addObject:latestPassphrase];
    1.25 +    [self.cache addPassphrase:latestPassphrase];
    1.26  
    1.27      XCTAssertEqual(self.cache.passphrases.count, expectedPassphrases.count + 1);
    1.28      NSMutableArray *expected = [NSMutableArray arrayWithArray:expectedPassphrases];