Probably own identity issues. ENGINE-250
authorKrista Bennett <krista@pep-project.org>
Wed, 07 Feb 2018 16:16:40 +0100
branchENGINE-250
changeset 2482c713df1942dd
parent 2481 dd1eaa8cc1eb
child 2483 7fb3205f2893
Probably own identity issues.
test/case_and_dot_address_test.cc
     1.1 --- a/test/case_and_dot_address_test.cc	Wed Feb 07 16:05:04 2018 +0100
     1.2 +++ b/test/case_and_dot_address_test.cc	Wed Feb 07 16:16:40 2018 +0100
     1.3 @@ -25,9 +25,9 @@
     1.4      assert(session);
     1.5      cout << "init() completed.\n";
     1.6      
     1.7 +    char* user_id = get_new_uuid();
     1.8      
     1.9      const string alice_pub_key = slurp("test_keys/pub/pep-test-alice-0x6FF00E97_pub.asc");
    1.10 -    const string alice_priv_key = slurp("test_keys/priv/pep-test-alice-0x6FF00E97_priv.asc");
    1.11  
    1.12      const char* alice_email_case = "pEp.teST.AlICe@pEP-pRoJeCt.ORG";
    1.13      const char* alice_email_dot = "pe.p.te.st.a.l.i.ce@pep-project.org";
    1.14 @@ -35,15 +35,13 @@
    1.15      const char* alice_email_case_and_dot = "PE.p.teS.t.ALICE@pep-project.OrG";
    1.16  
    1.17      PEP_STATUS statuspub = import_key(session, alice_pub_key.c_str(), alice_pub_key.length(), NULL);
    1.18 -    PEP_STATUS statuspriv = import_key(session, alice_priv_key.c_str(), alice_priv_key.length(), NULL);
    1.19      assert(statuspub == PEP_STATUS_OK);
    1.20 -    assert(statuspriv == PEP_STATUS_OK);
    1.21  
    1.22 -    pEp_identity * alice_id = new_identity("pep.test.alice@pep-project.org", "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97", PEP_OWN_USERID, "Alice Test");
    1.23 -    identity_list* own_id = new_identity_list(alice_id);
    1.24 -    status = initialise_own_identities(session, own_id);
    1.25 +    pEp_identity * alice_id = new_identity("pep.test.alice@pep-project.org", "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97", user_id, "Alice Test");
    1.26 +
    1.27      status = trust_personal_key(session, alice_id);
    1.28 -    pEp_identity * new_alice_id = new_identity("pep.test.alice@pep-project.org", "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97", PEP_OWN_USERID, "Alice Test");
    1.29 +
    1.30 +    pEp_identity * new_alice_id = new_identity("pep.test.alice@pep-project.org", "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97", user_id, "Alice Test");
    1.31      status = update_identity(session, new_alice_id);
    1.32      assert(new_alice_id->fpr);
    1.33      assert(strcmp(new_alice_id->fpr, "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97") == 0);
    1.34 @@ -52,32 +50,32 @@
    1.35      alice_id = NULL;
    1.36      new_alice_id = NULL;
    1.37  
    1.38 -    alice_id = new_identity(alice_email_case, NULL, PEP_OWN_USERID, "Alice Test");
    1.39 -    status = myself(session, alice_id);
    1.40 +    alice_id = new_identity(alice_email_case, NULL, user_id, "Alice Test");
    1.41 +    status = update_identity(session, alice_id);
    1.42      assert(alice_id->fpr);
    1.43      cout << "Alice email: " << alice_email_case << " Alice fpr (should be 4ABE3AAF59AC32CFE4F86500A9411D176FF00E97): " << alice_id->fpr << endl;
    1.44      assert(strcmp(alice_id->fpr, "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97") == 0);
    1.45      free_identity(alice_id);
    1.46      alice_id = NULL;
    1.47  
    1.48 -    alice_id = new_identity(alice_email_dot, NULL, PEP_OWN_USERID, "Alice Test");
    1.49 -    status = myself(session, alice_id);
    1.50 +    alice_id = new_identity(alice_email_dot, NULL, user_id, "Alice Test");
    1.51 +    status = update_identity(session, alice_id);
    1.52      assert(alice_id->fpr);
    1.53      cout << "Alice email: " << alice_email_dot << " Alice fpr (should be 4ABE3AAF59AC32CFE4F86500A9411D176FF00E97): " << alice_id->fpr << endl;
    1.54      assert(strcmp(alice_id->fpr, "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97") == 0);
    1.55      free_identity(alice_id);
    1.56      alice_id = NULL;
    1.57  
    1.58 -    alice_id = new_identity(alice_email_dotless, NULL, PEP_OWN_USERID, "Alice Test");
    1.59 -    status = myself(session, alice_id);
    1.60 +    alice_id = new_identity(alice_email_dotless, NULL, user_id, "Alice Test");
    1.61 +    status = update_identity(session, alice_id);
    1.62      assert(alice_id->fpr);
    1.63      cout << "Alice email: " << alice_email_dotless << " Alice fpr (should be 4ABE3AAF59AC32CFE4F86500A9411D176FF00E97): " << alice_id->fpr << endl;
    1.64      assert(strcmp(alice_id->fpr, "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97") == 0);
    1.65      free_identity(alice_id);
    1.66      alice_id = NULL;
    1.67  
    1.68 -    alice_id = new_identity(alice_email_case_and_dot, NULL, PEP_OWN_USERID, "Alice Test");
    1.69 -    status = myself(session, alice_id);
    1.70 +    alice_id = new_identity(alice_email_case_and_dot, NULL, user_id, "Alice Test");
    1.71 +    status = update_identity(session, alice_id);
    1.72      assert(alice_id->fpr);
    1.73      cout << "Alice email: " << alice_email_case_and_dot << " Alice fpr (should be 4ABE3AAF59AC32CFE4F86500A9411D176FF00E97): " << alice_id->fpr << endl;
    1.74      assert(strcmp(alice_id->fpr, "4ABE3AAF59AC32CFE4F86500A9411D176FF00E97") == 0);