ENGINE-409 reset_trust fixes
authorDirk Zimmermann <dirk@pep-project.org>
Tue, 27 Mar 2018 13:27:34 +0200
changeset 5549181c9c4f3f7
parent 553 3d19b5814b15
child 555 770d5f569ac9
ENGINE-409 reset_trust fixes
pEpObjCTests/PEPSessionTest.m
     1.1 --- a/pEpObjCTests/PEPSessionTest.m	Fri Mar 23 12:03:49 2018 +0100
     1.2 +++ b/pEpObjCTests/PEPSessionTest.m	Tue Mar 27 13:27:34 2018 +0200
     1.3 @@ -245,10 +245,9 @@
     1.4      XCTAssertNil(error);
     1.5      XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_have_no_key);
     1.6  
     1.7 -    XCTAssertFalse([session keyResetTrust:alice error:&error]);
     1.8 -    XCTAssertNotNil(error);
     1.9 -    XCTAssertEqual(error.code, PEP_OUT_OF_MEMORY);
    1.10 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_have_no_key);
    1.11 +    XCTAssertTrue([session keyResetTrust:alice error:&error]);
    1.12 +    XCTAssertNil(error);
    1.13 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_reliable);
    1.14  }
    1.15  
    1.16  - (void)testIdentityRatingTrustResetMistrustUndo
    1.17 @@ -300,7 +299,7 @@
    1.18  
    1.19      XCTAssertTrue([session keyResetTrust:alice error:&error]);
    1.20      XCTAssertNil(error);
    1.21 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_have_no_key);
    1.22 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_reliable);
    1.23  }
    1.24  
    1.25  /** ENGINE-384 */
    1.26 @@ -349,7 +348,7 @@
    1.27  
    1.28      XCTAssertTrue([session keyResetTrust:alice error:&error]);
    1.29      XCTAssertNil(error);
    1.30 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_have_no_key);
    1.31 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_reliable);
    1.32  
    1.33      // This line provoked the crash
    1.34      XCTAssertTrue([session trustPersonalKey:alice error:&error]);
    1.35 @@ -430,7 +429,7 @@
    1.36  
    1.37      XCTAssertTrue([session keyResetTrust:alice error:&error]);
    1.38      XCTAssertNil(error);
    1.39 -    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_have_no_key);
    1.40 +    XCTAssertEqual([self ratingForIdentity:alice session:session], PEP_rating_reliable);
    1.41  
    1.42      dispatch_group_wait(backgroundGroup, DISPATCH_TIME_FOREVER);
    1.43  }