IOSAD-172 Fix testTwentyOnePassphrases IOSAD-172
authorDirk Zimmermann <dz@pep.security>
Mon, 29 Jun 2020 16:39:43 +0200
branchIOSAD-172
changeset 15455ca27ed9f55b
parent 1544 4ebee94f06b2
child 1546 4a258d6b7b93
IOSAD-172 Fix testTwentyOnePassphrases
pEpObjCTests/PEPPassphraseCacheTest.m
     1.1 --- a/pEpObjCTests/PEPPassphraseCacheTest.m	Mon Jun 29 16:39:43 2020 +0200
     1.2 +++ b/pEpObjCTests/PEPPassphraseCacheTest.m	Mon Jun 29 16:39:43 2020 +0200
     1.3 @@ -78,14 +78,14 @@
     1.4      }
     1.5  
     1.6      NSString *latestPassphrase = @"theLatest";
     1.7 -    [expectedPassphrases removeObjectAtIndex:0];
     1.8 -    [expectedPassphrases addObject:latestPassphrase];
     1.9 +
    1.10      [self.cache addPassphrase:latestPassphrase];
    1.11  
    1.12 -    XCTAssertEqual(self.cache.passphrases.count, expectedPassphrases.count + 1);
    1.13 -    NSMutableArray *expected = [NSMutableArray arrayWithArray:expectedPassphrases];
    1.14 -    [expected insertObject:@"" atIndex:0];
    1.15 -    XCTAssertEqualObjects(self.cache.passphrases, expected);
    1.16 +    expectedPassphrases = [NSMutableArray arrayWithArray:[self reversedArray:expectedPassphrases]];
    1.17 +    [expectedPassphrases replaceObjectAtIndex:0 withObject:latestPassphrase];
    1.18 +
    1.19 +    [expectedPassphrases insertObject:@"" atIndex:0];
    1.20 +    XCTAssertEqualObjects(self.cache.passphrases, expectedPassphrases);
    1.21  }
    1.22  
    1.23  - (void)testTimeout