IOSAD-172 Fix testTwentyPassphrases IOSAD-172
authorDirk Zimmermann <dz@pep.security>
Mon, 29 Jun 2020 16:39:43 +0200
branchIOSAD-172
changeset 1543674307ef48b9
parent 1542 c68371dfc71e
child 1544 4ebee94f06b2
IOSAD-172 Fix testTwentyPassphrases
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 @@ -61,8 +61,12 @@
     1.4          [self.cache addPassphrase:newPhrase];
     1.5      }
     1.6  
     1.7 -    XCTAssertEqual(self.cache.passphrases.count, passphrases.count + 1);
     1.8 -    NSMutableArray *expected = [NSMutableArray arrayWithArray:passphrases];
     1.9 +    NSMutableArray *expected = [NSMutableArray arrayWithCapacity:passphrases.count + 1];
    1.10 +    for (id obj in [passphrases reverseObjectEnumerator]) {
    1.11 +        [expected addObject:obj];
    1.12 +    }
    1.13 +
    1.14 +    XCTAssertEqual(self.cache.passphrases.count, expected.count + 1);
    1.15      [expected insertObject:@"" atIndex:0];
    1.16      XCTAssertEqualObjects(self.cache.passphrases, expected);
    1.17  }