IOSAD-134 More concise. IOSAD-134
authorDirk Zimmermann <dz@pep.security>
Mon, 02 Sep 2019 16:47:25 +0200
branchIOSAD-134
changeset 1192ecbedb9e389f
parent 1191 31441cbef9ef
child 1193 735a6a9aa4ce
IOSAD-134 More concise.
pEpObjCTests/PEPSessionTest.m
     1.1 --- a/pEpObjCTests/PEPSessionTest.m	Mon Sep 02 16:47:25 2019 +0200
     1.2 +++ b/pEpObjCTests/PEPSessionTest.m	Mon Sep 02 16:47:25 2019 +0200
     1.3 @@ -1336,20 +1336,18 @@
     1.4  
     1.5      for (int i = 0; i < 10; ++i) {
     1.6          error = nil;
     1.7 -        BOOL expected = YES;
     1.8 -        if (i % 2 == 0) {
     1.9 +        BOOL enable = i % 2 == 0; // enable keysync on even numbers (roughly)
    1.10 +        if (enable) {
    1.11              XCTAssertTrue([session enableSyncForIdentity:identMe error:&error]);
    1.12 -            expected = YES;
    1.13          } else {
    1.14              XCTAssertTrue([session disableSyncForIdentity:identMe error:&error]);
    1.15 -            expected = NO;
    1.16          }
    1.17          XCTAssertNil(error);
    1.18  
    1.19          NSNumber *keySyncState = [session queryKeySyncEnabledForIdentity:identMe error:&error];
    1.20          XCTAssertNil(error);
    1.21          XCTAssertNotNil(keySyncState);
    1.22 -        if (expected) {
    1.23 +        if (enable) {
    1.24              XCTAssertTrue([keySyncState boolValue]);
    1.25          } else {
    1.26              XCTAssertFalse([keySyncState boolValue]);