ENGINE-322: more trust test cases ENGINE-332
authorKrista Bennett <krista@pep-project.org>
Wed, 24 Jan 2018 18:29:58 +0100
branchENGINE-332
changeset 244675d5cac2761a
parent 2445 c061bd2500bd
child 2447 b817f153633c
ENGINE-322: more trust test cases
test/trust_manipulation_test.cc
     1.1 --- a/test/trust_manipulation_test.cc	Wed Jan 24 18:23:21 2018 +0100
     1.2 +++ b/test/trust_manipulation_test.cc	Wed Jan 24 18:29:58 2018 +0100
     1.3 @@ -89,6 +89,18 @@
     1.4      assert(user->comm_type == PEP_ct_OpenPGP_unconfirmed);
     1.5      cout << "Yup, got key 1, and the trust status is PEP_ct_OpenPGP_unconfirmed." << endl;
     1.6      
     1.7 +    cout << "Let's mistrust key 1 too. It's been acting shifty lately." << endl;
     1.8 +    status = key_mistrusted(session, user);
     1.9 +    status = get_trust(session, user);
    1.10 +    assert(strcmp(user->fpr, keypair1) == 0);
    1.11 +    assert(user->comm_type == PEP_ct_mistrusted);
    1.12 +    cout << "Hoorah, we now do not trust key 1. (TRUST NO ONE)" << endl;
    1.13 +    cout << "Now we call update_identity to see what gifts it gives us (should be an empty key and a key not found comm_type.)" << endl;    
    1.14 +    status = update_identity(session, user);
    1.15 +    assert(user->fpr == NULL);
    1.16 +    assert(user->comm_type == PEP_ct_key_not_found);
    1.17 +    cout << "Yup, we trust no keys from " << uniqname << endl;
    1.18 +    
    1.19      cout << "Passed all of our exciting messing with the trust DB. Moving on..." << endl;
    1.20   
    1.21      free(user_id);